Take the 2-minute tour ×

I have a core database, that has a bunch of Stops, Routes, and Buses in it.

I have used a fetch to grab the data and sort it, which comes back with two options, which is correct. I then try and make a tableView, that will display the name of those two Routes. Which crashes once the TableView is loaded. Which I can not find out why.

When debugging, I have the exception thrown at the line

PASTBIN for crashlog http://pastebin.com/g35R9w4K



#import "MultiStopCell.h"

@implementation MultiStopCell

@synthesize routeName = _routeName;
@synthesize minutesLeft = _minutesLeft;
@synthesize routeNumber = _routeNumber;


MultiStopCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    static NSString *CellIdentifier = @"Multi Stop Cell";
    MultiStopCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[MultiStopCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

    // Configure the cell...
    NSMutableDictionary *dictionary = (self.allStops)[indexPath.row];
    NSArray *key = [dictionary allKeys];
    NSMutableArray *routeArray = [dictionary valueForKey:key[0]];

    [routeArray sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"route.number" ascending:YES]]];

    Route *route = routeArray[0];
    cell.routeName.text = [NSString stringWithFormat:@"%@", route.name];
share|improve this question

closed as too localized by Bill the Lizard Feb 5 '13 at 14:12


What is the thrown exception? Is it an invalid pointer? –  John Dec 8 '12 at 4:44

1 Answer 1

When that happened to me it was a problem with the object returned by the tableview on the deque method, try using the following.

MultiStopCell *cell = (MultiStopCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
share|improve this answer
That wont cause any crash. –  iDev Dec 8 '12 at 4:55
Tested this, and it still froze up. –  Anthony Taylor Dec 8 '12 at 5:01
@AnthonyTaylor, yes, that is not the issue. You need to post the crash log from your console. Your code looks fine. –  iDev Dec 8 '12 at 5:05
@ACB i added the crashlog pastebin –  Anthony Taylor Dec 8 '12 at 5:35
[NSObject(NSObject) doesNotRecognizeSelector:] represents a method call to an object which didn't implement that particular method. Can you check if you are calling some method on an object which didnt have that method. Or else you might have to post MultiStopCell class code as well. Cant figure out anything from this message alone. –  iDev Dec 8 '12 at 5:40
