Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7684833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:07:03+00:00 2026-05-31T19:07:03+00:00

I asked this question in the restkit google group, but realize now that it

  • 0

I asked this question in the restkit google group, but realize now that it might actually be a more broad issue and not RK specific.

I’ve been going around in circles for a few hours on this one. I’m trying to populate a UITableView with data retrieved from a webservice and stored in objects using RestKits object mapping. Hitting the service, storing the objects all works beautifully.

The issue is when I try to reloadData for the Table. I’m getting this error –

'NSInvalidArgumentException', reason: '-[CoursesModel text]: unrecognized selector sent to instance and then app shuts down and 

takes me here: 
@autoreleasepool { 
return UIApplicationMain(argc, argv, nil, 
NSStringFromClass([RoundShoutAppDelegate class])); 
} 
Thread 1: signal SIGABRT 

CoursesModel is the model I setup. If I don’t specify the tableview’s delegate as the class (which I know I have to) then the courses load perfectly in the table view. But I’ll get an error when i try to click on one of the cells (at didSelectRowAtIndexPath. So focusing on
the fact that I have to specify a delegate, I know something is really messed up and I can;t figure it out.

I’m assuming something is getting released when it shouldn’t, but data is in the _courses array. This is an ARC project by the way.

Here is some of the pertinent code, but if you need more let me know. If anyone has any info a at all to point me in the right direction that would be awesome! Thanks for your help!

MainViewController.h 
@interface MainViewController : UITableViewController <CLLocationManagerDelegate, RKObjectLoaderDelegate, UITableViewDelegate, UITableViewDataSource> { 
IBOutlet UITableView *coursesTableView; 
NSArray *_courses; 
} 

@end 

CoursesModel.h

@interface CoursesModel : NSObject { 
NSNumber* _courseID; 
NSString* _courseName; 
NSString* _city; 
NSString* _state; 
NSNumber* _distance; 
} 

@property (nonatomic, retain) NSNumber* courseID; 
@property (nonatomic, retain) NSString* courseName; 
@property (nonatomic, retain) NSString* city; 
@property (nonatomic, retain) NSString* state; 
@property (nonatomic, retain) NSNumber* distance; 
@end 

MainViewController.m

//Most of the code ommited for your sanity 
// All good up to this point 
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects: 
(NSArray*)objects { 
 //NSLog(@"Loaded courses %@", objects); 
_courses = objects; 
// There is data in _courses. 
NSLog(@"Loaded courses in array %@", _courses); 
[coursesTableView reloadData]; 

Delegate Methods:

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { CGSize size = [[[_courses objectAtIndex:indexPath.row] text] sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(300, 9000)]; 
return size.height + 10; 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:07:04+00:00Added an answer on May 31, 2026 at 7:07 pm

    I see it now! Your delegate method

    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 
    
    CGSize size = [[[_courses objectAtIndex:indexPath.row] text] sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(300, 9000)]; 
    
    return size.height + 10; 
    
    }
    

    is wrong. NSArray has no method called -text, therefore it caused an unrecognized selector to be sent to NSArray. Why didn’t the compiler warn you about this? If you need a string, use -stringValue.

    And as for your delegate thing, this makes complete sense now, because not setting the delegate would not call this method on reload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question on the Google Group but I think I will get
I asked this question yesterday. But now I realize it was the wrong question.
I asked this question a while back but now I'm looking to implement an
I asked this question before but with less information than I have now. What
I asked this question before but didn't make it clear that I meant in
I asked this question in a more general design context before. Now, I'd like
I asked this question yesterday, but I wrote it far more complicated than I
I asked this question before. But now I am wondering why the following is
(I asked this question in another way , and got some interesting responses but
I asked this question earlier. I am intrigued by std::set but I have another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.