Re: CalendarMonthImageGenerator
Re: CalendarMonthImageGenerator
- Subject: Re: CalendarMonthImageGenerator
- From: Ali Ozer <email@hidden>
- Date: Fri, 20 Oct 2006 11:46:36 -0700
I also am not sure how to manage NSColor memory for the calendar month
attributes. When I release them, my app crashes.
Because you didn't retain them in the first place:
backgroundColor = [NSColor colorWithCalibratedRed:red
green:green blue:blue alpha:alpha];
retains and releases almost always need to be paired (and sometimes
instead of "retain" you might get a reference count via a "copy,"
"alloc," or "new" method).
Similarly in your monthImage method, you return an allocated object,
while you should really return an object without a reference count ---
so autorelease your return value, or name the method something like
newMonthImage to make it clear to callers that they are getting a
retained object.
Ali
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden