随笔分类 -  ios小技巧

如何为ios程序增加itunes同步功能
摘要:其实很简单, 编辑工程的xxxinfo.plist文档 增加一项Application supports iTunes file sharing 将Value设置为Yes, 则可以在同步项目中看到自己应用的名字以及document目录下的内容了.xcode 4.0 测试过 阅读全文

posted @ 2012-11-15 17:50 无量少年 阅读(125) 评论(0) 推荐(0)

iphone图片等比缩放
摘要:UIImage *img = imgView.image;int h = img.size.height;int w = img.size.width;if(h <= 320 && w <= 480){imgView.image = img;}else{float b = (float)320/w < (float)480/h ? (float)320/w : (float)480/h;CGSize itemSize = CGSizeMake(b*w, b*h);UIGraphicsBeginImageContext(itemSize);CGRect imag 阅读全文

posted @ 2012-11-15 17:45 无量少年 阅读(163) 评论(0) 推荐(0)

iphone程序中实现截屏的一种方法
摘要:/导入头文件#import <QuartzCore/QuartzCore.h>//将整个self.view大小的图层内容创建一张图片imageUIGraphicsBeginImageContext(self.view.bounds.size);[self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];UIImage*image= UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();///////////// objectiv 阅读全文

posted @ 2012-11-15 17:21 无量少年 阅读(159) 评论(0) 推荐(0)

在 控制台(console)打印 Stack Trace
摘要:在 控制台(console)打印 Stack Trace创建一个方法(处理异常并输出到控制台):1 void uncaughtExceptionHandler(NSException *exception) 2 {3 NSLog(@"CRASH: %@", exception);4 NSLog(@"Stack Trace: %@", [exception callStackSymbols]);5 // Internal error reporting6 }在 app delegate 中添加异常处理器(exception handler):1 - (BO 阅读全文

posted @ 2012-11-15 16:28 无量少年 阅读(771) 评论(0) 推荐(0)

导航