I'm experiencing a weird crash using FBLoginView.
Scenario for crash: My view with a FBLoginView instance loads and I don't login, I go back to my previous view and load my view with the FBLoginView instance again, this causes the app to crash and I can't see what I'm doing wrong.
It's working fine if I login and repeat the same thing.
Crash log:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
I found this: Very weird NSInvalidArgumentException with addSubview FBLoginView - which kind of describes the same problem, but I don't use FBLoginView in multiple views.
Code:
- (void)viewDidLoad
{
[super viewDidLoad];
if (!self.loginView) {
self.loginView = [FBLoginView new];
self.loginView.readPermissions = #[#"public_profile", #"email", #"user_friends"];
self.loginView.delegate = self;
[self.view addSubview:self.loginView];
}
}
Any suggestions?
Related
I have an UIImageView subclassed as CLImageView that has been implemented with lazy load.
Just ago I have encountered this error message :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Exercised class for selector implementation needs to be pushed'
*** First throw call stack:
at line : if(self=[super initWithCoder:aDecoder]) {
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
if(self=[super initWithCoder:aDecoder]){
self.placeholderImage = nil;
self.delegate = nil;
self.cacheEnabled = NO;
self.prettyLoad = NO;
}return self;
}
I have never seen this error until 5 years of iOS programming, and I could not find any information on this kind of message here.
If anybody can drop me some ideas would be grateful.
If you need more information just leave a comment or reply.
Thank you so much.
Hi I am using Apple CATALOG Source code for displaying search bar controller on navigation controller.
It does load, but when i click on search, it get crash due to UISearchResultsUpdating-
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AAPLSearchBarEmbeddedInNavigationBarViewController updateSearchResultsForSearchController:]: unrecognized selector sent to instance 0x15db8ab0'
Suggest me the reason for crash.
code for crash -
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController {
if (!searchController.active) {
return;
}
self.filterString = searchController.searchBar.text;
}
Your error is self-explanative. You're crash is not on this method, but in place where you call it. You're sending message to a wrong object.
I get this error:
-[MPInlineVideoFullscreenViewController player]: unrecognized selector sent to instance 0x15e63fe90
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MPInlineVideoFullscreenViewController player]: unrecognized selector sent to instance 0x15e63fe90'
Using iOS 8, the language is Objective-C. But I have this same code in the if statement like this in applicationDidBecomeActive and it does not crash:
UIViewController *vc = ((UINavigationController*)self.window.rootViewController).visibleViewController;
if([vc isKindOfClass:[VideoViewController class]]) {
VideoViewController *vca = vc;
if(vca.player.playbackState == MPMoviePlaybackStatePaused){
[vca.player play];
}
But if I use it on the different MPMoviePlayer, and it is fullscreen. I switch to a different app, and back, it crashes. Buy why not with the other movie controller. Also, the other one does not show any playback controls, while this one which crashes does.
I have a view controller opening an 'Open-In' dialogue via a bar button item.
Calling code:
UIDocumentInteractionController *docInteraction = [[UIDocumentInteractionController alloc] init];
docInteraction.URL = location;
docInteraction.delegate = self;
if ([docInteraction presentOpenInMenuFromBarButtonItem:self.openInButton animated:YES])
self.openInController = docInteraction;
Dismissal code:
UIDocumentInteractionController *openIn = self.openInController;
if (openIn) {
[openIn dismissMenuAnimated:animated];
self.openInController = nil;
popupsDismissed = YES;
}
Sometime after the code is dismissed, the app crashes with this exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[A2DynamicUIPopoverControllerDelegate popoverController:animationCompleted:]: unrecognized selector sent to instance 0x1f82b4f0'
This is a BlocksKit defined interface, but I'm not using a BlocksKit class in thie particular case. 0x1f82b4f0 is a <A2DynamicDelegate: 0x1f82b4f0; protocol = UIPopoverControllerDelegate> but why BlocksKit is involved here at all is a mystery. Can someone give me some insight on how to fix the exception?
BlocksKit is a bit of a red herring. The dismissal code is deallocating the UIDocumentInteractionController too early here:
self.openInController = nil;
At the earliest, the deallocation should happen after the -documentInteractionControllerDidDismissOpenInMenu: delegate callback method.
I'm using a Kal Calendar in my app. However my app crashes when the Kal ViewWillAppear is called. Here is my code.
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
KalViewController *calendar = [[KalViewController alloc] init];
[self.navigationController pushViewController:calendar animated:YES];
calendar.dataSource = self;
[calendar reloadData];
self.tabBarController.delegate = self;
}
I used breakpoints and my app is crashing at:
[calendar reloadData];
Here is the error message from the debugger
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
* First throw call stack:
(0x2088012 0x156ae7e 0x203bb6a 0x203ba20 0x10c1b 0x1ca08 0x11088 0x282103 0x28242b 0x297fad 0x29889b 0x2989b9 0x298a45 0x39e20b 0x1ef2dd 0x157e6b0 0x72d4fc0 0x72c933c 0x72d4eaf 0x28e2bd 0x1d6b56 0x1d566f 0x1d5589 0x1d47e4 0x1d461e 0x1d53d9 0x1d82d2 0x28299c 0x1cf574 0x1cf76f 0x1cf905 0x1d8917 0x2580 0x19c157 0x19c747 0x19d94b 0x1aecb5 0x1afbeb 0x1a1698 0x22c1df9 0x22c1ad0 0x1ffdbf5 0x1ffd962 0x202ebb6 0x202df44 0x202de1b 0x19d17a 0x19effc 0x227d 0x21a5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
By the way the my app only crashes when I have some data to insert in the calendar.
I found the answer! I was getting a date from Core Data but the formatter was wrong and the date was coming out as nil.