I have an array of items (NSMutableArray) which I am populating with strings (and for testing I added some int values).
In a method for testing, I loop through, and create 10 of these objects and place them in a NSMutable array as follows:
When I use this object in anther routine (I am binding it to a UITableView) the int values are there, but the string values are not. I suspect it's how I have them defined in my ScannedUserInfo class, but I am at my wits end, being new to Objective C. Here's how I have my ScannedUserInfo class defined.
Am I defining my properties wrong?
Thanks!
In a method for testing, I loop through, and create 10 of these objects and place them in a NSMutable array as follows:
Code:
listOfItems = [[NSMutableArray alloc] init];
for(int idx=0;idx <=9;idx++)
{
ScannedUserInfo *userInfo = [[ScannedUserInfo alloc] init];
userInfo.int1 = idx;
userInfo.int2 = idx;
userInfo.companyName = [NSString stringWithFormat:@"Company Number:%d", idx];
userInfo.fullUserName = [NSString stringWithFormat:@"Customer:%d", idx];
[userInfo retain];
[listOfItems addObject:userInfo];
}
[listOfItems retain];
When I use this object in anther routine (I am binding it to a UITableView) the int values are there, but the string values are not. I suspect it's how I have them defined in my ScannedUserInfo class, but I am at my wits end, being new to Objective C. Here's how I have my ScannedUserInfo class defined.
Code:
#import <Foundation/Foundation.h>
@interface ScannedUserInfo : NSObject
{
NSString* fullUserName;
NSString* companyName;
NSInteger int1;
NSInteger int2;
}
@property (readwrite) NSString* fullUserName;
@property (readwrite) NSString* companyName;
@property (readwrite) NSInteger int1;
@property (readwrite) NSInteger int2;
@end
Am I defining my properties wrong?
Thanks!