views:

63

answers:

2

Hi all,

i shortly started Programming Mac OS X Applications with Cocoa, so its a realy New bee question. Sorry about this.

At first my code snippet:

- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    Purchaser *actPurchaser = [tableViewDataArray objectAtIndex:row];
    NSString *colID = [tableColumn identifier];
    NSString *cell = [actPurchaser performSelector:NSSelectorFromString( colID)];

    return cell;
}

You see i want to display all Members off Purchaser in a NSTableView, but the Program start for a long time and then fails. A look in debugger says that the Problem is the NSString, debugger says "Variable is not CFString". I've no idea whats this should/could mean, so i googled around, found some forum threads, but no one helps me.

Any Ideas? If i let out some Informations, sorry. Ask me about them!

Greetings, Dennis

A: 

Have you checked that the -identifier method actually returns an NSString instance? Try NSLog(@"colID = %@", colID); I suspect you may not have set the identifier for some column, or that you have set an identifier which isn't a string.

Johan Kool
A: 

Youre totaly right! My failure is that in Purchaser-Class thereis a Variable of enum-Type. Because of this the Program don't start...

Thank your for this adivce ;-) Dennis

Dennis S.
You're welcome. Btw, on stackoverflow, don't use an answer to respond, but comment. Also, click the checkmark next to my answer to mark this question as answered, if you feel your problem is solved now.
Johan Kool