Definitions of classes and methodsGeneral classes are inherited NSObject, a new class when the parent class select NSObject, OC only single inheritance, not many inheritance.
Below with a simple OC project to explain (need to configure the Xcode
C language should start from the chatty, from the foundation. It belongs to the best. Don't be misled by it. It also has very many errors and is not suitable for standard software developers to use. Variable declarations, definitions, programming
If the class follows the Nscoding protocol, the two instance methods of encoding and decoding the Protocol must be implemented in the class. This feature provides the underlying archive and file functionality.Small exercise:1. Define a Computer
Cggeometry reference defines geometry and functionality for easy operation. A point cgpoint in the data structure is represented in a two-dimensional coordinate system. The location and size of the data structure CGRect represents a rectangle. The
1. Add minus sign before methodThere is no concept of public and private in objective-c, that is to say that all are public. A minus sign represents the beginning of a function, method, and message. The plus sign means that you don't need to create
Use of KVC
1, KVC full name key valued coding key value codeThe reflection mechanism is in the running state, for any class, can know all the properties and methods of this class, for any one object, can call any of its methods and properties.
I. Grammatical specifications1. Class: Abstract description of a thing, such as the abstraction of humans, dogs and cats into animal classesTwo files in OC to describe a class1>. H: declaration file for a class declaring member variables and methods,
block of Objective-cTags: iosobjective-cos xblock2016-04-13 14:05 226 people read Comments (0) favorite reports Classification:Small white iOS notes (3)Copyright NOTICE: This article for Bo Master original article, without Bo Master permission
First, you need to figure out what the class is and what the object is. (To make this clear, let's start with a chestnut: examples of objects, such as: Human is a class; a person is an object; you are an instance; the instance itself is an object.)
Polymorphic The concept of polymorphismThere is an example of this. I told my colleague that I was thirsty in the morning. Result: A colleague took my cup to fetch me a glass of water. B My colleague took a disposable paper cup on the water
iOS methods often change, the previous popup box uses Alertview, and now uses the UialertcontrollerMacro definition of Alertview#define ShowMessage (__message__) \Uialertview *alertview_ = [[Uialertview alloc] initwithtitle:@ "hint"
The string is a very important and commonly used part of OC, the string in OC is different from the string I learned in C,c++,java, which is very similar to the concept of container in C + +, but the usage is still very different from it. Maybe it's
Category: Adding new methods to known classes; extension: Notifications use classes to declare private methods in the definition of this class;I. Category:1. Application of the class method:
To extend an existing class: for example, you can
As a result of the recent entry, the company arranged to study freely, so there is time to effective OBJECTIVE-C 2.0 a book to study again. As a result of the narrow personal knowledge, some of the contents of the book can not be understood
The Declaration and implementation of OC methodThe declaration of the OC method is @interface outside the curly braces @end aboveThe implementation of OC method @end above in @implementationIn the OC method, one parameter corresponds to a
Today learned a bit Uilabel Uitextfield UIButton uiimage These basic controls, uilabel nothing to say, because do not involve the exchange of work, remember a few properties on the line.Uitextfield this thing, encountered a lot of problems. I use
Instance variable:In fact, the explicit point is Ivar + setter + getter (instance variable + access method), but in OC the attribute is more literal this series of special keywords makes OC properties somewhat different.Member properties We should
OC Block actually functions like C language function pointers, JS in the closure and so on. The code block acts as a variable, with its own variables and scopes.Simply look at the syntax of block and the possible problems:Block Syntax:Block syntax
CocoaPods: manages various third-party open source library associations in the Objective-c programIn our iOS program, multiple third-party open-source libraries are often used. The common practice is to download the latest open-source library and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.