摘要: Timers的替代方法如果只是要延迟消息的发送,可以使用NSObject的方法- (void)performSelector:(SEL)aSelectorwithObject:(id)anArgumentafterDelay:(NSTimeInterval)delay- (void)performSelectorOnMainThread:(SEL)aSelectorwithObject:(id)argwaitUntilDone:(BOOL)wait+ (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget创建Timer的三种方法1.s 阅读全文
posted @ 2014-02-21 16:17 无涯之径 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审查的。Apple的例程Reachability中介绍了取得/检测网络状态的方法。在你的程序中使用Reachability只须将该例程中的Reachability.h和Reachability.m拷贝到你的工程中。如下图:然后将SystemConfiguration.framework添加进工程:Reachability中定义了3种网络状态。//thenetworkstateofthedeviceforReachability1.5.typedefenum{NotReachable=0,R 阅读全文
posted @ 2014-02-21 14:48 无涯之径 阅读(294) 评论(0) 推荐(0) 编辑