摘要: xcode arc 下使用 block警告 Capturing [an object] strongly in this block is likely to lead to a retain cycle” in ARC-enabled code解决方法:方法一: ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:Api]]; __block ASIHTTPRequest *brRequest = request; [request setCompletionB... 阅读全文
posted @ 2014-01-15 15:40 cocoajin 阅读(4274) 评论(0) 推荐(0)
摘要: iOS key value coding kvc在接收json数据与 model封装中的使用使用 kvc 能够极大的简化代码工作,及以后的接口维护工作;1:先创建MovieModel类.h和 .m 注意Model类的属性根据 后台接口返回的 json数据 里面的字段对应,一一对应;// Created by cocoajin on 14-1-15.// Copyright (c) 2014年 www.zhgu.net. All rights reserved.//#import @interface MovieModel : NSObject@property (nonatomic,st... 阅读全文
posted @ 2014-01-15 15:31 cocoajin 阅读(1116) 评论(0) 推荐(0)
摘要: NSData 转 bytes 字节数据NSData *data = [NSData dataWithContentsOfFile:filePath];NSUInteger len = [data length];Byte *byteData = (Byte*)malloc(len);memcpy(byteData, [data bytes], len); NSString *strPath = @"/Users/user/Desktop/jkk.txt"; NSLog(@"string = %@",[[NSString alloc]initWithCon 阅读全文
posted @ 2014-01-15 11:26 cocoajin 阅读(7140) 评论(0) 推荐(0)