Skip navigation.
 
mlRe: NSTimer and seg faults
FROM : Andrew Farmer
DATE : Wed Mar 12 22:02:39 2008

On 12 Mar 08, at 13:56, Gregory Short wrote:
>     Howdy all, first-time poster here. I'm pretty new to Objective-C 
> and it's associated run-time environment, so I apologize if this is 
> a total newbie question that has been answered before (I couldn't 
> find anything, but I might not know where to look.)
>     My problem is this: I have an NSTimer which I set up in my NSView's 
> -awakeFromNib method. Also in -awakeFromNib, I set create an NSDate 
> object as part of the NSView. This all works fine. The problem is, 
> when my timer fires, if I try to do anything at all with the NSDate 
> object I created before, the program chokes. Here's the relevant 
> portion of the code (I've stripped out what appears to be 
> irrelevant; if anyone wants to see more, that's fine.)


Your NSDate object (lastUpdate) is getting autoreleased. Read the 
Cocoa memory management guidelines and commit them to memory.

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html

Related mailsAuthorDate
mlNSTimer and seg faults Gregory Short Mar 12, 21:56
mlRe: NSTimer and seg faults Andrew Farmer Mar 12, 22:02
mlRe: NSTimer and seg faults Hamish Allan Mar 12, 22:03
mlRe: NSTimer and seg faults Hank Heijink (Mail… Mar 12, 22:08
mlRe: NSTimer and seg faults Gregory Short Mar 12, 22:16