Pref Panes and Instance Variables?
Pref Panes and Instance Variables?
- Subject: Pref Panes and Instance Variables?
- From: "Josh M. Hurd" <email@hidden>
- Date: Sat, 12 Jan 2002 20:05:51 -0800
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