摘要:
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1/*首先往消息中心注册一个检测针对的observer。*/[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleResult:) name:@"PostNO." ob 阅读全文
摘要:
Singleton 模式主要用来提供全局共享对象,在Objective-C中通过定义静态全局变量可实现这一模式://manager.h@interface Manager:NSObject+ (id)instance;@end//manager.m#import "manager.h"static Manager *sharedManager = nil;@implementation Manager+ (id)instance { if(sharedManager == nil) { sharedManager = [[super alloc]init]; ... 阅读全文