0
任何人都可以指出我爲什麼會收到編譯錯誤爲的NSMutableDictionary無可見接口聲明的選擇的setObject:forkey:
[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是字典的數組? – msk
不要說「forKey」的k是在小寫字母......:D謝謝...大聲笑 –