Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Im trying to extract a NSString from a NSArray that is populated with strings, but keep getting "incompatible types in initialization".

Code:
NSArray *buttonNamesSecondRow = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", nil];	
NSString *letter = buttonNamesSecondRow[2]; // Trying to get the "C"
}

I must be missing some kind of type-cast, but I cant find the syntax for doing this correctly. Any ideas?
 
have you ever tried the objC way?
Code:
NSString *letter = [buttonNamesSecondRow objectAtIndex:2];

see if that works. if it doesn't ... strange :D
 
Argh!!! Ill never get the hang of the obj-c syntax :/

Thanks for the input - works fine :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.