05 2013 档案
Xcode 4.4 的新特性 | LLVM 4.0 的新语法
摘要:WWDC 2012苹果全球开发者大会上,苹果针对LLVM编译器都做了重大改进,新版的Xcode 4.4中的LLVM编译器升级到了4.0,给Objective-C带来了很多令人惊喜的特性。注意,下面的语法需要下载Xcode 4.4。1、枚举类型的改变老写法:[cpp]view plaincopytypedefenumWeek{Moday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}Week;老方法的问题是枚举值的数据范围是模糊的,这个数值可能非常大,可能是负数,无法界定新写法:[cpp]view plaincopytypedefenumWe 阅读全文
posted @ 2013-05-30 14:15 easonoutlook 阅读(345) 评论(0) 推荐(0)
UIButton设置 textAlignment 属性的方法
摘要:button.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;button.contentHorizontalAlignment =UIControlContentVerticalAlignmentLeft; 阅读全文
posted @ 2013-05-27 18:13 easonoutlook 阅读(2711) 评论(0) 推荐(0)
ipa包中图片进行了Compress之后的主要处理和作用
摘要:iPhone的CgBI格式的png则将原始的png图片作如下变化:增加一个新的关键块 CgBI Chunk 四个字节zlib的header和CRC信息全部从IDAT中移除红蓝交换,每一个像素(RGBA)中的R和B进行调换变成BGRA ,解压后每一个像素有四个字节组成,也就是将每一个像素的 第一个字节和第三个字节调换透明像素处理 Premultiplied Alpha,这个的意思是为了图像加载变得更快,预先将Alpha的信息乘到像素的颜色信息中去,这样后期计算的时候就可以减少CPU或者GPU计算了 阅读全文
posted @ 2013-05-27 16:10 easonoutlook 阅读(456) 评论(0) 推荐(0)
ASIFormDataRequest [request startSynchronous] 方法 crash问题的解决方式
摘要:[[self readStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]];出错位置定义到这行代码http://stackoverflow.com/questions/8906758/debugger-stopping-on-asihttprequests-schedulereadstream-with-no-errorstackoverflow上面的解释在自己的代码中,修改如下:修改之前request.url = [NSURL URLWithString:urlString]修改之后[ 阅读全文
posted @ 2013-05-20 11:45 easonoutlook 阅读(537) 评论(0) 推荐(0)
NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: WebKitLocalStorageDatabasePathPreferenc
摘要:在iOS5.1以后的版本中,清除所有的NSUserDefaults Data的时候会报错,直接crash在清除的时候用一下代码,问题解决。NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];NSDictionary *userDefaultsDictionary = [userDefaults dictionaryRepresentation];NSString *strWebDatabaseDirectory = [userDefaultsDictionary objectForKey:@"Web 阅读全文
posted @ 2013-05-17 11:26 easonoutlook 阅读(2064) 评论(0) 推荐(0)
UIImagePickerController crash in iOS6, iPhone4S
摘要:The preferredInterfaceOrientationForPresentation method will rotate your view to whatever you set it to when a view is loaded. Be careful as when you come back to your view it may be upside down. Do not include this method if you don’t want it to override the current orientation when you dismiss say 阅读全文
posted @ 2013-05-17 04:24 easonoutlook 阅读(419) 评论(0) 推荐(0)
25个增强iOS应用程序性能的提示和技巧
摘要:在开发iOS应用程序时,让程序具有良好的性能是非常关键的。这也是用户所期望的,如果你的程序运行迟钝或缓慢,会招致用户的差评。然而由于iOS设备的局限性,有时候要想获得良好的性能,是很困难的。在开发过程中,有许多事项需要记住,并且关于性能影响很容易就忘记。本文收集了25个关于可以提升程序性能的提示和技巧,把性能优化技巧分为3个不同的等级:初级、中级和高级初级在开发过程中,下面这些初级技巧需要时刻注意:1.使用ARC进行内存管理2.在适当的情况下使用reuseIdentifier3.尽可能将View设置为不透明(Opaque)4.避免臃肿的XIBs5.不要阻塞主线程6.让图片的大小跟UIImage 阅读全文
posted @ 2013-05-02 20:43 easonoutlook 阅读(2561) 评论(0) 推荐(5)
UIBezierPath贝塞尔曲线的常用方法总结
摘要:1、根据一个矩形画曲线+ (UIBezierPath*)bezierPathWithRect:(CGRect)rect2、根据矩形框的内切圆画曲线+ (UIBezierPath*)bezierPathWithOvalInRect:(CGRect)rect3、根据矩形画带圆角的曲线+ (UIBezierPath*)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius4、在矩形中,可以针对四角中的某个角加圆角, 一般用于设置某个视图的顶端两角为圆形+ (UIBezierPath*)bezierPathWi 阅读全文
posted @ 2013-05-02 20:34 easonoutlook 阅读(3285) 评论(0) 推荐(0)