摘要: 捕捉屏幕截图CALayer实例使用Core Graphics的renderInContext方法可以将视图绘制到图像上下文中以便转化为其他UIImage实例。前提先#import <QuartzCore/QuartzCore.h>+ (UIImage *) imageFromView: (UIView *)theView{ // draw a view's contents into an image context UIGraphicsBeginImageContext(theView.frame.size); CGContextRef context = UIGraph 阅读全文
posted @ 2012-06-05 17:03 妙笔 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 测试网络连接BOOL hasInet;Reachability *connectionMonitor = [Reachability reachabilityForInternetConnection];[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(inetAvailabilityChanged:) name: kReachabilityChangedNotification object: connectionMonitor];hasInet = [connec... 阅读全文
posted @ 2012-06-05 10:20 妙笔 阅读(218) 评论(0) 推荐(0) 编辑