【发布时间】:2016-02-01 07:23:24
【问题描述】:
我试图在用户离线时显示选定的单元格复选标记,但数组没有添加另一个数组对象,请帮助我
1.appDelegate.SelectedIDArray保存选中的单元格
2.buildingObject.selectedIDString保存检查单元格索引逗号分隔
//首先我从数组中删除所有对象
[appDelegate.SelectedIDArray removeAllObjects];
//然后我在数组中添加字符串值(例如 3,2,7)
NSMutableArray *tempArray = (NSMutableArray*)[buildingObject.selectedIDString componentsSeparatedByString:@","];
//现在在appDelegate.SelectedIDArray中添加tempArray数组对象
[appDelegate.SelectedIDArray addObjectsFromArray:tempArray];
//现在在 appDelegate.SelectedIDArray 中显示添加对象的计数
txtID.text=[NSString stringWithFormat:@"%zd of 23 selected",appDelegate.SelectedIDArray.count];
【问题讨论】:
-
是
appDelegate.SelectedIDArray == nil? -
是
appDelegate.SelectedIDArray == nil? -
是的,我正在删除所有对象
-
哦,FFS。 您分配了阵列吗?
-
检查我的答案好友
标签: ios objective-c iphone arrays