1

当视图刚刚加载到屏幕上时,我想更新我的核心数据数据库,我知道默认方法:

- (void)viewDidLoad
{
[super viewDidLoad];

}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}

在视图加载或消失时调用,但我的问题是,是否存在类似上述方法的默认方法,或者存在一种在视图加载到屏幕上之后调用方法的方法,并且我看到了我的图形?不是当显示器仍然是黑色的时候,因为它正在加载......

4

1 回答 1

2
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    // Here is the place where you should call your function.
}

但请注意:当您在主线程中更新 coredata 时,您的界面将在更新期间被阻塞。

于 2012-04-09T16:13:33.030 回答