• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclass of NSMutableDictionary hanging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclass of NSMutableDictionary hanging


  • Subject: Subclass of NSMutableDictionary hanging
  • From: Nick Forge <email@hidden>
  • Date: Sat, 3 Mar 2007 17:31:29 +1100

I am developing a preferencePane that makes use of a subclass of NSMutableDictionary. My subclass (SPPowerSourceSettings) has only three methods, which is one custom init method and a pair of "get and set" methods. Here is the code for my custom init method:

- (SPPowerSourceSettings *) initWithSettings:(NSDictionary *)settings
				   sourceName:(NSString *)sourceName
{
	self = [super init];
	if (self != nil) {
		NSDictionary *sourceSettings;
		sourceSettings = [[settings objectForKey:@"Custom Profile"]
									objectForKey:sourceName];
		[self setDictionary:sourceSettings];
	}
	return self;
}

Basically what is happening is - when an instance of this class is created, System Preferences.app (the host app) hangs. If I comment out the "[self setDictionary:sourceSettings];" line, then it doesn't hang. I have narrowed it down through extensive testing to the fact that if I try and add an object (or an entire dictionary) to the SPPowerSourceSettings instance then preferencePane hangs instantly. I am able to press "Show All" in System Preferences.app, so it doesn't really crash as such, it just hangs there.

My instances of SPPowerSourceSettings are called acSettings, batterySettings and upsSettings. Is there some naming convention when it comes to preferencePanes that could be causing a naming conflict? Is there any other conventions that I should've followed? I have already named all of my own classes as SPxxxx to avoid class name conflicts....

Thanks in advance,
Nick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Subclass of NSMutableDictionary hanging
      • From: Chris Hanson <email@hidden>
    • Re: Subclass of NSMutableDictionary hanging
      • From: Keary Suska <email@hidden>
    • Re: Subclass of NSMutableDictionary hanging
      • From: Ali Ozer <email@hidden>
  • Prev by Date: C callback function
  • Next by Date: Re: C callback function
  • Previous by thread: Re: C callback function
  • Next by thread: Re: Subclass of NSMutableDictionary hanging
  • Index(es):
    • Date
    • Thread