First of all, the most important thing is not the code but the compiler option, make sure to change the compiler's compile Sources as option to objective C + + before doing a hybrid compilation.The default option is according to file type, in which
. h header file, which declares some public properties, methods. Header files generally do not put too much stuff, there is no need to expose too many interfaces, private and encapsulation.. m master file, used to implement methods in. h files, and
Remember that when you first learned OC, it was always unclear to instance variables and attributes.For example, when printing the name of the person class object in the code below, when to use name with "_",NSLog (@ "%@",p1->_name); When to
"Original" to talk about the misunderstanding of agent mode in Objective-cPlease specify the source of the article reproduced-- polobymulberry-Blog Park1. Preface
This article mainly compares the proxy mode and the delegate mode, and
The purpose of the class and extension is to extend a class.Category (category) in the Objective-cI. Definition and role of class purposeCategory is also called classification, the English category, in the absence of the original class. m file based
Self,superSelf is understood as this in C + +, and when the method is called with self, the lookup starts from the current class, and the previous parent class is not searched in turn.Super is the parent class, and you can call the method of the
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
first, the difference between the @dynamic and the @synthesize @property has two corresponding words, one is@synthesize, one is @dynamic. If @synthesize and @dynamic are not written, then the default is @syntheszie var =_var; The semantics of
The difference between an object and a normal variable
If you ' re used to using terms like the stack and the heap, a local variable was allocated on the stack, while objects be a Llocated on the heap.
-(void) f{ int2;
In general, OBJECTIVE-C access member variable visibility is the same as C + +, just a few @package. The following is a detailed description:Example:@interface ctperson:nsobject{ @private int _age; @protected *_name; @public Double
Original link: http://blog.leichunfeng.com/blog/2015/06/26/objective-c-associated-objects-implementation-principle/ We know that in objective-c, you can add attributes to an existing class by category, but you can't add an instance variable, which
OverviewSince the launch of the WWDC 2015 and the Open source Swift 2.0, everyone's enthusiasm for Swift has soared again, while the envious startups ' friends talk about Swift's new features, as well as many developers who still need to stick to
Objective-cObjective-c extends the C language and joins the object-oriented and Smalltalk messaging mechanisms. The core of this extension is a runtime library written in C and compiled languages. It is the cornerstone of Objective-c object-oriented
First, the knowledge point:1. Nested use of dual models2, the button of the Alignment method3, optimize the load of UITableView4, the use of Layoutsubview5, the cell's folding agentTwo, nested definitions of two models:Note that the self.friends is
Playing a few controls and gestures today reminds me of the time I used to play unity, drag controls, set properties, and write some corresponding values.GestureSteps to use gestures:1. Create a gesture that meets your needs, and when you create it,
rules for memory management :1.alloc created must be freed, convenience constructor created do not release2. Objects added to the container are executed once retain operation, reference count plus 13. The container removes the object and sends a
Definition and use of a category
Definition and use of two extension
Definition and use of three protocol
Use of delegate
I. Definition and use of categoryCategory, category, or category. The primary role is to add
Stringstring divided into variable string and immutable stringhow immutable strings are initializedNSString *string = [[NSString alloc] init];NSString *string = [NSString string];string is not a container class cannot add data NSString *string =
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service