我用它來創建UITableView
,並使用NSArray
創建標籤。遵循教程here。現在我試圖創建UITableView
從我的服務器提取動態內容。數據的拉動與JSON的作品很好,我指定爲這樣:UITableView動態單元格內容
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSString *responseString1 = [[NSString alloc] initWithData:responseData1 encoding:NSUTF8StringEncoding];
NSLog(@"%@",responseString1);
SBJsonParser *parser = [[SBJsonParser alloc] init];
id sample = [parser objectWithString:responseString1];
tempholder=[NSMutableArray arrayWithCapacity:[sample count]];
for (int i = 0; i < [sample count]; i++) {
[tempholder addObject:[[sample objectAtIndex:i]objectAtIndex:0]];
//NSLog(@"%@",[sample objectAtIndex:i]);
NSLog(@"%@",[tempholder objectAtIndex:i]);
}
}
那麼,如何更換
tableData = [NSArray arrayWithObjects:@"Item", @"Item",
@"Item", @"Item", @"Item", @"Item", @"Item",
@"Item", @"Item", nil];
這是我
- (void)viewDidLoad
與「tempholder」 NSMutableArray
?
Thanx提前...
是資料表使用加載你的細胞中的cellForRowAtIndexPath陣列? – Petar 2013-03-25 15:41:45