+ (void) initialize not getting called

2011-07-24 Thread Ken Tozier
Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global

Re: + (void) initialize not getting called

2011-07-24 Thread Gabriel Roth
On Sun, Jul 24, 2011 at 3:33 PM, Ken Tozier kentoz...@comcast.net wrote: I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I can't tell for sure from your email, but it seems like you might

Re: + (void) initialize not getting called

2011-07-24 Thread Andy Lee
. --Andy On Jul 24, 2011, at 3:33 PM, Ken Tozier wrote: Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am

Re: + (void) initialize not getting called

2011-07-24 Thread Gary L. Wade
...@comcast.net wrote: I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I can't tell for sure from your email, but it seems like you might be expecting initialize to be called whenever you create

Re: + (void) initialize not getting called

2011-07-24 Thread Andy Lee
, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global initialized flag and have to check that inside every method. Here's a stripped down version of the initialize

Re: + (void) initialize not getting called

2011-07-24 Thread Jens Alfke
On Jul 24, 2011, at 12:59 PM, Andy Lee wrote: Another thought -- is it possible you have a subclass of DBWord that implements +initialize and needs to call super? +initialize methods shouldn’t call super. The runtime sends the message separately to each class in the hierarchy. As to the

Re: + (void) initialize not getting called

2011-07-24 Thread Ken Tozier
Thanks all. I figured out what I was doing wrong. I was expecting a higher level class (DBString) to call a DBWord method, when it bypasses DBWord altogether if it has shared data of it's own. If I delete all shared data, initialize is called correctly. On Jul 24, 2011, at 5:02 PM, Jens Alfke