在我的应用程序的第一次运行中,我向用户显示警报视图以选择iCloud或本地文档存储。显示警报视图导致以下错误:为什么在应用程序中显示UIAlertView:didFinishLaunchingWithOptions:导致错误?
Applications are expected to have a root view controller at the end of application launch wait_fences: failed to receive reply: 10004003
这究竟是为什么?你如何在启动时显示警报视图而不会出现此错误?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Check the user preferences for document storage options
if (![UserPreferencesHelper userDocumentStoragePreferencesHaveBeenCreated])
{
// User preferences have not been set, prompt the user to choose either iCloud or Local data storage
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Use iCloud?"
message:@"Would you like to store data in iCloud?"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"No", @"Yes", nil];
[alert show];
}
}
**更新**
我要指出,我使用的是iOS 5的故事板。根视图控制器在故事板中设置。
Darren,谢谢!这很有效=)。我在这个墙上撞了一会儿头...... – 2012-01-27 23:00:07