I have a problem with my application for the iPhone.
It's a tab based application. In one of the tabs, I have a Table View. I have set it up to load in data from a PLIST.
My problem is that when I try to build and run it, the application either crashes, or stays at a black screen with the error message "Terminating app due to uncaught exception".
I looked in the console, and found that the error probably laid in this string:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return workouts.count;
}
(error message:)
2010-02-06 21:50:54.733 Mudo[52439:207] *** -[FirstViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x39101a0
2010-02-06 21:50:54.735 Mudo[52439:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[FirstViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x39101a0'
2010-02-06 21:50:54.736 Mudo[52439:207] Stack: (
29344859,
2569487625,
29726779,
29296246,
29148866,
4413562,
4420938,
4419935,
3136474,
3076985,
3118420,
3106975,
55857840,
55857263,
55855302,
55854394,
2780921,
2804616,
2787027,
2814133,
37441233,
29129600,
29125704,
2780777,
2818051
)
Building the app does not generate any errors.
Please help me? Thanks :)
If you look at the actual text of the exception, 'NSInvalidArgumentException', reason: '*** -[FirstViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x39101a0', you can see the root of the problem. Somewhere in your code you're calling tableView:numberOfRowsInSection: on a FirstViewController, which doesn't implement that method.
Exceptions are not caught at compile-time, but rather thrown at runtime. You may want to read up on them if you aren't familiar, as they're a fairly important part of many programming languages.
http://en.wikipedia.org/wiki/Exception_handling
I'm guessing, since FirstViewController is one of the standard example classes created when starting a new Tab Bar based application in Xcode that you haven't changed its super class or implemented the methods of UITabeViewDelegate and UITableViewDataSource.
Either that or you've implemented the methods from those protocols in another class, but set FirstViewController as the table view's delegate/datasource.
We need more information to know for sure.
Related
I have this function return [remoteObject objectForKey:key]; which should return an object that is in my dictionary.
When I am starting the Iphone simulator everything is fine and it returns the right object.
But when I am starting the same application an my device my application crashes and it says SIGABRT
and
2011-12-05 10:25:17.601 iPhoneXMPP[242:1a1f] -[CALayer objectForKey:]:
unrecognized selector sent to instance 0x4f3d40 2011-12-05
10:25:17.602 iPhoneXMPP[242:1a1f] * Terminating app due to uncaught
exception 'NSInvalidArgumentException', reason: '-[CALayer
objectForKey:]: unrecognized selector sent to instance 0x4f3d40'
My key is an Id (17) and it is also in my dictionary.
Does anybody of you knows why this happens only on my device?
It means that your remoteObjectobject is being deallocated somewhere. Usually autoreleases happen faster on the device because it has less memory than the simulator that's why on the simulator your object is still there when you are trying to call it's method. Make sure you call retainon your object when you created it and release when you are done with it.
i am using TabBarController , it is working fine in my ipod.
but my application is crashing it 3.0 . any help please?
self.window.rootViewController = self.tabBarController; //crashing here
and log shows
-[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -
[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80'
This may show you the right direction. Let me know if the problem still continues.
Due to executing on different versions of iOS, that method may have deprecated.
The crash is because you're calling a method that doesn't exist, not because your variables are not initialized.
-setRootViewController doesn't exist prior to iOS 4.0. Use
[self.window addSubview:self.tabBarController.view];
instead.
Or, update your target platfor to 4.0.2 or later. It's probably less than 5% of users that aren't using iOS 4 at this point.
my problem is, that if i scroll my table view very fast, the screen freazes. i get the following:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewControllerWrapperView isEqualToString:]: unrecognized
perhaps someone can help me!
Thx
You're over-releasing (or under-retaining) an object.
Im trying to work with UISearchDisplay controller
the application is launching correctly. When i start typing in the UISearchbarController its showing the following exception and exiting the application.
The exception is as follows:
[BrowserViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5b4ccc0
2010-08-13 11:59:58.469 MixedApplication[7297:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BrowserViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5b4ccc0'
Can you post your code for the tableView:numberOfRowsInSection?
EDIT: UISearchBar will not work for a UIWebView
I have a Tab Bar application with four new headers, implementation and interface files, and added those as the sources in IB. They were in this format: FirstView.h/m/xib, SecondView.h/m/xib.
I then had files for First-, Second-, Third- and FourthView.
There was also a file there called FirstViewController. I did not touch this, I just deleted it because I wasn't going to need it.
I then laid out my interface for the first view (FirstView.h/m/xib) in IB. It had an image on the top, label under and a UITableView under that.
I sat up the correct connections (delegations and datasource for the tableview) in my FirstView.h/m file, and pressed Build. It seemed to build without errors, so I pressed Build and Go.
The Simulator popped up, installed the app and crashed. (Error message:Terminating app due to uncaught exception).
Complete error message:
2010-02-06 21:50:54.733 Mudo[52439:207] *** -[FirstViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x39101a0
2010-02-06 21:50:54.735 Mudo[52439:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[FirstViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x39101a0'
2010-02-06 21:50:54.736 Mudo[52439:207] Stack: (**LotsOfNumbers**)
I asked about this in another question, got an answer, and that fixed it:
It was obviously looking for code in the FirstViewController.h/m-file, although I did not do anything to make it look for code there.
I fixed this by adding two interfaces and implementations in my FirstView.h/m file. (FirstView and FirstViewController)
When I ran the app then, the table view and tab bar came up on the screen, but my image and label did NOT.
I don't have any idea of why it was looking for the code in FirstViewController instead of FirstView... I have the correct connections in IB, too..
A tableview is trying to query its data source for the number of rows it should display. If you've connected the tableview's datasource outlet to an instance of your FirstViewController class, then you need to implement -tableView:numberOfRowsInSection: in that class.