I have a subclass of GMSMarker called customMarker.
My user gets notifications every time he approaches one of the markers on the map.
I want that when the user clicks on a notification, the marker will be already selected (when the app opens from the notification) adn its infoWindow will be visible.
I try to do it like this:
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
AroundersViewController *aroundersVC=[[UIStoryboard storyboardWithName:#"Main" bundle:nil] instantiateViewControllerWithIdentifier:#"aroundersPage"];
NSString *markerIdentifier=[[notification userInfo] objectForKey:#"markerIdentifier"];
CustomMarker *notificationsMarker=[self.monitorLocationVC markerForIdentifier:markerIdentifier];
[aroundersVC mapView:aroundersVC.mapView didTapMarker: notificationsMarker]; //App crashes here
}
But the app crashes with this error log message:
2016-02-11 20:39:30.355 App[15887:4216691] -[AroundersViewController mapView:didTapMarker:]: unrecognized selector sent to instance 0x7fa01bcf5890
2016-02-11 20:39:30.365 App[15887:4216691] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AroundersViewController mapView:didTapMarker:]: unrecognized selector sent to instance 0x7fa01bcf5890'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105257e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000104cd0deb objc_exception_throw + 48
2 CoreFoundation 0x000000010526048d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001051ad727 ___forwarding___ + 487
4 CoreFoundation 0x00000001051ad4b8 _CF_forwarding_prep_0 + 120
5 App 0x0000000101988dab -[AppDelegate application:didReceiveLocalNotification:] + 523
6 UIKit 0x000000010561cdc5 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 3650
7 UIKit 0x0000000105622cc1 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 214
8 UIKit 0x0000000105622b95 -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 508
9 UIKit 0x0000000105602007 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 159
10 UIKit 0x0000000105601c94 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 843
11 FrontBoardServices 0x0000000108027754 -[FBSSerialQueue _performNext] + 192
12 FrontBoardServices 0x0000000108027ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
13 CoreFoundation 0x0000000105183a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010517995c __CFRunLoopDoSources0 + 556
15 CoreFoundation 0x0000000105178e13 __CFRunLoopRun + 867
16 CoreFoundation 0x0000000105178828 CFRunLoopRunSpecific + 488
17 GraphicsServices 0x0000000107e53ad2 GSEventRunModal + 161
18 UIKit 0x0000000105604610 UIApplicationMain + 171
19 App 0x000000010199fd7f main + 111
20 libdyld.dylib 0x0000000106c7f92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Does anybody have an idea?
Thanks!
Related
I am trying to implement Google SignIn in my iOS project and getting runtime error at line:
GIDSignIn.sharedInstance().clientID = "mysecrectkey.apps.googleusercontent.com"
in AppDelegate. Error I am getting is something like below. I followed each step which is mentioned in following link and still no luck.
http://www.theappguruz.com/blog/integrate-google-signin-sdk-in-ios-application-using-swift
I tried adding -ObjC in Other Linker Flags section as well. Please help me to figure this out. Thanks
2016-10-09 17:16:57.754 GoogleLoginTest1[8996:611837] -[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector sent to instance 0x618000071a80
2016-10-09 17:16:57.758 GoogleLoginTest1[8996:611837] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector sent to instance 0x618000071a80'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ce2234b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010c46621e objc_exception_throw + 48
2 CoreFoundation 0x000000010ce91f34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010cda7c15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010cda7798 _CF_forwarding_prep_0 + 120
5 GoogleLoginTest1 0x000000010bb4272e -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 11318
6 GoogleLoginTest1 0x000000010bb44551 -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 19033
7 GoogleLoginTest1 0x000000010bb43fc4 -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 17612
8 GoogleLoginTest1 0x000000010bb223ed _TFC16GoogleLoginTest111AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 685
9 GoogleLoginTest1 0x000000010bb22594 _TToFC16GoogleLoginTest111AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180
10 UIKit 0x000000010da4068e -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290
11 UIKit 0x000000010da42013 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236
12 UIKit 0x000000010da483b9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
13 UIKit 0x000000010da45539 -[UIApplication workspaceDidEndTransaction:] + 188
14 FrontBoardServices 0x00000001131ac76b __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
15 FrontBoardServices 0x00000001131ac5e4 -[FBSSerialQueue _performNext] + 189
16 FrontBoardServices 0x00000001131ac96d -[FBSSerialQueue _performNextFromRunLoopSource] + 45
17 CoreFoundation 0x000000010cdc7311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x000000010cdac59c __CFRunLoopDoSources0 + 556
19 CoreFoundation 0x000000010cdaba86 __CFRunLoopRun + 918
20 CoreFoundation 0x000000010cdab494 CFRunLoopRunSpecific + 420
21 UIKit 0x000000010da43db6 -[UIApplication _run] + 434
22 UIKit 0x000000010da49f34 UIApplicationMain + 159
23 GoogleLoginTest1 0x000000010bb24cdf main + 111
24 libdyld.dylib 0x000000010fc4d68d start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
have you added Other linker flag : -OjcC
I see this error when I try to initialize parse with app key and client key.
2015-10-08 13:29:56.484 My wish List[7892:4257341] -[ParseManager initWithApplicationId:clientKey:]: unrecognized selector sent to instance 0x7fe86ac35ef0
2015-10-08 13:29:56.491 My wish List[7892:4257341] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ParseManager initWithApplicationId:clientKey:]: unrecognized selector sent to instance 0x7fe86ac35ef0'
*** First throw call stack:
(
0 CoreFoundation 0x00000001045bef65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000104038deb objc_exception_throw + 48
2 CoreFoundation 0x00000001045c758d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000104514f7a ___forwarding___ + 970
4 CoreFoundation 0x0000000104514b28 _CF_forwarding_prep_0 + 120
5 My wish List 0x00000001026c7d5f +[Parse setApplicationId:clientKey:] + 212
6 My wish List 0x000000010266d07d -[AppDelegate application:didFinishLaunchingWithOptions:] + 109
7 UIKit 0x00000001049624ca -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
8 UIKit 0x0000000104963670 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
9 UIKit 0x0000000104969e15 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
10 UIKit 0x0000000104966ff0 -[UIApplication workspaceDidEndTransaction:] + 188
11 FrontBoardServices 0x000000010c7847ac -[FBSSerialQueue _performNext] + 192
12 FrontBoardServices 0x000000010c784b1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
13 CoreFoundation 0x00000001044eb0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x00000001044e0fcc __CFRunLoopDoSources0 + 556
15 CoreFoundation 0x00000001044e0483 __CFRunLoopRun + 867
16 CoreFoundation 0x00000001044dfe98 CFRunLoopRunSpecific + 488
17 UIKit 0x000000010496698d -[UIApplication _run] + 402
18 UIKit 0x000000010496b676 UIApplicationMain + 171
19 My wish List 0x000000010266d30f main + 111
20 libdyld.dylib 0x0000000105f0292d start + 1
21 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I am really confused as to why this is happening.
Since this happened randomly
Here is the stacktrace, I have not been able to figure it out.
Please help
Thanks
2015-03-30 15:12:50.817 MarcoApp[1857:23629] -[NSIBPrototypingLayoutConstraint finishedLoading]: unrecognized selector sent to instance 0x7f929ccc8cf0
2015-03-30 15:12:50.908 MarcoApp[1857:23629] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSIBPrototypingLayoutConstraint finishedLoading]: unrecognized selector sent to instance 0x7f929ccc8cf0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010aa74a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a333bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010aa7bd1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010a9d39dc ___forwarding___ + 988
4 CoreFoundation 0x000000010a9d3578 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x000000010aa447fc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
6 CoreFoundation 0x000000010a944204 _CFXNotificationPost + 2484
7 Foundation 0x0000000109e8ddf8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
8 UIKit 0x000000010b73baa7 -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:] + 1054
9 UIKit 0x000000010b748833 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 87
10 UIKit 0x000000010b7487cd -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 349
11 UIKit 0x000000010b73345a -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 486
12 FrontBoardServices 0x00000001115ae243 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
13 CoreFoundation 0x000000010a9a9c7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
14 CoreFoundation 0x000000010a99f9c5 __CFRunLoopDoBlocks + 341
15 CoreFoundation 0x000000010a99f785 __CFRunLoopRun + 2389
16 CoreFoundation 0x000000010a99ebc6 CFRunLoopRunSpecific + 470
17 GraphicsServices 0x000000010e89ca58 GSEventRunModal + 161
18 UIKit 0x000000010b735580 UIApplicationMain + 1282
19 MarcoApp 0x0000000109184afe top_level_code + 78
20 MarcoApp 0x0000000109184bda main + 42
21 libdyld.dylib 0x000000010ee2b145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
hard to tell without seeing your code but "unrecognized selector sent to instance" implies you have a method the requires a selector (name of a function) as a parameter and that methods got an invalid selector (the name of the function is wrong).
not sure but ther is any method in
- (void)applicationWillResignActive:(UIApplication *)application
which does not have selector thats why you app crash
In my new app I have to external links. One in the view that only is shown the very first time the app is started and one in tab3. The link in tab3 is working, but the link in the initial screen is giving a crash, while exactly the same code is used.
Code for ViewController.h
- (IBAction)findAllyId;
Code for ViewController.m
- (IBAction)findAllyId {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://youtu.be/H_AguOLEHW8"]];
}
Error log after pressing the Button that is linked to this findAllyId
2015-03-13 19:03:30.666 Friend codes for Kingdom Age[89581:40810062] -[ViewController findAllyId]: unrecognized selector sent to instance 0x7facaa694530
2015-03-13 19:03:30.674 Friend codes for Kingdom Age[89581:40810062] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController findAllyId]: unrecognized selector sent to instance 0x7facaa694530'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e141a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010dddabb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010e148d1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010e0a09dc ___forwarding___ + 988
4 CoreFoundation 0x000000010e0a0578 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010c430a22 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x000000010c537e50 -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010c53721f -[UIControl touchesEnded:withEvent:] + 522
8 UIKit 0x000000010c476b68 -[UIWindow _sendTouchesForEvent:] + 735
9 UIKit 0x000000010c477493 -[UIWindow sendEvent:] + 683
10 UIKit 0x000000010c443fb1 -[UIApplication sendEvent:] + 246
11 UIKit 0x000000010c451227 _UIApplicationHandleEventFromQueueEvent + 17700
12 UIKit 0x000000010c42c23c _UIApplicationHandleEventQueue + 2066
13 CoreFoundation 0x000000010e076c91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010e06cb5d __CFRunLoopDoSources0 + 269
15 CoreFoundation 0x000000010e06c194 __CFRunLoopRun + 868
16 CoreFoundation 0x000000010e06bbc6 CFRunLoopRunSpecific + 470
17 GraphicsServices 0x000000010fc5aa58 GSEventRunModal + 161
18 UIKit 0x000000010c42f580 UIApplicationMain + 1282
19 Friend codes for Kingdom Age 0x000000010b9f9d83 main + 115
20 libdyld.dylib 0x000000010e6af145 start + 1
21 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Again, exactly the same code (with a different URL) is working in another screen of the app, with a click on a button.
2011-04-20 18:38:41.347 RIE[1683:607] -[UICGColor _shouldContinuePlaybackInBackground]: unrecognized selector sent to instance 0x28db10
2011-04-20 18:38:41.417 RIE[1683:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICGColor _shouldContinuePlaybackInBackground]: unrecognized selector sent to instance 0x28db10'
*** Call stack at first throw:
(
0 CoreFoundation 0x342ed64f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x35570c5d objc_exception_throw + 24
2 CoreFoundation 0x342f11bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x342f0649 ___forwarding___ + 508
4 CoreFoundation 0x34267180 _CF_forwarding_prep_0 + 48
5 MediaPlayer 0x344628b7 -[MPMoviePlayerViewController _moviePlayerViewController_applicationDidEnterBackgroundNotification:] + 42
6 Foundation 0x333b5183 _nsnote_callback + 142
7 CoreFoundation 0x342bc20f __CFXNotificationPost_old + 402
8 CoreFoundation 0x34256eeb _CFXNotificationPostNotification + 118
9 Foundation 0x333b25d3 -[NSNotificationCenter postNotificationName:object:userInfo:] + 70
10 UIKit 0x36364d01 -[UIApplication _handleApplicationSuspend:eventInfo:] + 500
11 UIKit 0x362feaf9 -[UIApplication handleEvent:withNewEvent:] + 1916
12 UIKit 0x362fe215 -[UIApplication sendEvent:] + 44
13 UIKit 0x362fdc53 _UIApplicationHandleEvent + 5090
14 GraphicsServices 0x33e58e77 PurpleEventCallback + 666
15 CoreFoundation 0x342c4a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
16 CoreFoundation 0x342c683f __CFRunLoopDoSource1 + 166
17 CoreFoundation 0x342c760d __CFRunLoopRun + 520
18 CoreFoundation 0x34257ec3 CFRunLoopRunSpecific + 230
19 CoreFoundation 0x34257dcb CFRunLoopRunInMode + 58
20 GraphicsServices 0x33e5841f GSEventRunModal + 114
21 GraphicsServices 0x33e584cb GSEventRun + 62
22 UIKit 0x36328d69 -[UIApplication _run] + 404
23 UIKit 0x36326807 UIApplicationMain + 670
24 Motor Show 0x0000219b main + 70
25 Motor Show 0x00002150 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
Hard to say given just the stack trace, but I would suggest the following:
Implement applicationWillResignActive: in your UIApplicationDelegate to ensure that video playback is paused or stopped before the application enters the background.
Create a custom UIApplication subclass to use in your app, and override the _handleApplicationSuspend:eventInfo: method so that it returns without propagating the event to other classes further down the chain.
Figure out how to unregister your MPMoviePlayerViewController component from the notification center so that it does not receive the 'ApplicationDidEnterBackgroundNotification'.