我正在尝试使用 NSArray 来存储数据,但是当我记录它的类时(因为它给了我错误)它返回__NSDictionaryM
. 我唯一一次添加任何信息是当我这样做的时候
NSArray *a = [[NSArray alloc]initWithObjects:aa, nil];
对象aa
是一个字符串。什么会将数组变成字典?
好的,我使用委托将此数组传递给不同的类:
for (CXMLElement *resultElement in [[p objectAtIndex:0] elementsForName:@"TrackDetail"]) {
NSString *aa = resultElement.stringValue;
NSArray *a = [[NSArray alloc]initWithObjects:aa, nil];
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self.delegate XMLAvailable:a done:(a.count > 0)];
});
然后我在另一堂课上这样做
- (void)XMLAvailable:(NSArray *)array done:(BOOL)done{
NSMutableArray *indexPaths = [NSMutableArray arrayWithCapacity:[array count]];
for(int i = [self.imageInfos count]; i < [self.imageInfos count] + [array count]; ++i) {
NSIndexPath * indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[indexPaths addObject:indexPath];
}
NSLog(@"%@", array.class);
self.imageInfos = array;
NSLog(@"%@", self.imageInfos.class);
[self.tv insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight];
}
但由于某种原因,在上述方法中,array.class
日志__NSDictionaryM