ios - What is error: "NSInvalidArgumentException reason: Application tried to present modal view controller on itself -


When I try to run the app, it crashes me. This is the message I received:

  2014-07-25 14:40: 28.116X [13023: 60B] (faucet) 2014-07-25 14:40: 29.113X [13023: 60b] *** Exception of the exception Due to termination of 'NSi Validate Agreement', the reason: 'The application has to present the controller of the Model View Controller trying to present itself on itself & lt; GKHostedAuthenticateViewController: 0x10d625f90 & gt; '*** 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 called] 308 5 UIKit 0x0000000101181abc - [_ UIDelayedPresentationContext finishDelayedPresentation:] + 201 6 GameCenterUI 0x000000010c97f330 __41- [GKRemoteViewController setupRemoteView] _block_invoke + 37 7 CoreFoundation 0x0000000102896f1c __invoking___ + 140 8 called CoreFoundation 0x0000000102896dc4 - [NSInvocation] 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 Korfoundeshn 0x00000001028ff289 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_Q UEUE__ + 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 start 0x000000010366e5fd +1) libc ++ Abi.dylib: With the exception of exceptions without the finished NSEX (LLDB)   

What could be the problem? Update: @Sviatoslav Yakymiv I think that I think it

  - local user {if authentication (if gameCenter is available!) Return; GKLocalPlayer * Local Player = [Junkelockplayer Localplayer]; If (SYSTEM_VERSION_LESS_THAN (@ "6.0")) {// iOS 5.x and below [Local Player Authorization Statement End Closure Handler: ^ (NSER * Error) {[Self Check Lockplayer]; }]; } Other {// iOS 6.0 and above [Local Player PlaceSetAuthorHandler: (^ (UIViewController * Visual Controller, NSError * Error) {If (! Error & amp; Controller) {[View Controller ViewController: Animated Viewfinder : Yes complete: zero];} other {[self check lockplayer];}})); }   

}

Can I change it without crash? Thank you

You are trying to introduce the controller yourself. Your code probably has something like the following:

  [auto current ViewController: self complete: zero];   

Now after looking at your code I can provide the job code:

Change

  [viewcontroller presentViewController: animated viewer : Yes complete: zero];   

  [[UIApplication ShareApp] .keyWindow.rootViewController presentViewController: Monitoring Controller: Yes Completed: Zero];    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -