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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:35:11+00:00 2026-05-26T19:35:11+00:00

I’m having trouble with one particular error; I’m getting SIGABRT on this line: cell.textLabel.text

  • 0

I’m having trouble with one particular error; I’m getting “SIGABRT” on this line:

cell.textLabel.text = [collections objectAtIndex: [indexPath row]];

My header file:

#import <UIKit/UIKit.h>

@interface CollectionsViewController : UITableViewController {
    NSMutableArray *collections;
    NSMutableData *responseData;
}
@property (nonatomic, retain) NSMutableArray *collections;

@end

and implementation file:

#import "CollectionsViewController.h"
#import "JSON.h"


@implementation CollectionsViewController
@synthesize collections;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}



- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.collections = nil;
}

- (void)viewWillAppear:(BOOL)animated
{

    collections = [[NSMutableArray alloc] init];
    responseData = [[NSMutableData data]retain];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.unpossible.com/misc/lucky_numbers.json"]];
    [[NSURLConnection alloc] initWithRequest:request delegate:self];


    [super viewWillAppear:animated];

    //[self.tableView reloadData];
}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
    [responseData setLength:0];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    [responseData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    NSLog(@"Error connecting: \"%@\"", [error description]);
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    [connection release];

    NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    [responseData release];

    NSArray *luckyNumbers = [responseString JSONValue];


    for (int i = 0; i < [luckyNumbers count]; i++)
        [collections addObject:[luckyNumbers objectAtIndex:i]];

    for (int j = 0; j < [collections count]; j++)
        NSLog(@"This is \"%@\"", [collections objectAtIndex:j]);

    [self.tableView reloadData];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [collections release];
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [collections count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    // Configure the cell...
    NSLog(@"Counter \"%u\"", [collections count]);
    cell.textLabel.text = [collections objectAtIndex: [indexPath row]];
    return cell;
}



#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    /*
     <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     [detailViewController release];
     */
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)dealloc {
    [collections release];
    [super dealloc];
}

@end

Minus most of the commented-out stuff.

And finally my log:

2011-11-15 16:41:10.366 Clarke & Clarke[834:b303] This is "13"
2011-11-15 16:41:10.367 Clarke & Clarke[834:b303] This is "3"
2011-11-15 16:41:10.368 Clarke & Clarke[834:b303] This is "73"
2011-11-15 16:41:10.368 Clarke & Clarke[834:b303] This is "31"
2011-11-15 16:41:10.369 Clarke & Clarke[834:b303] Counter "4"
2011-11-15 16:41:10.370 Clarke & Clarke[834:b303] -[NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x4b699b0
2011-11-15 16:41:10.372 Clarke & Clarke[834:b303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x4b699b0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00dde5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00f32313 objc_exception_throw + 44
    2   CoreFoundation                      0x00de00bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00d4f966 ___forwarding___ + 966
    4   CoreFoundation                      0x00d4f522 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x00151afc -[UILabel setText:] + 72
    6   Clarke & Clarke                     0x0000316f -[CollectionsViewController tableView:cellForRowAtIndexPath:] + 399
    7   UIKit                               0x000a5b98 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
    8   UIKit                               0x0009b4cc -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
    9   UIKit                               0x000b08cc -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
    10  UIKit                               0x000a890c -[UITableView layoutSubviews] + 242
    11  QuartzCore                          0x016c8a5a -[CALayer layoutSublayers] + 181
    12  QuartzCore                          0x016caddc CALayerLayoutIfNeeded + 220
    13  QuartzCore                          0x016700b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
    14  QuartzCore                          0x01671294 _ZN2CA11Transaction6commitEv + 292
    15  QuartzCore                          0x0167146d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
    16  CoreFoundation                      0x00dbf89b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
    17  CoreFoundation                      0x00d546e7 __CFRunLoopDoObservers + 295
    18  CoreFoundation                      0x00d1d1d7 __CFRunLoopRun + 1575
    19  CoreFoundation                      0x00d1c840 CFRunLoopRunSpecific + 208
    20  CoreFoundation                      0x00d1c761 CFRunLoopRunInMode + 97
    21  GraphicsServices                    0x010161c4 GSEventRunModal + 217
    22  GraphicsServices                    0x01016289 GSEventRun + 115
    23  UIKit                               0x0003ec93 UIApplicationMain + 1160
    24  Clarke & Clarke                     0x00001b29 main + 121
    25  Clarke & Clarke                     0x00001aa5 start + 53
    26  ???                                 0x00000001 0x0 + 1
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language:  auto; currently objective-c

I’ve tried but can’t see the error. Could anyone educate me?

  • 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-26T19:35:11+00:00Added an answer on May 26, 2026 at 7:35 pm

    The error is 2011-11-15 16:41:10.370 Clarke & Clarke[834:b303] -[NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x4b699b0

    You try to set a text with an int

    Prefer:

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

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.