X-code6.3 创建xib文件
加载xib文件到控制器的两种方式(MS)
// 1.第一种方式
// NSArray * array = [[NSBundle mainBundle]loadNibNamed:@"cell" owner:nil options:nil];
// MyTableViewCell * cell = [array firstObject];...
分类:
移动开发 时间:
2015-05-27 19:09:36
阅读次数:
135
- (NSArray *)appList{ if (_appList == nil) { // appList保存的是字典=>模型// _appList = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle...
分类:
其他好文 时间:
2015-05-26 22:43:43
阅读次数:
186
之前用正则表达式进行身份证号校验,但是有时候错误的身份证号也能通过前端校验,后来发现这个方法还是不错,把代码贴出了给大家:
// 身份证号验证
+(BOOL)validateIdentityCard:(NSString*)cardNo{
if (cardNo.length != 18) {
return NO;
}
NSArray* codeArray...
分类:
其他好文 时间:
2015-05-26 18:49:15
阅读次数:
159
加载plist文件 1 @property (nonatomic) NSArray *list; 2 3 4 - (NSArray *)list{ 5 if (_list==nil) { 6 NSString *path=[[NSBundle mainBundle] pa...
分类:
其他好文 时间:
2015-05-26 15:40:47
阅读次数:
102
从一个弱引用导致的奔溃 谈 weak assign strong的应用场景.h中的定义方法一: @property (nonatomic, assign) NSArray *dataSource; 定义方法二 @property (nonatomic, strong) NSArray *dataSo...
分类:
移动开发 时间:
2015-05-26 06:43:09
阅读次数:
204
-(void)assetPickerController:(ZYQAssetPickerController *)picker didFinishPickingAssets:(NSArray *)assets{ for (int i = 0; i < assets.count; i ++) {...
分类:
Web程序 时间:
2015-05-25 18:12:37
阅读次数:
127
//??方法1:NSComparator
????
????NSArray?*listGroupname?=?[self.listTeams?sortedArrayUsingComparator:^(NSString?*n1,NSString?*n2)?{
????????
????????NSString?*...
分类:
移动开发 时间:
2015-05-23 20:11:33
阅读次数:
124
//判断有无新版:http://itunes.apple.com/lookup?id=项目的appid网络请求返回json块里://拿当前版本NSDictionary*infoDic=[[NSBundlemainBundle]infoDictionary];NSString*appVersion=[infoDicobjectForKey:@"CFBundleVersion"];//拿appstore上的版本NSArray*infoArray=[JSON..
分类:
移动开发 时间:
2015-05-23 18:45:12
阅读次数:
135
BOOL 类型用%d 输出NSRange range={11,7};//结构体赋值用{}NSMakeRange(11, 7); //快速创建的方法1.NSStringinitWithFormat:方法 通过给定格式化字符串 复制给字符串对象赋值stringWithFormat: 方法其实内部就是 a...
分类:
移动开发 时间:
2015-05-22 18:26:56
阅读次数:
180
写入数据到plist文件 ??//获取路径对象
????NSArray?*pathArray?=?NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,?NSUserDomainMask,?YES);
????NSString?*path?=?[pathArray?obj...
分类:
移动开发 时间:
2015-05-22 17:20:33
阅读次数:
184