摘要:
捕捉屏幕截图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 阅读全文
摘要:
测试网络连接BOOL hasInet;Reachability *connectionMonitor = [Reachability reachabilityForInternetConnection];[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(inetAvailabilityChanged:) name: kReachabilityChangedNotification object: connectionMonitor];hasInet = [connec... 阅读全文