上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页
摘要: property with 'weak' attribute must be of object type:I have this in my interface:@property(nonatomic, weak)NSTimeInterval*timeStamp;Or:@property (nonatomic, weak) float height;Which my logic told me, I need a time stamp object, that only is going to be used by this class within the context 阅读全文
posted @ 2013-04-28 20:22 cateatmycode 阅读(865) 评论(0) 推荐(0) 编辑
摘要: UIViewContentModeScaleToFillUIViewContentModeScaleAspectFitUIViewContentModeScaleAspectFillUIViewContentModeRedrawUIViewContentModeCenterUIViewContentModeTopUIViewContentModeBottomUIViewContentModeLeftUIViewContentModeRightUIViewContentModeTopLeftUIViewContentModeTopRightUIViewContentModeBottomLeftU 阅读全文
posted @ 2013-04-24 18:58 cateatmycode 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 创建UITableViewController子类的实例后,IDE生成的代码中有如下段落:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = [NSString stringWithFormat:@"Cell"]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: 阅读全文
posted @ 2013-03-25 23:57 cateatmycode 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 在写 JavaScript 的时候,可以使用一个叫做 window 的对象,像是我们想要从现在的网页跳到另外一个网页的时候,就会去修改 window.location.href 的位置;在我们的 Objective C 程序码中,如果我们可以取得指定的 WebView 的指标,也就可以拿到这个出现在 JavaScript 中的 window 对象,也就是 [webView windowScriptObject]。这个对象就是 WebView 里头的 JS 与我们的 Obj C 程序之间的桥樑-window 对象可以取得网页里头所有的 JS 函数与对象,而如果我们把一个 Obj C 对象设定成 阅读全文
posted @ 2013-03-25 19:18 cateatmycode 阅读(469) 评论(0) 推荐(0) 编辑
摘要: AFNetwork是一个轻量级的网络请求api类库。是以NSURLConnection, NSOperation和其他方法为基础的。下面这个例子是用来处理json请求的:NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/stream/0/posts/stream/global"];NSURLRequest *request = [NSURLRequest requestWithURL:url];AFJSONRequestOperation *operation = [AFJSONRequestOper 阅读全文
posted @ 2013-03-22 16:50 cateatmycode 阅读(964) 评论(0) 推荐(0) 编辑
摘要: 1:在github上下载https://github.com/yjxsf8313/asi-http-request2:引入1)在项目下新建一个Group,命名为ASIHttp,鼠标右击,选中“Add files to ....”,将下载的ASIHttprequest库中的class文件夹都引用进来,并将Externl文件夹中的Reachability添加到class下。留下ASIWebPageRequest这个文件夹,其他的都删掉2)添加ASIHttprequest的依赖Frameworks:SystemConfiguration.framework, MobileCoreServices.f 阅读全文
posted @ 2013-03-22 15:09 cateatmycode 阅读(339) 评论(0) 推荐(0) 编辑
摘要: libz.dylibA file ending in the extension.dylibis a dynamic library: it's a library that's loaded at runtime instead of at compile time. If you're familiar with DLLs from Windows or DSOs, it's more or less the same type of thing with a few twists. TheDynamic Library Programming Topics 阅读全文
posted @ 2013-03-21 20:27 cateatmycode 阅读(288) 评论(0) 推荐(0) 编辑
摘要: C/C++中使用#include来包含头文件,缺点就是同一个头文件可能被包含多次。Objective-C中使用了#import来包含头文件,优点就是同一个头文件只能包含一次。@class和#import是为了解决循环引用导致的死锁问题#import会包含这个类的所有信息,包括实体变量和方法,而@class只是告诉编译器,其后面声明的名称是类的名称,至于这个类是如何定义的,暂时不用考虑,后面会再告诉使用者。在类的声明.h文件中一般只需要知道被引用的类的名称就可以了,不需要知道其内部的实体变量和方法,所以在类的声明.h文件中一般使用@class来声明这个名称是类的名称。而在实现类里面。因为会用到这 阅读全文
posted @ 2013-03-13 20:53 cateatmycode 阅读(175) 评论(0) 推荐(0) 编辑
摘要: BOOL使用8位存储,YES定义为1,NO定义为0,大于1不为YES,跟标准C不同。id是一种泛型,用于表示任何类的对象,id实际上是一个指针,指向其中的某个结构@implementation是一个编译器指令,表明你将为某个类提供代码继承(X是一个Y,isa)Objective-C不支持多继承,我们可以通过Objective-C的其他特性获取多继承的优点,例如分类和协议方法调度当代码发送消息时,Objective-C的方法调度将在当前分类中搜索相应的方法,如果找不到,则在该对象的超类中进行查找复合(X有一个Y,has)if (self = [super init]) { //将[super i 阅读全文
posted @ 2013-03-13 13:00 cateatmycode 阅读(232) 评论(0) 推荐(0) 编辑
摘要: nonatomic:非原子性访问,对属性赋值的时候不加锁,多线程并发访问会提高性能。如果不加此属性,则默认是两个访问方法都为原子型事务访问。(atomic是Objc使用的一种线程保护技术,基本上来讲,是防止在写未完成的时候被另外一个线程读取,造成数据错误。而这种机制是耗费系统资源的,所 以在iPhone这种小型设备上,如果没有使用多线程间的通讯编程,那么nonatomic是一个非常好的选择。)assign:简单赋值,不更改索引计数对基础数据类型 (例如NSInteger)和C数据类型(int,float,double,char, 等) 适用简单数据类型copy:建立一个索引计数为1的对象,.. 阅读全文
posted @ 2013-03-13 12:45 cateatmycode 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页