- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
当我尝试运行该应用程序时,它使我崩溃这是我收到的消息:
2014-07-25 14:40:28.116 X[13023:60b] (null)
2014-07-25 14:40:29.113 X[13023:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modal view controller on itself. Presenting controller is <GKHostedAuthenticateViewController: 0x10d625f90>.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001028a1495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001024e399e objc_exception_throw + 43
2 UIKit 0x0000000101190cdc -[UIViewController presentViewController:withTransition:completion:] + 4100
3 CoreFoundation 0x0000000102896f1c __invoking___ + 140
4 CoreFoundation 0x0000000102896dc4 -[NSInvocation invoke] + 308
5 UIKit 0x0000000101181abc -[_UIDelayedPresentationContext finishDelayedPresentation:] + 201
6 GameCenterUI 0x000000010c97f330 __41-[GKRemoteViewController setupRemoteView]_block_invoke + 37
7 CoreFoundation 0x0000000102896f1c __invoking___ + 140
8 CoreFoundation 0x0000000102896dc4 -[NSInvocation invoke] + 308
9 libdispatch.dylib 0x000000010340a851 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000010341d72d _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000010340d3fc _dispatch_main_queue_callback_4CF + 354
12 CoreFoundation 0x00000001028ff289 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x000000010284c854 __CFRunLoopRun + 1764
14 CoreFoundation 0x000000010284bd83 CFRunLoopRunSpecific + 467
15 GraphicsServices 0x0000000103efdf04 GSEventRunModal + 161
16 UIKit 0x0000000101090e33 UIApplicationMain + 1010
17 X 0x00000001000064c3 main + 115
18 libdyld.dylib 0x000000010366e5fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
可能是什么问题?直到现在它运作良好突然发生了感谢所有帮助者
更新:@Sviatoslav Yakymiv我认为找到了这个
- (void)authenticateLocalUser {
if (!gameCenterAvailable) return;
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
if (SYSTEM_VERSION_LESS_THAN(@"6.0"))
{
// ios 5.x and below
[localPlayer authenticateWithCompletionHandler:^(NSError *error)
{
[self checkLocalPlayer];
}];
}
else
{
// ios 6.0 and above
[localPlayer setAuthenticateHandler:(^(UIViewController* viewcontroller, NSError *error) {
if (!error && viewcontroller)
{
[viewcontroller presentViewController:viewcontroller animated:YES completion:nil];
}
else
{
[self checkLocalPlayer];
}
})];
}
我可以在不崩溃的情况下改变什么?谢谢
最佳答案
您正试图从自身呈现 Controller 。可能您的代码包含如下内容:
[self presentViewController:self completion:nil];
现在,在我看到您的代码后,我可以提供工作代码:
替换
[viewcontroller presentViewController:viewcontroller animated:YES completion:nil];
与
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:viewcontroller animated:YES completion:nil];
关于ios - 什么是错误 : "NSInvalidArgumentException reason: Application tried to present modal view controller on itself,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24955097/
let appDelegate = UIKit.UIApplication.shared.delegate! if let tabBarController = appDelegate
我的演示文稿终于成功了。我的第一个屏幕有一个主要的 activity,第二个屏幕有一个 Presentation。我的问题是,我无法更改演示 View 中的内容。 为什么我不能在第二个屏幕上显示演示文
这个问题在这里已经有了答案: ios, getting a pointer to a controller from a view (5 个答案) 关闭 4 年前。 我有一个 uiview 文件,我
我有一个表示小部件的 View 类和一个随附的演示者类。我还有一个 View 类,用于拥有小部件的窗口,以及窗口 View 的随附演示者。窗口操作小部件,所以我需要窗口展示器与小部件展示器进行通信。可
关闭相机后。它给了我这个警告:在演示过程中尝试继续演示! - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picke
由于这个错误,我无法切换到另一个 View Controller 。我想在成功扫描二维码后切换到另一个 View Controller 。 2015-01-27 17:59:16.093 *[5416
有时它会发生 - 从代码的不同地方 - 我们想要做 UIViewController.presentViewController(a, b, c),有时我们已经在呈现了,在这种情况下我们得到: 警告:
这是我的第一个 iOS 应用程序。 所以我有一个 UIVIewController 和一个 UITableView,其中我按顺序集成了一个 UISearchBar 和一个 UISearchContro
我的模式允许一个特定的元素是可选的,但是当我稍后在文件中遇到一个不同的也是可选的元素时,我需要前一个元素存在。我如何通过 XSD 确保这一点? 例子: true 应该是有效的,
我正在使用 xcode 4.5.2 并为相机按钮创建了自己的 OverlayViewController。 现在,当我的委托(delegate) Controller - TakePhotoViewC
如何在 MVP 中创建 View ? Presenter 是否总是创建它们(除了 subview 的 View 之外)?或者它是一个单独的第三方组件或应用程序或创建它们的东西? 我们还要补充一点,我可
当我调用viewController.presentViewController时,如果已经存在另一个 Controller ,则会出现以下警告。 Warning: Attempt to presen
我有一个关于 React Native 的模块,并在这个问题的标题中抛出错误。这是模块的代码,我不知道 swift 或 Objective-C,所以我需要你像“swift for idiots”一样解
我在 didSelectRowAtIndexPath 中选择一个 segue 时收到上面的警告。这发生在 iPad 上。 iPhone 给出了不同的警告,我会看看是否可以解决这个问题。 我在方法中确实
我的应用程序中有一个包含两个场景的 StoryBoard - 它使用自动转场(在 IB 中创建)。当在第一个 UIViewController 中单击按钮时,第二个 UIViewController
如何在成功验证登录后转到我的第二页? 我已经从登录页面 View Controller (不是登录按钮)拉出一个 segue 到下一页,并将该 segue 命名为“nextPage”。 (如果我从登录
我正在构建一个应用程序,最近发现了由传统转场引起的巨大内存泄漏。因此我了解了 unwind segue。如果我简单地使用,一切都很好: @IBAction func prepareForUnw
我不知道如何将按钮添加到 link_to_add_fields 中 在我制作的 Rails 应用程序中。 我尝试在各处添加 class: "btn btn-mini btn-info",但我一直收到
大家好,感谢阅读。我正在制作一个应用程序,您可以在其中拍照并从相机胶卷中检索照片并将其显示在 View 中。问题是,当我尝试使用调出相机胶卷的按钮时,出现如上标题中的错误“演示正在进行中”。 如果我注
我有一个模型,其中有两个字段在技术上可以为空。字段名称是 :is_activated 和 :activated_at。 :activated_at 仅在 :is_activated 设置为 true
我是一名优秀的程序员,十分优秀!