myprecious

2012年7月12日 #

[转]深入浅出 Cocoa 多线程编程之 block 与 dispatch quene

摘要: 转自:http://www.cppblog.com/kesalin/archive/2011/08/26/dispatch_queue_block.htmlblock 是 Apple 在 GCC 4.2 中扩充的新语法特性,其目的是支持多核并行编程。我们可以将 dispatch_queue 与 block 结合起来使用,方便进行多线程编程。本文源代码下载:点击下载1,实验工程准备在 XCode 4.0 中,我们建立一个 Mac OS X Application 类型的 Command Line Tool,在 Type 里面我们选择 Foundation 就好,工程名字暂且为 StudyBloc 阅读全文

posted @ 2012-07-12 17:18 myprecious 阅读(156) 评论(0) 推荐(0) 编辑

[转] JsonKit

摘要: http://www.14oranges.com/2011/08/how-to-use-jsonkit-for-ios-and-the-rotten-tomatoes-api/优点, 1 只有2个文件 2 使用简单 //Then import JSONKit.h” in your .m files where ever you need to parse a JSON response import "JSONKit.h" //Whenever you have JSON data that you need to parse (more on how to get som 阅读全文

posted @ 2012-07-12 09:29 myprecious 阅读(177) 评论(0) 推荐(0) 编辑

2012年7月11日 #

转义字符

摘要: \b 退格 \f 走纸换页 \n 换行 \r 回车 \t 横向跳格 (Ctrl-I) \' 单引号 \" 双引号 \\ 反斜杠 阅读全文

posted @ 2012-07-11 11:27 myprecious 阅读(109) 评论(0) 推荐(0) 编辑

[转]Objective-c中@class和#import

摘要: 二者的区别在于:1.import会包含这个类的所有信息,包括实体变量和方法,而@class只是告诉编译器,其后面声明的名称是类的名称,至于这些类是如何定义的,暂时不用考虑,后面会再告诉你。2.在头文件中,一般只需要知道被引用的类的名称就可以了。不需要知道其内部的实体变量和方法,所以在头文件中一般使用@class来声明这个名称是类的名称。而在实现类里面,因为会用到这个引用类的内部的实体变量和方法,所以需要使用#import来包含这个被引用类的头文件。3.在编译效率方面考虑,如果你有100个头文件都#import了同一个头文件,或者这些文件是依次引用的,如A–>B, B–>C, C–& 阅读全文

posted @ 2012-07-11 11:24 myprecious 阅读(97) 评论(0) 推荐(0) 编辑

[转]@synthesize window=_window之类的写法的理解

摘要: From:http://blog.csdn.net/ch_soft/article/details/6981584在32位系统中,如果类的 @interface 部分没有进行 ivar 声明,但有 @property 声明,在类的 @implementation 部分有响应的 @synthesize,则会得到类似下面的编译错误:Synthesized property 'xX' must either be named the same as a compatible ivar or must explicitly name an ivar在 64-bit时,运行时系统会自动给 阅读全文

posted @ 2012-07-11 11:20 myprecious 阅读(144) 评论(0) 推荐(0) 编辑

导航