第16页 | Beginning IOS Programming_ Building and Deploying IOS Applications | 阅读 ‧ 电子书库

同步阅读进度,多语言翻译,过滤屏幕蓝光,评论分享,更多完整功能,更好读书体验,试试 阅读 ‧ 电子书库

CHAPTER 2 ANSWERS

 
Smalltalk.The interface or header file with a .h file extension and the implementation file with a .m file extension.The NSObject class.The following code defines the ChapterExercise class with a single method named writeAnswer, which takes no arguments and returns nothing: @interface ChapterExercise : NSObject

- (void)writeAnswer;

@endYou would use this code to instantiate the ChapterExercise class: ChapterExercise *anInstance = [[ChapterExercise alloc] init];The retain keyword increments the reference count, whereas the release keyword decrements it.ARC stands for Automatic Reference Counting.The strong keyword indicates the class owns the instance of the object, and it will not be deallocated as long as the strong reference is in place.Overloading an operator is not permitted in Objective-C as it is in Java and C#.To compare to NSString instances, you use the isEqualToString: method.An instance of an NSArray cannot be modified after it’s created, whereas an NSMutableArray can be.MVC stands for Model-View-Controller.The following code shows how you declare the ChapterExercise class implements the ChapterExerciseDelegate protocol: @interface ChapterExercise : NSObject <ChapterExerciseDelegate>The NSError class.

请支持我们,让我们可以支付服务器费用。
使用微信支付打赏


上一页 · 目录下一页


下载 · 书页 · 阅读 ‧ 电子书库