AppDelegateからUIViewControllerのUI要素を設定する必要があります。ストーリーボードを使用するので、UIViewControllerはAppDelegateで初期化されません。ストーリーボードからUIViewControllerをインスタンス化するときにAppDelegateからUIを変更できない
私はとのUIViewControllerのインスタンスを取得しよう:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
TableViewController* myTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"myTableViewController"];
しかし、私はここのように、UINavigationBarのUIBarButtonItemのようないくつかのUI要素を設定しようとすると:
UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshEntry)];
myTableViewController.navigationItem.rightBarButtonItem = refreshButton;
UINavigationBar滞在空白とUIBarButtonItemが表示されません...
UIを変更するにはどうすればよいですか?
ありがとう!ありがとうございます! Thantの解決策:3 – Lindemann
私は今、問題が何であるか知っていることを知った、同様の質問:http://stackoverflow.com/questions/8784143/accessing-a-view-controller-created-through-storyboard-using- the-app-delegate – Lindemann