Problem Assigning NSString to UILabel
I have defined a UILabel field as follows:
UILabel *test1;
test1 = [[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 60.0)] autorelease];
FYI: this UILabel is being used as a subClass inside a UITableViewCell but I don't think this is relevant to the problem.
When trying to assign a value to this UILabel, I use the following code:
test1.text = record.productionDate;
//test1.text = @"2011-07-08";
The "record.productionDate" is defined in a custom NSObject (ProductionRecordObject.h) as:
@interface ProductionRecordObject : NSObject {
NSString* productionDate;
}
@property (retain, nonatomic) NSString *productionDate;
and implemented (ProductionRecordObject.m) as:
@synthesize productionDate;
I can clearly view the value in this "record.productionDate" field both in the debugger and the NSLog (it appears as an NSCFString).
But if I try to assigned it to the UILabel via "test1.text" no value shows up.
Yet if I hardcode the exact same value via "test1.text = @"2011-07-08" the value shoes up in the UILabel field just fine.
This seems so simple to me but I must have a brain leak cause I can't figure it out. Yes, I'm new to iOS programming but this seems to simple.
Thanks for any help you can provide...
|