Table View in iOS Simulator - ios

I'm with a little problem during the simulation in iOS Simulator.
I'm studying table view, and, when i start the simulator, the XCode shows the message:
2012-08-08 14:08:41.606 TableView[731:f803] -[UIViewController
tableView:numberOfRowsInSection:]: unrecognized selector sent to
instance 0x68cc530 2012-08-08 14:08:41.641 TableView[731:f803] *
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIViewController
tableView:numberOfRowsInSection:]: unrecognized selector sent to
instance 0x68cc530'
First throw call stack:
(0x13c8022 0x1559cd6 0x13c9cbd 0x132eed0 0x132ecb2 0x1f006b 0x1f2862
0xa066d 0xa0167 0xa3134 0xa7623 0x50d42 0x13c9e42 0x1d80679 0x1d8a579
0x1d0f4f7 0x1d113f6 0x1d9e160 0x10e84 0x11767 0x20183 0x20c38 0x14634
0x12b2ef5 0x139c195 0x1300ff2 0x12ff8da 0x12fed84 0x12fec9b 0x10c65
0x12626 0x20a2 0x2015) terminate called throwing an exception(lldb)
I don't have any idea about how to fix it... Could someone help me?

You have to correctly implement the #required methods from UITableViewDatasource and UITableViewDelegate protocols.
It seems that you didn't implement tableView:numberOfRowsInSection:, which is one of these required methods.

-[UIViewController tableView:numberOfRowsInSection:]
In your error message, means that the table view's datasource is connected to an instance of UIViewController, which doesn't implement this method.
You have forgotten to change the custom class of your view controller to the appropriate class in the storyboard / xib file, so it is still a plain UIViewController. Change it to whatever your custom view controller class is using the identity inspector.

Related

unrecognised selector sent to instance when using IQDropDownTextField

I am using https://github.com/hackiftekhar/IQDropDownTextField library for drop down.
I have followed the steps given in documentation but getting exception
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextField setIsOptionalDropDown:]: unrecognised selector sent to instance
I also created bridging header for it.
I want to know what exactly this exception describes? Why and when this is occurring? How can I resolve this issue?
Note: I am using SWIFT programming language
Have you created your textfield outlet as IQDropDownTextField Outlet
if not
Try this
In your storyboard select your textfield and then select identity inspector and then in class write IQDropDownTextField and then create outlet.
Hope it helps.

Connecting ViewController causes SpriteKit to terminate app

