Hi, I have a custom data container object of type RowOfPlayerData. When I try to display a RowOfPlayerData object in NSLog, the system doesn't know how to display it, so it just shows the address of the object.
I am trying to figure out how i can display, in an NSLog statement, what is at that address so i can use the data.
I am trying to build this on a tutorial about NSPredicate: http://doronkatz.com/how-to-do-amazingly-simple-searches-with-nsar
I have tried to do some sort of description of the output but not succeded.
I have tried to figure out how to do this so i can access the data. Here is the test code i have used and some output i currently have. BTW, i am new to this.
I would really appreciate if someone could help me display the data from the playerArray in the right format as i just don't get this.
[CODE]
@interface RowOfPlayerData : NSObject {
NSString *playerName;
NSString *curGameType;
}
@property(nonatomic, retain) NSString *playerName;
@property (nonatomic, retain) NSString *curGameType;
-(void)addPlayerData2Array;
@end
here is the .m file:
-(void)addPlayerData2Array {
NSLog(@">>addPlayerData2Array started<<");
NSMutableArray *playerArray = [[NSMutableArray alloc] init];
RowOfPlayerData *row;
row = [[RowOfPlayerData alloc] init];
row.playerName = @"Player1";
row.curGameType = @"NORMAL1";
NSLog(@"<#1> row.playerName: %@", row.playerName);
NSLog(@"<#2> row.curGameType: %@", row.curGameType);
[playerArray addObject:row];
NSString *xx;
xx = [playerArray objectAtIndex:0];
NSLog(@"<#3> playerArray: %@", xx);
Output:
addPlayerData2Array started<<
2010-09-25 13:39:51.313 x1[3675:207] <#1> row.playerName: Player1
2010-09-25 13:39:51.314 x1[3675:207] <#2> row.curGameType: NORMAL1
2010-09-25 13:39:51.314 x1[3675:207] <#3> playerArray:
[/CODE]