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 7621907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:18:53+00:00 2026-05-31T04:18:53+00:00

I am getting an error when changing the datasource of my TableView from an

  • 0

I am getting an error when changing the datasource of my TableView from an NSArray with objects(the example I found) to an NSMutableArray with the actual values I need to populate my table view with.

error:

lat is: 33,
long is: -74,
2012-03-06 12:27:58.380 x[606:fb03] -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x6b64280
2012-03-06 12:27:58.381 x[606:fb03] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x6b64280’

the original way I was setting self.measurement and self.subinfo is commented out.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:     NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MeasurementCell"];

switch (indexPath.section)
{
    case kMeasurement:
        cell.textLabel.text=[self.measurements objectAtIndex:indexPath.row];
        cell.detailTextLabel.text=[self.subinfo objectAtIndex:indexPath.row];
        break;
    default:
        cell.textLabel.text=@"Unkown";
}
return cell;
}

- (void)viewDidLoad
{
appdelegate = [[AppDelegate alloc]init];

//get lat
NSArray* fmArray = [appdelegate fetchEvents:@"Field_Measurement"];
NSMutableArray* latBindArray = [[NSMutableArray alloc]init];
NSMutableArray* longBindArray = [[NSMutableArray alloc]init];
for (Field_Measurement *fm in fmArray)
{
    [latBindArray addObject:fm.latitude];
    NSLog(@"lat is: %@", fm.latitude);
}

for (Field_Measurement *fm in fmArray)
{
    [longBindArray addObject:fm.longitude];
    NSLog(@"long is: %@", fm.longitude);
}

self.measurements = latBindArray;//[[NSArray alloc]initWithObjects:@"03/05/2012 @ 15:12", @"03/05/2012 @ 11:11", nil];
self.subinfo = latBindArray;//[[NSArray alloc]initWithObjects:@"Beta: 0.0234",@"Alpha: 3.977", nil];
[super viewDidLoad];
}

this is my first attempt at a table view(and new to objective-c all together) so any ideas of how to populate the table view from a NSMutableArray would be helpful. I have a sqlite database that I am pulling these records from if that helps.

thanks

  • 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-31T04:18:55+00:00Added an answer on May 31, 2026 at 4:18 am

    It appears you’re trying to set cell.textLabel.text to an NSNumber instead of an NSString. self.measurements is populated with NSNumber objects, so you’ll have to convert to string first.

    Try changing these lines

    cell.textLabel.text=[self.measurements objectAtIndex:indexPath.row];
    cell.detailTextLabel.text=[self.subinfo objectAtIndex:indexPath.row];
    

    to these:

    cell.textLabel.text=[NSString stringWithFormat:@"%@", [self.measurements objectAtIndex:indexPath.row]];
    cell.detailTextLabel.text=[NSString stringWithFormat:@"%@", [self.subinfo objectAtIndex:indexPath.row]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
Ok... changing the question here... I'm getting an error when I try this: SELECT
When changing the selected item in a ListBox, I'm getting a weird error where
Update getting error when i try to call the method from Activity: SQLiteDatabase db
I was changing the vc++ include directory with new paths suddenly getting below error
I am getting the following javascript error when changing the value in the dropdownlist.
After changing the Subscriber2 project in the PubSub sample, I am getting this error
i started getting this error on my app today, dont recall changing anything at
I'm getting this error from Mono's wsdl utility while trying to process eBay's WSDL
While deploying solution I am getting following error after changing the template name in

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.