我想在屏幕上加载视图时更新我的核心数据库,我知道默认方法:
- (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];
}
在视图加载时调用,或者在消失时调用,但我的问题是,存在一个默认方法,如上面的方法,或者存在一种方法,只是在视图加载到屏幕后调用方法,我看到我的图片?当显示器仍然是黑色时,因为它正在加载......
答案 0 :(得分:2)
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// Here is the place where you should call your function.
}
但请注意:当您在主线程中更新核心数据时,您的界面将在更新期间被阻止。