• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
@property and @synthesize not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@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


  • Follow-Ups:
    • Re: @property and @synthesize not working
      • From: Chris Hanson <email@hidden>
    • Re: @property and @synthesize not working
      • From: Andrew Merenbach <email@hidden>
  • Prev by Date: compile error when protocol not implemented?
  • Next by Date: Re: @property and @synthesize not working
  • Previous by thread: Re: compile error when protocol not implemented?
  • Next by thread: Re: @property and @synthesize not working
  • Index(es):
    • Date
    • Thread