2013年2月17日

self

摘要: The self variable is present in all Objective-C methods. it is one of two hidden arguments passed to code that implements a method. The initial value of self is always the object that received the message that led to the method's execution.The other hidden argument is _cmd, which identifies the 阅读全文

posted @ 2013-02-17 15:21 Chansonyan 阅读(110) 评论(0) 推荐(0)

Cocoa有3个framework组成

摘要: Cocoa有3个framework组成1. Foundation: 所有的面向对象语言都会有一些标准结构: value , collection , String, dates, lists, thread等等.所有的这些都在Foundation framework里面(可以对比C++的STL)2. Appkit: 所有和用户界面相关的类都在这里. Windows,buttons,text field, event, drawing. 它还有个名字: ApplicationKit3. Core Data: Core Data可以方便的让你把你的对象存储成文件,或是从文件中加载你的对象. 阅读全文

posted @ 2013-02-17 15:07 Chansonyan 阅读(136) 评论(0) 推荐(0)

Two-Stage Pattern & Initializers

摘要: Part 2 chapter 3 Two Stage patterns[[SomeClass alloc] init].Cocoa's NSObject base class provides two methods that allocate memory for new instances, +(id)alloc and +(id)allocWithZone:(NSZone *)aZone.The +alloc method is implemented to call the +allocWithZone: method specifying a default zone arg 阅读全文

posted @ 2013-02-17 01:04 Chansonyan 阅读(203) 评论(0) 推荐(0)

导航