2013年2月21日

Category

摘要: pp63The Category pattern adds methods to existing classes and provides an alternative to subclassing in many situations. The added methods are inherited by all subclasses of the extended class and are indistinguishable at runtime from methods originally compiled into the class.The Category pattern c 阅读全文

posted @ 2013-02-21 00:06 Chansonyan 阅读(171) 评论(0) 推荐(0)

2013年2月20日

Dynamic Creation

摘要: Cocoa utilizes many features of the underlying Objective-C runtime. One powerful feature is the ability to create instances of classes that did not exist at the time an application was compiled and dynamically load and link new classes at runtime.The core of this pattern is the NSClassFromString() f 阅读全文

posted @ 2013-02-20 00:36 Chansonyan 阅读(244) 评论(0) 推荐(0)

2013年2月18日

Template Method

摘要: Cocoa Design Pattern pdfchapter 4In many cases, an algorithm or process consists of several steps that are needed by many applicaions and one or more steps that may be unique to each applicaiton. The Template Method pattern implements the common steps within a reusable class while still enabling app 阅读全文

posted @ 2013-02-18 23:00 Chansonyan 阅读(150) 评论(0) 推荐(0)

Convenience methods

摘要: Many Cocoa classed provide methods that combine the two stages of allocating and initializing to return temporary instances. Such methods are called convenience methods.Convenience methods include the name of the class in the method's name. For example, the NSString class provides the +(id)strin 阅读全文

posted @ 2013-02-18 16:01 Chansonyan 阅读(196) 评论(0) 推荐(0)

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)

2013年2月8日

MVC

摘要: pp4In an object-oriented application, information isn't just bytes; objects encapsulate information along with methods for using the information. Each object within your applicaiton should fit into exactly one of the following subsystems:Model: The Model subsystem is composed of the objects that 阅读全文

posted @ 2013-02-08 16:38 Chansonyan 阅读(112) 评论(0) 推荐(0)

2013年1月28日

First App:Bull's Eyes

摘要: From RayWenderlich's tutorial: The iOS Apprentice: Getting StartedAlert View1. View controllersThese three files together — the .xib, .h and .m — form the implementation of a view controller. The job of a view controller is to manage a single screen from your app. Simply put, the xib file contai 阅读全文

posted @ 2013-01-28 01:37 Chansonyan 阅读(179) 评论(0) 推荐(0)

2013年1月24日

Beginning ARC in iOS 5 Tutorial Part 2

摘要: http://www.raywenderlich.com/5773/beginning-arc-in-ios-5-tutorial-part-2In this second and final part of the series, we’ll cover how to convert files by hand, ARC as it relates to Core Foundation, weak properties, and much more!@implementation MainViewController{ NSOperationQueue *queue; NSMut... 阅读全文

posted @ 2013-01-24 04:38 Chansonyan 阅读(180) 评论(0) 推荐(0)

导航