【发布时间】:2012-08-30 17:32:55
【问题描述】:
谁能指出我为什么会收到编译错误
[objToSend setObject:self.pathidEdit forkey:@"PathId"];
[objToSend setObject:indexData forkey:@"data"];
在下面的代码中?
NSMutableArray *indexData = [[NSMutableArray alloc]init];
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
NSMutableDictionary *objToSend = [NSMutableDictionary dictionary];
for(int i=0;i<myPathvideoArray.count;i++)
{
NSString *vId=[[myPathvideoArray objectAtIndex:i]valueForKey:@"videoId"];
NSNumber *indexNum = [NSNumber numberWithInt:i+1];
[dict setObject:vId forKey: @"VideoId"];
[dict setObject:indexNum forKey: @"index"];
[indexData addObject:dict];
}
[objToSend setObject:self.pathidEdit forkey:@"PathId"];
[objToSend setObject:indexData forkey:@"data"];
【问题讨论】:
-
myPathvideoArray 是字典数组?
-
不要介意“forKey”的 k 是小写字母... :D 谢谢...大声笑
标签: objective-c ios nsmutabledictionary