I have a SpriteKit game, but now I'm working on making a menu. I decided to try to make these menus in a normal way, using Storyboards and UIViewControllers.
However, this is proving to be very difficult.
I added a new UIViewController, and set it as the initial viewcontroller. This causes no problems. However, as soon as I hook this up to a completely basic UIViewController file (FirstMenuViewController.m), with no edits or additions, ViewController.m seems to freeze up at if(!skView.scene){.
I'm getting this error:
-[UIView scene]: unrecognized selector sent to instance 0x170164980
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView scene]: unrecognized selector sent to instance 0x170164980'
*** First throw call stack:
(0x187f7f100 0x1944881fc 0x187f83db4 0x187f81ae0 0x187ea178c 0x1001012ec 0x18af42f90
....
libc++abi.dylib: terminating with uncaught exception of type NSException
What I don't get is why ViewController.m is even called, as there is no connection to that file from my FirstMenuViewController which is set as the initial viewcontroller.
Could someone please explain to me what is going on here?
Turns out I was subclassing the ViewController supplied by the SpriteKit-template instead of UIViewController when creating my FirstMenuViewController

App crashes when performing unwind

What I'm trying to perform
A programmatic unwind from Screen C back to Screen A (normally A->B->C)
What I've done
I've created the function - (IBAction)unwindToScreenA:(UIStoryboardSegue *)unwindSegue {
in Screen A's .m and its definition in .h file.
I've created an manual unwind in Screen C by CTRL-Dragging from Owner Icon to Escape Icon (unwind segue exists, but not tied to any button)
I've given the unwind a name, and then in the code I perform [self performSegueWithIdentifier:#"unwindFromCtoA" sender:self];
In other words, I think I've strictly done what's needed for this task. I did have it working before, but something else I changed must have broken it, and I can't trace the error.
The error I have
2014-02-06 13:28:28.899 PrototypeApp2[2885:60b] -[DMSScreenCViewController tag]: unrecognized selector sent to instance 0x14e7ff60
2014-02-06 13:28:28.902 PrototypeApp2[2885:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[DMSScreenCViewController tag]: unrecognized selector sent to instance 0x14e7ff60'
*** First throw call stack:
(0x2ddf7f4b 0x382386af 0x2ddfb8e7 0x2ddfa1cb 0x2dd494d8 0xc966d 0x30ae6d63 0xca34f 0x30782dcd 0x30782c15 0x306878bb
0x3073af7b 0x305eafb9 0x305631f3 0x2ddc31cd 0x2ddc0b71 0x2ddc0eb3 0x2dd2bc27 0x2dd2ba0b 0x32a52283 0x305cf049 0xc80a5 0x38740ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
UPDATE
Changing
[self performSegueWithIdentifier:#"unwindFromCtoA" sender:self];
to
[self performSegueWithIdentifier:#"unwindFromCtoA" sender:Nil];
fixed it. Any ideas why?
The issue happened when you try to call tag property on your DMSScreenCViewController object.
This is a UIViewController subclass and there is no tag property so you cannot call it.
Maybe you try to call tag on your destination or source view controller in your segue method which is reference to DMSScreenCViewController object.
DMSScreenCViewController Check that this is the expected class as I suspect it's not.
You may have to update a storyboard

When clicking a cell, my app throws a NSInternalInconsistencyException

I am kind of a novice to programming and I thought I could find help here.
I am trying to make an app where when you click on the table view cell, it shows more detailed information. When you click the cell, the debug area opens up and I am given the following message:
2013-07-15 12:41:19.261 Chevy[3909:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "ToB-mL-k5t-view-Ref-qb-iy9" nib but didn't get a UITableView.'
* First throw call stack:
(0x1c99012 0x10d6e7e 0x1c98deb 0x24a357 0xfbff8 0xfc232 0xfc4da 0x1138e5 0x1139cb 0x113c76 0x113d71 0x11489b 0x114e93 0x8ef23f7 0x114a88 0x470e63 0x462b99 0x462c14 0xca249 0xca4ed 0xad45b3 0x1c58376 0x1c57e06 0x1c3fa82 0x1c3ef44 0x1c3ee1b 0x1bf37e3 0x1bf3668 0x1affc 0x212d 0x2055)
libc++abi.dylib: terminate called throwing an exception
Does anyone know what I am doing wrong? I can post some of my code if you'd like.
The IBOutlet is either disconnected in the xib file for the tableView or connected to some unwanted element.

ZoomingPDFViewer example error

I'm trying to develop an app that can show a PDF file. I try to complete this with ZoomingPDFViewer
http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281-Intro-DontLinkElementID_2
code that is in the apple library. When I mix that code with my code some function doesn't work. And if I make it with the same code (don't mixed) the app throw this error:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setPDFPage:]: unrecognized selector sent to instance 0x6a833f0'
I'm in SDK 5.0 the requirements says that I should compile it in SDK 5.1 but the sample runs perfect, the problem is in my project but I don't know what is my error.
I'll appreciate if someone can help me with this strange error.
Check the Class setting in Storyboard.
View Controller -> Custom Class: ZoomingPDFViewerViewController and
Scroll VIew -> Custom Class: PDFScrollView
The second setting is the cause of your error.
You seem to be sending -setPDFPage: to an uncast self.view object. Try casting before calling like so:
[(PDFScrollView *)self.view setPDFPage:PDFPage];
Double check your connections in IB, if you are using it, or make sure you are initing a PDFScrollView* object in -loadView if not.

Resources