App crashing on first use of UIImagePickerController - ios

I am trying to use a UIImagePickerController in my app and am getting a crash after being prompted for access to the photo album for the first time. Here is the crash error:
[PUUIAlbumListViewController requiresAuth]: unrecognized selector sent to instance 0xd6a18b0
I can't find any references to this error anywhere. Anyone have any clues? Thanks!
-(void)showPicker
{
self.imagePicker = [[UIImagePickerController alloc]init];
self.imagePicker.delegate = self;
self.imagePicker.allowsEditing = NO;
self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imagePicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
self.imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:self.imagePicker animated:YES completion:nil];
}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PUUIAlbumListViewController requiresAuth]: unrecognized selector sent to instance 0xd1587d0'
*** First throw call stack:
(
0 CoreFoundation 0x03bcb5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0394e8b6 objc_exception_throw + 44
2 CoreFoundation 0x03c68903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x03bbb90b ___forwarding___ + 1019
4 CoreFoundation 0x03bbb4ee _CF_forwarding_prep_0 + 14
5 MyApp Mobile 0x000042e8 -[MyAppDelegate applicationDidBecomeActive:] + 2989
6 UIKit 0x027afef4 -[UIApplication _stopDeactivatingForReason:] + 329
7 UIKit 0x027b5afb _alertItemStateChanged + 81
8 CoreFoundation 0x03c27733 __CFNotificationCenterAddObserver_block_invoke + 163
9 CoreFoundation 0x03c27524 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
10 CoreFoundation 0x03c277fd ____CFXNotificationPostToken_block_invoke + 173
11 CoreFoundation 0x03b8a1c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
12 CoreFoundation 0x03b533f9 __CFRunLoopDoBlocks + 361
13 CoreFoundation 0x03b71843 __CFRunLoopRun + 2355
14 CoreFoundation 0x03b70ac3 CFRunLoopRunSpecific + 467
15 CoreFoundation 0x03b708db CFRunLoopRunInMode + 123
16 GraphicsServices 0x0477f9e2 GSEventRunModal + 192
17 GraphicsServices 0x0477f809 GSEventRun + 104
18 UIKit 0x027b6d3b UIApplicationMain + 1225
19 MyApp 0x00166361 main + 264
20 libdyld.dylib 0x0431e725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException

It looks like the crash wasn't related to UIImagePickerController directly, but was occurring in the appdelegate on applicationDidBecomeActive when calling a selector on self.navigationController.visibleViewController without checking to see if the visibileViewController responded to the selector.

Somewhere your code is looking for a method: requiresAuth in your class: PUUIAlbumListViewController. It's not there. Code the missing method or remove the call to it.

Related

TUploadFile: crash while uploading video file which is picked from the library

My application crashes when user try to upload a video to Quickblox server, after picking the video from the library. The same method works flawlessly if we try to upload an image or video captured from the camera. Thoughts?
Environment details
"QB-SDK" = "iOS 2.2.2";
"QuickBlox-REST-API-Version" = "0.1.1";
Did this work before?
Yes
Expected behavior
Video should upload successfully, or an error should be returned.
Actual behavior
Application crash.
Logs
json: {"blob":{"name":"video","content_type":"video\/quicktime"}}
Request URL:https://api.quickblox.com/blobs.json
Request method: POST
Request parameters:{
blob = {
"content_type" = "video/quicktime";
name = video;
};
}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType _enableCropOverlayIfNecessary]: unrecognized selector sent to instance 0x7fcd54526650'
*** First throw call stack:
(
0 CoreFoundation 0x0000000105745d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108f3bdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010574ed3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000105694cfa ___forwarding___ + 970
4 CoreFoundation 0x00000001056948a8 _CF_forwarding_prep_0 + 120
5 PhotoLibrary 0x000000011f852a50 -[PLVideoRemaker _exportCompletedWithSuccess:] + 135
6 AssetsLibraryServices 0x0000000115768709 __pl_dispatch_async_block_invoke + 25
7 libdispatch.dylib 0x000000010a837d9d _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x000000010a8583eb _dispatch_client_callout + 8
9 libdispatch.dylib 0x000000010a8401ef _dispatch_main_queue_callback_4CF + 1738
10 CoreFoundation 0x000000010569f0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
11 CoreFoundation 0x0000000105660b99 __CFRunLoopRun + 2073
12 CoreFoundation 0x00000001056600f8 CFRunLoopRunSpecific + 488
13 GraphicsServices 0x000000010afaead2 GSEventRunModal + 161
14 UIKit 0x000000010754bf09 UIApplicationMain + 171
15 MyApp 0x00000001043cc85f main + 111
16 libdyld.dylib 0x000000010a88d92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Steps to reproduce the behavior
Call the upload method for video that is picked from the library:
+ (QBRequest *)TUploadFile:(NSData*)data
fileName:(NSString*)fileName
contentType:(NSString*)contentType
isPublic:(BOOL)isPublic
successBlock:(void(^)(QBResponse *response, QBCBlob* blob))successBlock
statusBlock:(QBRequestStatusUpdateBlock)statusBlock
errorBlock:(void(^)(QBResponse *response))errorBlock;

Google Maps iOS SDK "mapView:didTapMarker:" crashes

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!

App Crashes (Sometimes) when Home Button is Pressed

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

Terminating with uncaught exception of type NSException on iOS 7.1

When I run my app on a iOS 8+ or later device, it runs perfectly with no errors but when I run it on a iOS 7.1 device the app crashes with this message:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SKLabelNode labelNodeWithText:]: unrecognized selector sent to class 0xedc5fc'
*** First throw call stack:
(
0 CoreFoundation 0x0098a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x004d58e5 objc_exception_throw + 44
2 CoreFoundation 0x00a270e3 +[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0097a50b ___forwarding___ + 1019
4 CoreFoundation 0x0097a0ee _CF_forwarding_prep_0 + 14
5 Origami Game 0x0002161f -[GBAGameScene initWithSize:] + 495
6 Origami Game 0x000281b4 -[GBAMenuScene touchesBegan:withEvent:] + 500
7 SpriteKit 0x00e102bf -[SKView touchesBegan:withEvent:] + 824
8 UIKit 0x00f64c0b -[UIWindow _sendTouchesForEvent:] + 386
9 UIKit 0x00f659d1 -[UIWindow sendEvent:] + 1117
10 UIKit 0x00f375f2 -[UIApplication sendEvent:] + 242
11 UIKit 0x00f21353 _UIApplicationHandleEventQueue + 11455
12 CoreFoundation 0x0091377f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x0091310b __CFRunLoopDoSources0 + 235
14 CoreFoundation 0x009301ae __CFRunLoopRun + 910
15 CoreFoundation 0x0092f9d3 CFRunLoopRunSpecific + 467
16 CoreFoundation 0x0092f7eb CFRunLoopRunInMode + 123
17 GraphicsServices 0x025245ee GSEventRunModal + 192
18 GraphicsServices 0x0252442b GSEventRun + 104
19 UIKit 0x00f23f9b UIApplicationMain + 1225
20 Origami Game 0x00026d5d main + 141
21 libdyld.dylib 0x02a756d9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I don't know what's happening, my app uses the Sprite Kit framework and I'm not using the storyboards, just code.
The init method initWithText: which is called by the class method [SKLabelNode labelNodeWithText:] was only added in iOS 8 so you cannot call this method in iOS 7. As a workaround use:
SKLabelNode *lbl=[SKLabelNode labelNodeWithFontNamed: "Arial"];
lbl.text="hello world";
To find which methods are available on which OS look at the docs.
(sorry if my obj-c isn't right or the method has a different name)

How to add UIRefreshControl

I want to add UIRefreshControl to my app which fetches the records from the database when the table is pulled down , I have done the following code but it is giving me error like
2014-08-06 12:31:56.263 QuizUsindDB[1183:60b] -[ScoreViewController readScoreFromDatabase]: unrecognized selector sent to instance 0x8d3d8e0
2014-08-06 12:31:56.266 QuizUsindDB[1183:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ScoreViewController readScoreFromDatabase]: unrecognized selector sent to instance 0x8d3d8e0'
*** First throw call stack:
(
0 CoreFoundation 0x018f81e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x016778e5 objc_exception_throw + 44
2 CoreFoundation 0x01995243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x018e850b ___forwarding___ + 1019
4 CoreFoundation 0x018e80ee _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x0168982b -[NSObject performSelector:withObject:] + 70
6 UIKit 0x003393b9 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x00339345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x0043abd1 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x0043afc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x0043ac06 -[UIControl sendActionsForControlEvents:] + 48
11 UIKit 0x00a227e9 -[UIRefreshControl _setRefreshControlState:notify:] + 404
12 UIKit 0x00a22650 -[UIRefreshControl setRefreshControlState:] + 48
21 CoreFoundation 0x0195d43e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
22 CoreFoundation 0x0189e5cb __CFRunLoopRun + 1963
23 CoreFoundation 0x0189d9d3 CFRunLoopRunSpecific + 467
24 CoreFoundation 0x0189d7eb CFRunLoopRunInMode + 123
25 GraphicsServices 0x038ec5ee GSEventRunModal + 192
26 GraphicsServices 0x038ec42b GSEventRun + 104
27 UIKit 0x00337f9b UIApplicationMain + 1225
28 QuizUsindDB 0x0001038d main + 141
29 libdyld.dylib 0x01e41701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Code for UIRefreshControl is given above:
-(void)pullToRefresh
{
self.refreshControl = [[UIRefreshControl alloc] init];
self.refreshControl.tintColor = [UIColor blackColor];
[self.refreshControl addTarget:self action:#selector(readScoreFromDatabase)
forControlEvents:UIControlEventValueChanged];
[self.myTable addSubview:self.refreshControl];
[self.refreshControl endRefreshing];
}
I have called [self pullToRefresh] in viewDidLoad .
I have the above code for initializing and calling a selector to refresh the table.
I am not able to recognise the error, can anyone point me out mistake.
Change this line:
[self.refreshControl endRefreshing];
To this:
[self.refreshControl beginRefreshing];
The endRefreshing method should be called after your table view has finished reloading data where necessary.
Also, the crash log indicates that your -[ScoreViewController readScoreFromDatabase]: function doesn't exist.

Resources