アプリ内でユーザーが設定した plist があります。その plist の内容を UITableView に表示しようとしていますが、アプリが再起動されるまで表示されません。つまり、更新されていません。ここに私が持っているものがあります:
- (void)viewDidLoad
{
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
NSString *path = [[NSBundle mainBundle] pathForResource:@"foodList" ofType:@"plist"];
arrayFood = [[NSMutableArray alloc]initWithContentsOfFile:path];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView reloadData];
NSString *path = [[NSBundle mainBundle] pathForResource:@"foodList" ofType:@"plist"];
arrayFood = [[NSMutableArray alloc]initWithContentsOfFile:path];
}
前もって感謝します!