Nicholas Riley’s Weblog
Thoughts from a computer science graduate student,
medical student and Cocoa programmer (this week).

Skip over navigation
October 2002
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Sep   Nov

made with
Click here to visit the Radio UserLand website.

Click on the coffee mug to add Nicholas Riley's Instant Outline to your Radio UserLand buddy list.

 

>
Monday, October 14, 2002
 
Pester 1.0 released. It's simple, easy to use, and mostly bug-free. May I never miss the bus again.

I can safely add NSTimer to the list of classes with bad documentation: the ownership model is essentially undocumented, and I spent several hours tracking down a crasher that turned out to be timer-related. Timers retain themselves while they're active, but something else (the runloop?) retains them as well. When you invalidate a timer or it expires, the retain count is 1, but if you try to release it, a bit later your program goes kaboom. The timer is autoreleased, so the best way to establish ownership is to retain it when you create and schedule it (retain count: 3), then perform an invalidate (has no effect if timer is already invalid) and release when you're done, relying on the later autorelease to perform a dealloc. 3:24:40 AM | reply []


Looking for older (or newer) material? Click another date on the calendar at the top of this page.