views:

55

answers:

1

I feel very stupid for asking this, but I've been trying to figure this for about three hours and have gotten nowhere. See the code below. After the first iteration, my program crashes and all I get is SIGABRT. As you may get from the code, I'm just trying to build a string from other strings. It works fine on the first iteration, but on the second one, it just aborts.

Film* film = (Film *)managedObject;

    for (NSManagedObject* crewMember in [film CastAndCrew])
    {   
        castAndCrewMember = (CastOrCrewMember*)crewMember;
        if ([[[castAndCrewMember talentType] typeName] isEqualToString:@"Director"])
        {
            fullName = [[NSMutableString alloc] initWithString:[[castAndCrewMember talent] firstName]];
            [fullName appendString:[@" " stringByAppendingString:[[castAndCrewMember talent] lastName]]];
            subtitle = [[NSMutableString alloc] initWithString:[[[[fullName description] stringByAppendingString:@" "] stringByAppendingString:[film runningTime]] stringByAppendingString:@" | "]];
            [subtitle appendString:[[film category] categoryName]];
            [subtitle retain];
            [fullName release];
            fullName = nil;
            break;
        }
    }

    TTTableItem* tableItem = [TTTableSubtitleItem itemWithText:[film title]
                                                      subtitle:subtitle
                                                      imageURL:[film imageURL] 
                                                  defaultImage:[UIImage imageNamed:@"aff2010_l.png"]
                                                           URL:nil 
                                                  accessoryURL:nil];

Thanks in advance.

+1  A: 

Sorry, guys, I think I found my error. The record that's being returned for the castAndCrew object actually doesn't exist. My bad. Sorry :)

adolfox