Note that there are some explanatory texts on larger screens.

plurals
  1. POWhich class must I extend?
    primarykey
    data
    text
    <p>(I am developing an app that presents chat messages in a table. But, this chat can't be started by the user, when the user receives a message the chat view opens. So, I made this code:</p> <pre><code>- (void) newMessageReceived:(NSMutableDictionary *)message { General *general = [General sharedManager]; NSString *firstmessage=[message objectForKey:@"msg"]; NSString *from=[message objectForKey:@"sender"]; NSArray *listItems = [from componentsSeparatedByString:@"@"]; NSString *fromsplit=[listItems objectAtIndex:0]; general.firstmess=firstmessage; general.firstfrom=fromsplit; NSLog(@"Mensaje recibido: %@ de %@", [message objectForKey:@"msg"], fromsplit); ChatViewController *cvc=[[ChatViewController alloc]initWithNibName:@"Chat" bundle:nil]; [[self navigationController]pushViewController:cvc animated:YES]; } </code></pre> <p>Everything is ok, until here. The ChatViewController extends UITableViewController. But, when a message is received i get the following exception:</p> <pre><code>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "Chat" nib but didn't get a UITableView. </code></pre> <p>Then, i try to change the class extended to UIViewController (did this to check that the program enters the numberOfRowsInSection method) and then i receive:</p> <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ChatViewController setTableViewStyle:]: unrecognized selector sent to instance 0x9863200' </code></pre> <p>I think that solving the first exception would fix my problem. Any help?</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload