@property and @synthesize not working
@property and @synthesize not working
- Subject: @property and @synthesize not working
- From: Nathan Gilmore <email@hidden>
- Date: Wed, 13 Aug 2008 21:47:17 -0400
Hello everyone,
I am a newbie and I am having trouble getting my setter to work when I
use @synthesize. Here is the code:
**Header File**
@interface DayTaskController : NSArrayController {
NSCalendarDate *searchDate;
}
- (void)search:(id)sender;
@property(readwrite, assign) NSCalendarDate *searchDate;
@end
**Implementation File**
@implementation DayTaskController
@synthesize searchDate;
@synthesize appController;
.
.
.
**AppController**
I try and just set the searchdate field and then output it:
- (id) init
{
[super init];
[self setDayOneDate:[NSCalendarDate calendarDate]];
NSLog(@"self dayOneDate = %@",dayOneDate);
[dayOneTasks setSearchDate:dayOneDate];
NSLog(@"dayOneTasks search date = %@", [dayOneTasks searchDate]);
return self;
}
The above code gives this output:
2008-08-13 21:30:23.081 LifeTask2[20085:10b] self dayOneDate =
2008-08-13 21:30:23 -0400
2008-08-13 21:30:23.082 LifeTask2[20085:10b] dayOneTasks search date =
(null)
Any suggestions as to what I am doing wrong?
Thank you!
Nathan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden