何かを解析しようとすると、奇妙なことが起こります。
でアイテムを数えています
NSString *bundlePathofPlist = [[NSBundle mainBundle]pathForResource:@"Mything" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:bundlePathofPlist];
NSArray *dataFromPlist = [dict valueForKey:@"some"];
NSMutableArray *data = [NSMutableArray array];
for(int i =0;i<[dataFromPlist count];i++)
{
//NSLog(@"%@",[dataFromPlist objectAtIndex:i]);
[data addObject:[NSNumber numberWithInt:[dataFromPlist count]]];
}
[self setTableData:data];
NSLog(@"%@", tableData);
その後:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [tableData count];
}
これはうまく機能しますが、その後- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
私は試した
NSString *bundlePathofPlist = [[NSBundle mainBundle]pathForResource:@"Mything" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:bundlePathofPlist];
NSArray *dataFromPlist = [dict valueForKey:@"some"];
NSLog(@"%@", dataFromPlist);
cell.Data.text = [NSString stringWithFormat:@"%@", dataFromPlist];
return cell;
しかし、出力は次のとおりです。
2012-08-13 23:08:48.130 [30278:707] (
Yeah,
Trol,
LOL,
)
そして、私のテーブルセルでは、次のようにも表示されます
(
Yeah,
Trol,
LOL,
)