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.
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.
I've a really strange error, and I cannot find the problem.
In my iPad APP I've a UINavigationController, a UITableViewController as master and a UIViewController containing a UIWebView as detail.
I launch the APP, the UITableViewController is shown. By segue I open the detail as usual. Then I have a back button in my detailviewcontroller that calls this method
[self.contentWebView setDelegate:nil];
[self.contentWebView stopLoading];
[self.navigationController popViewControllerAnimated:YES];
It gets poped and the master is shown again. Its
- (void)viewWillAppear:(BOOL)animated
gets called, but then I get the following error:
2014-06-06 15:56:58.156 Knowledge[356:60b] -[_UIWebViewScrollViewDelegateForwarder scrollViewWasRemoved:]: unrecognized selector sent to instance 0x170429f60
2014-06-06 15:56:58.159 Knowledge[356:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIWebViewScrollViewDelegateForwarder scrollViewWasRemoved:]: unrecognized selector sent to instance 0x170429f60'
*** First throw call stack:
(0x189582f50 [...] 0x196553aa0)
libc++abi.dylib: terminating with uncaught exception of type NSException
BUT, this happens only on the iPad Air... older iPads work as expected
UPDATE:
I added now the command [self.contentWebView removeFromSuperview]; after "stopLoading" and now the error is happing right up there.
Please ignore this answer if you are not touching scroll view's (of the web view) delegate reference.
I was facing the same strange error. After some investigation, I found that it was happening because scroll view's (of the web view) delegate was altered in controller's viewDidLoad method:
[self webView].scrollView.delegate = self;
In some cases, scroll view invokes delegate method(s) even after your view controller is destroyed. This should be prevented by weak delegate reference, but for some reason scroll view calls delegate method on deallocated (zombie) object anyway. I assume this is a bug in the framework.
So here what you can do: set delegate reference to nil in your controller's dealloc method:
- (void)dealloc
{
[self webView].scrollView.delegate = nil;
}
After deallocation, scroll view will be prevented from calling any method on no longer existing controller.
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'm trying to create this application, when you press on a tablecell you get shown the ViewController, and the variable get's set in the other view controller. Although i'm getting a few errors when i press the uitablecell.
Error:
2013-04-06 22:47:25.970 iFSX Guide[1069:907] Called
2013-04-06 22:47:26.009 iFSX Guide[1069:907] -[__NSCFString _isAncestorOfFirstResponder]: unrecognized selector sent to instance 0x1d562390
2013-04-06 22:47:26.016 iFSX Guide[1069:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString _isAncestorOfFirstResponder]: unrecognized selector sent to instance 0x1d562390'
*** First throw call stack:
(0x319b22a3 0x3964c97f 0x319b5e07 0x319b4531 0x3190bf68 0x33832beb 0x338a837f 0x338548fb 0x33a95619 0x338a79b9 0x338a5fe7 0x339c83ef 0xa22a5 0x3387c28d 0x338fef81 0x322c0277 0x319875df 0x31987291 0x31985f01 0x318f8ebd 0x318f8d49 0x354ba2eb 0x3380e301 0xa19d1 0x39a83b20)
libc++abi.dylib: terminate called throwing an exception
The code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)in dexPath{
NSLog(#"Called");
Aircraft = indexPath.row;
[self performSegueWithIdentifier:#"ToSections" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:#"ToSections"]){
AirplaneSections *sections = (AirplaneSections *)segue.destinationViewController;
sections.plane = Aircraft;
}
}
I've found out that it's an error on ViewDidLoad on the viewcontroller.
NSString *quickTemp = [NSString alloc];
switch (plane) {
case 0:
quickTemp = #"Boeing 737-800";
break;
default:
break;
}
TitleLabel.text = quickTemp;
*/
I'm doing something wrong there.
Are you using ARC? This sort of problem usually indicates there's a memory error somewhere. Basically, some code somewhere is trying to access an object that was already released. This makes everything go kaboom.
If you aren't using ARC, you should turn it on.
After that, the next thing you should do is run the static analyzer. Fix anything that comes up.
If that doesn't fix the problem, in Xcode, add a breakpoint that stops when an Objective-C exception is thrown. It should show you where exactly this problem is happening.
If that doesn't help, run your code under Instruments' and the Zombie tool. This will show you exactly where you tried to access memory that was already released.
I'm using Action Sheet Picket. I added .h and .m files as instructed in readme, picker and even cancelAction is working well but somehow successAction throws NSInvalidArgumentException with this message: "unrecognized selector sent to instance".
Application is a kind of tab bar application with Navigation Controller. There is a TabBarController as root and there are ViewControllers which are located under the TabBarController and one of the ViewControllers is a Navigation Controller. But I'm not getting this error in Navigation Controller. I'm not sure if this causes any error.
Here how I used:
- (IBAction)filterResult:(id)sender {
[ActionSheetStringPicker showPickerWithTitle:#"Pick Filter" rows:self.filterList initialSelection: self.selectedIndexes target:self successAction:#selector(animalWasSelected:element:) cancelAction:nil origin: self];
}
- (void)animalWasSelected:(NSNumber *)selectedIndex element:(id)element {
self.selectedIndexes = [selectedIndex intValue];
NSLog(#"Selected");
}
Yes that's all. I've already included ActionSheetPicker.h file and as I said picker is working fine.
Finally here is error:
[MYYViewController successAction:]: unrecognized selector sent to instance 0x9032400
2012-12-24 12:14:45.488 Example[54268:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MYYViewController successAction:]: unrecognized selector sent to instance 0x9032400'
Any help would be great.
Looks rather straight forward, you need to implement successAction: in your MYYViewController class, because the picker is not checking if it will respond or not and calling it directly.