On Apr 24, 2010, at 1:33 PM, Quincey Morris wrote:
Also, you should preferably follow the memory management rules about naming
methods. Either autorelease gregorian before releasing it, or put Create
somewhere in your method name.
FYI Create is for functions, new is for methods. The
On Mon, Apr 26, 2010 at 9:24 AM, David Duncan david.dun...@apple.com wrote:
FYI Create is for functions, new is for methods. The analyzer won't
recognize one where the other is proper. There are also adornments you can
use to override the analyzer's understanding, but I can't recall them
Here's a sample snippet of my code:
- (NSDate *)offsetDate:(NSDate *)fromDate
byYears:(int)addYears
byMonths:(int)addMonths
byDays:(int)addDays {
NSDateComponents *offset = [[NSDateComponents alloc] init];
On Apr 24, 2010, at 2:02 PM, John Love wrote:
Here's a sample snippet of my code:
- (NSDate *)offsetDate:(NSDate *)fromDate
byYears:(int)addYears
byMonths:(int)addMonths
byDays:(int)addDays {
NSDateComponents
On Apr 24, 2010, at 13:02, John Love wrote:
Here's a sample snippet of my code:
- (NSDate *)offsetDate:(NSDate *)fromDate
byYears:(int)addYears
byMonths:(int)addMonths
byDays:(int)addDays {
NSDateComponents
I believe the problem is that you aren't releasing offset or gregorian before
you return them. I expect that gregorian retains offset (or copies it and
retains the copy without releasing the original).
In general, if you aren't don't intend to retain an allocated object,
autorelease it and