NSMutableArray 是一个可变数组,是NSArray的子类,但是不可以添加空值 创建NSMutableArray的方法 +(id)arrarWithCapacity:(NSInteger)numItems -(id)initWithCapacity:(NSInteger)numItems ...
分类:
其他好文 时间:
2015-06-02 19:27:18
阅读次数:
137
问题描述:当我们需要通过遍历数组过滤的时候,一般会考虑以下写法,这种写法 会引起crash*** Collection was mutated while being enumerated. 1 NSMutableArray *mutableArray = [[NSMutableArray all....
分类:
编程语言 时间:
2015-06-02 13:05:17
阅读次数:
133
情况1:array=nil;[_PayArray addObject:BillDetail];此时array还是nil:因为array没有分配地址应该。情况2:Array=[[NSMutableArray alloc]init];[_PayArray addObject:BillDetail];此时...
分类:
其他好文 时间:
2015-06-02 00:02:03
阅读次数:
299
1 //数组的遍历(可变数组举例) 2 //for遍历 3 NSMutableArray *aa = [NSMutableArray array]; 4 [aa addObjectsFromArray:@[@"ss",@"ddd",@...
分类:
编程语言 时间:
2015-06-01 18:37:07
阅读次数:
246
NSMutableArray *p = [[NSMutableArray alloc] initWithObjects:@"3",@"5",@"4",@"1",@"7",@"6",@"4",nil]; for (int i = 0; i b) { [p replaceObjectAtIndex:i....
分类:
编程语言 时间:
2015-05-31 21:24:09
阅读次数:
127
ActivitiesViewController.h里面{ BOOL bol;//判定优惠券下拉菜单的开关}@property(retain,nonatomic)NSMutableArray *array;@property (retain, nonatomic)UIView *aselectvi....
分类:
移动开发 时间:
2015-05-30 16:35:31
阅读次数:
217
导入头文件#import "ChineseInclude.h"#import "PinYinForObjc.h" NSMutableArray *searchResults;//可变数组,添加搜索到的数据设置数据源- (NSArray *)dataArray { if (!_dataAr...
分类:
其他好文 时间:
2015-05-29 20:18:50
阅读次数:
124
代码如下#import "ViewController.h"#import "JRProvince.h"@interface ViewController ()/** 省份数据数组*/@property(nonatomic,strong) NSMutableArray * province;/** ...
分类:
其他好文 时间:
2015-05-26 21:16:51
阅读次数:
173
The following should be avoided: NSMutableArray?*aMutableArray?=?[@[]?mutableCopy]; The problems with the previous notation are both of efficiency and readability. On the efficiency side, an un...
分类:
其他好文 时间:
2015-05-26 12:53:33
阅读次数:
122
UITableView分组显示省份城市列表+右侧索引
例题:分组名为省份名称,组内容为对应省份的城市名称,点击右边的索引,将对应的省份分组显示到到第一行。
显示效果如下:
对应plist文件如下图所示:
#import "ViewController.h"
//遵守协议
@interface
Vie...
分类:
其他好文 时间:
2015-05-25 13:06:51
阅读次数:
209