-(void)viewDidLoad{
for (int i=0; i<[rowsarray count]; i++) {
[mutabledict setObject:[rowsarray objectAtIndex:i] forKey:[datearray objectAtIndex:i]];
NSLog(@"mutable dict is :::%@",mutabledict);
}
NSLog(@"temp value is:::%@",mutabledict);
self.tableContents =mutabledict;
[mutabledict release];
NSLog(@"table %@",self.tableContents);
NSLog(@"table with Keys %@",[self.tableContents allKeys]);
self.sortedKeys =[[self.tableContents allKeys] sortedArrayUsingSelector:@selector(compare:)];
NSLog(@"sorted %@",self.sortedKeys);
// [tableContents release];
[sortedKeys release];
[rowsarray release];
[datearray release];
}
mutabledict 是一个 NsMutableDictionary,rowsarray 是一个对象数组,而 datearray 是一个键数组。此代码正确显示,但我正在尝试将数据添加到 tableview 然后控件将错误地转到 main.m。请帮助我。谢谢