このコードを試す
pList ファイルにデータを書き込む
NSString *filePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSMutableArray *arr = [NSMutableArray new];
for (char value = 'a'; value<='z'; value++) {
[arr addObject:[NSString stringWithFormat:@"%c",value]];
}
NSDictionary *dict = [NSDictionary dictionaryWithObject:arr forKey:@"alphabet"];
[dict writeToFile:filePath atomically:YES]
numberOfSectionsInTableView を設定します
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return [[dict objectForKey:@"alphabet"]count];
}
numberOfRowsInSection を設定します
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 1;
}
cellForRowAtIndexPath にセル テキストを設定する
[[cell textLabel] setText:[[dict objectForKey:@"alphabet"]objectAtIndex:indexPath.section]];