I have a subview, called DataViewController, and a parent viewcontroller, called RootViewController.
Everytime is try to call a function or set a property that is defined in my RootViewController, from my subview, I get these errors:
Error:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIPageViewController
setDetailsDataObject:]: unrecognized selector sent to instance
0x6aa2df0'
Code:
RootViewController.h:
#property (strong, nonatomic) id detailsDataObject;
DataViewController.m:
((RootViewController *)self.parentViewController).detailsDataObject = self.dataObject;
And...
Error:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIPageViewController
showDetails]: unrecognized selector sent to instance 0x6880db0'
Code:
RootViewController.h:
- (void)showDetails;
RootViewController.m:
- (void)showDetails
{
NSLog(#"Hello");
}
DataViewController.m:
[((RootViewController *)self.parentViewController) showDetails];
Does anyone know how to fix these exceptions?
do an Nsaasert statement to check if the self.parentViewController is actually RootViewController instance
NSAssert([self.parentViewController isKindOfClass:[RootViewController class]], #"Not RootViewController");
Try this..correct if there are any spelling mistakes.
Related
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.
Getting crash in CMDActivityViewController for iOS8.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ArtViewController activityViewController:dataTypeIdentifiersForActivityType:]: unrecognized selector sent to instance 0x7acb0b80'
Solution to this-
In dataTypesForActivityType method of "CMDActivityViewController.m", return nil , instead of the array dataTypes.
Use this Method as it is
- (NSArray *)dataTypesForActivityType:(NSString *)type {
return nil;
}
I am receiving an "EXEC_BAD_ACCESS" error when I attempt to
instantiate [anImage] in iOS8.
The same code works fine in iOS 7.1 and below.
Any suggestions are greatly appreciated.
//In .h file:
UIImage *img;
//in .m file:
img = [UIImage imageNamed:#"image.png"];
UIImageView *anImage = [[UIImageView alloc] initWithImage:img];
/*
* Here is the stack Trace:
*/
-[__NSCFDictionary _isDecompressing]: unrecognized selector sent to instance 0x16e49740
2014-10-07 08:56:35.319 [AppName] [222:7088] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFDictionary _isDecompressing]: unrecognized
selector sent to instance 0x16e49740'
*** First throw call stack:
(0x27e50e3f 0x35528c8b 0x27e56189 0x27e540a7 0x27d86208 0x2b2faf55 0x1011bb 0x103d27
0xfe759 0x1029d7 0x10060d 0x2b31fd4b 0x2b31fcf1 0x2b30a96b 0x2b32827f 0x2b2e45cd
0x27e175cd 0x27e14c8b 0x27e15093 0x27d63621 0x27d63433 0x2f0d20a9 0x2b34e359 0xe9b05
0x35aa8aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException
Hey when I push another view Controller i get this in my main.m
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
I am using this to push the view controller -
-(void)showMore:(UIButton *)sender
{
MoreViewController *moreViewController = [[MoreViewController alloc] init];
[self.navigationController pushViewController:moreViewController animated:YES];
}
I am sending the message here
[moreButton addTarget:self action:#selector(showSettings:) forControlEvents:UIControlEventTouchUpInside];
Here is my Error -
2013-09-25 18:16:03.186 Time Travel[1591:60b] Application windows are expected to have a root view controller at the end of application launch
2013-09-25 18:16:05.179 Time Travel[1591:60b] -[NSConcreteValue showSettings:]: unrecognized selector sent to instance 0x14e5ea70
2013-09-25 18:16:05.181 Time Travel[1591:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteValue showSettings:]: unrecognized selector sent to instance 0x14e5ea70'
* First throw call stack:
(0x2e1e5e8b 0x384e26c7 0x2e1e97b7 0x2e1e80b7 0x2e136e98 0x309a055f 0x309a04fb 0x309a04cb 0x3098c0f3 0x3099ff13 0x3099fbdd 0x3099ac09 0x3096ff59 0x3096e747 0x2e1b0f27 0x2e1b03ef 0x2e1aebdf 0x2e119541 0x2e119323 0x32e492eb 0x309d01e5 0x4cbd5 0x389dbab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
Does it crash on the first line or the second? Add a breakpoint to each and click the continue button to check which one.
If it's the former there might be some illegal code in your alloc/init for MoreViewController.
If it's the latter, maybe there some class/delegate methods (viewDidLoad, etc) are the culprit.
What is the error message during your crash? (Sometimes clicking the resume-play-button in the debugger in Xcode can reveal a bit more after a crash.)
I didnt find a method named showSettings: in the code you posted. You are pushing your viewController in method named showMore: So I think, the code should be like this:
[moreButton addTarget:self action:#selector(showMore:) forControlEvents:UIControlEventTouchUpInside];
Please check with this.
The error message saying showSettings: method is not found
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteValue **showSettings:**]: unrecognized selector sent to instance 0x14e5ea70'
And I've notified that you are using showMore: as the name of your method
-(void)showMore:(UIButton *)sender
maybe just change showMore to showSettings, or vice versa
I am getting this exception:
2012-10-11 14:27:05.039 SunriseAlarm[2297:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PickerViewController _setViewDelegate:]: unrecognized selector sent to instance 0x1e56fff0'
I have this code in the appDelegate.m file
PickerViewController *pvc = [[PickerViewController alloc] initWithNibName:#"PickerView" bundle:nil];
self.window.rootViewController = pvc;
I have already set the class of the nib to the custom class and it is not UIViewController. Please see image below.
Please let me know what do you think I am doing wrong.
Thank You,
Venkat Rao
You did set PickerViewController class for UIView, it's not correct, return back and set PickerViewController for File's owner