Important knowledge point personal understanding record
The first article: OC is the message structure language, runtime parsing, compile-time not care
Article Two: Introduction of the head file try not to. h file (compilation trouble), where to import, generally in. m import. Don't forget that @class can be declared in the. h file.
Article Three: multi-use simplified syntax, such as nsarray *a = @[@ "x", @ "XX"]; for variable arrays [@[@ "S", @ "SS"] mutablecopy];
Fourth: Less defining constants with # define. static nsstring *const xxx = @ "222";
. h file
#import "BaseViewController.h"
Static const int kwidth = 3;
Static const int khigh;
extern nsstring *const constkey;
@interface constviewcontroller: baseviewcontroller
@end
. m file
#import "ConstViewController.h"
const int khight = +;
NSString *const Constkey = @ "111";
@interface constviewcontroller ()
@end
@implementation Constviewcontroller
-(void) viewdidload {
[Super viewdidload];
}
-(void) didreceivememorywarning {
[Super didreceivememorywarning];
}
@end
Effective OBJECTIVE-C 2.0 first day of study