OC point syntax and variable scopes
One, point grammar
(a) Understanding point grammar
Declare a person class:
Copy Code code as follows:
#import
@interface Person:nsobject{int _age;//defaults to @protected}
-(void)
objective-c Attribute Properties (assign, retain, copy, ReadOnly, ReadWrite, Atomic, nonatomic)
The following article is reproduced from: http://blog.csdn.net/zhangao0086/article/details/6674460, this article is very thorough,
This time the main content is block, for beginners, the code involved in the content of the block is really easy to confuse. First of all, the concept of block, block is an apple for C, C + + and OC add a feature, it contains a part of the code, can
Understanding Method Swizzling is a good opportunity to learn the runtime mechanism. Not much to do in this, only translated by Mattt Thompson published in Nshipster's method swizzling article.Method Swizzling is a technique that changes the actual
SuperIn Objective-c, if we need to invoke a method of the parent class in a method of a class, we usually use Super, as follows:@interface MyViewController: UIViewController@end@implementation MyViewController- (void)viewDidLoad { [super
Objective-c language is a dynamic language that puts a lot of static language in the process of compiling and linking things to the runtime. At the same time OC is also a simple language, a large part of the content of C, just add the language level
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
1,assign:Simple assignment without changing the index countSuppose you allocate a piece of memory with malloc and assign its address to pointer a, and then you want pointer b to share the memory, so you assign a to (assign) B. At this time A and B
Uiscrollview Controls and Uipagecontrol controls: Uiscrollview is used to display more than one screen, content that goes beyond the screen can be viewed by swiping, and of course Uipagecontrol can be paged. Uiscrollview tend to be used with
NSDate: Acquisition and manipulation of time1. Get the current time1 // Get Current date 2 NSDate *date = sender.date; 3 NSLog (@ "%@", date);2. Convert date to string and format1 // " Span style= "color: #008000;" >date to string 2
Understanding Method Swizzling is a good opportunity to learn the runtime mechanism. Not much to do in this, only translated by Mattt Thompson published in Nshipster's method swizzling article.Method Swizzling is a technique that changes the actual
Management scope: Any object that inherits NSObject, basic data types are not managedEssential reason: Because the object and the basic data type in the system storage space is not the same, the local variable is mainly stored in the stack, and the
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
#文档名: Programming with OBJECTIVE-C# #关于Objective-C (abbreviation OC)When writing programs to iOS and OS X, OBJECTIVE-C is the primary language used by programmers. OC is an extended set of C languages that provides object-oriented features and a
We know that in C, using sizeof () to calculate the number of bytes occupied in the memory, after referencing string.h, use strlen () to calculate the length of the string (not including).In Object-c, the "Length" method can return the length of a
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 usage of @property and @synthesize in Objective-c1. Keywords @property and @synthesize are paired in Obj-c and are used to simplify the coding of declarations and implementations;egdeclaration in the header file (. h)@property int
When you write a objective-c program, you always use a few classes, which belong to the foundation framework. While it is technically possible to write objective-c code without the foundation framework, it is often used in this framework. These
Outline:
Introduction
Notes compared with the C Language
Objective-C advanced features
Development Tool introduction (cocoa toolkit features, framework, source file organization; xcode usage Introduction)
Introduction:
1. Objective-C is
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