Skip navigation.
 
mlPref Panes and Instance Variables?
FROM : Josh M. Hurd
DATE : Sat Jan 12 20:05:59 2002

Hello list,

I am having trouble with instance variables in my PrefPane.

I declare my variables in the header of my Principal Class like this:

   @private
       NSMutableArray *theAppList;
       CFStringRef appID;

Then initialize them in initWithBundle like this:

   - (id)initWithBundle:(NSBundle *)bundle
   {
       if ( ( self = [super initWithBundle:bundle] ) != nil )
           {
              appID = CFSTR("myPrefPaneBundleIdentifier");
           theAppList = [NSMutableArray array];
           }
   
       return self;
   }

Which is how Apple explains it in their PrefPane docs.
So far everything is OK.

I then fill my instance variable theAppList in mainViewDidLoad.  This
too works fine but when I return out of this method all my variables are
killed.  I set up a button which triggers a dump of these variables via
NSLog which confirm they are NULL or empty.

I can't imagine that this is a limitation to the PrefPane framework so
would someone kindly let me know what I am doing wrong?

Thanks!

M


Related mailsAuthorDate
mlPref Panes and Instance Variables? Josh M. Hurd Jan 12, 20:05
mlRe: Pref Panes and Instance Variables? Josh M. Hurd Jan 13, 00:35
mlRe: Pref Panes and Instance Variables? Josh M. Hurd Jan 13, 09:34
mlRe: Pref Panes and Instance Variables? Andreas Monitzer Jan 13, 11:23
mlRe: Pref Panes and Instance Variables? Josh M. Hurd Jan 13, 12:24