From: Brian M. <ma...@ex...> - 2008-05-02 23:33:37
|
On May 2, 2008, at 5:11 PM, Patrick Geiller wrote: > Don't forget to call super when overloading. Argh. Thanks. Glad I predicted it would be something stupid. Related question: suppose I create an object that receives NSNotifications. In the Ruby universe, I keep no pointers to it. Is it protected from Ruby GC? That is, given this definition: class Receiver < NSObject def init super_init Center.addObserver_selector_name_object(self, 'handle:', "notification name", nil) self end end ... and this use... Receiver.alloc.init ... can I send "notification name", secure that the Receiver will be there to get them? And will the Receiver be garbage collected when it calls Center.removeObserver on itself? ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick |