Dear list,

I believe this problem is new on 10.8 (but I can't confirm this at the moment).

I have a table view bound to shared user defaults with a key which returns an 
array of strings. 
I have a button for creating a new entry. This calls a piece of code like this:


  NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  NSMutableArray *commands = [defaults mutableArrayValueForKey:TECiteCommands];
  [commands addObject:newCommand];
  [defaults setObject:commands forKey:TECiteCommands];
  [defaults synchronize];
  [commandsTable reloadData];


But now the app hangs on this code. If I sample the process I see 

    +                       2774 -[PrefsWindowController newCiteCommand:]  (in 
TeXnicle) + 128  [0x100080c58]  PrefsWindowController.m:474
    +                         2774 -[NSUserDefaults(NSUserDefaults) 
setObject:forKey:]  (in Foundation) + 90  [0x7fff844f4aed]
    +                           2774 _CFPreferencesSetValueWithContainer  (in 
CoreFoundation) + 238  [0x7fff8f5660de]
    +                             2774 +[CFPrefsSource 
withSourceForIdentifier:user:byHost:container:perform:]  (in CoreFoundation) + 
884  [0x7fff8f567794]
    +                               2774 -[CFPrefsPlistSource setValue:forKey:] 
 (in CoreFoundation) + 68  [0x7fff8f56a3c4]
    +                                 2774 CFEqual  (in CoreFoundation) + 338  
[0x7fff8f4007a2]
    +                                   2774 -[NSArray isEqual:]  (in 
CoreFoundation) + 70  [0x7fff8f456c56]
    +                                     2774 -[NSArray isEqualToArray:]  (in 
CoreFoundation) + 234  [0x7fff8f463a5a]
    +                                       2774 -[NSKeyValueSlowMutableArray 
count]  (in Foundation) + 43  [0x7fff845a928f]
    +                                         2774 
-[NSUserDefaults(NSKeyValueCoding) valueForKey:]  (in Foundation) + 179  
[0x7fff844f4ef1]
    +                                           2774 
-[NSUserDefaults(NSUserDefaults) objectForKey:]  (in Foundation) + 22  
[0x7fff844cddb0]
    +                                             2774 
CFPreferencesCopyAppValue  (in CoreFoundation) + 186  [0x7fff8f43e67a]
    +                                               2774 
+[CFPrefsSearchListSource withSearchListForIdentifier:perform:]  (in 
CoreFoundation) + 824  [0x7fff8f5687e8]
    +                                                 2774 
__CFPreferencesCopyAppValue_block_invoke_0  (in CoreFoundation) + 32  
[0x7fff8f565080]
    +                                                   2774 
-[CFPrefsSearchListSource copyValueForKey:]  (in CoreFoundation) + 114  
[0x7fff8f569202]
    +                                                     2774 
_dispatch_semaphore_wait_slow  (in libdispatch.dylib) + 241  [0x7fff884cf4c2]
    +                                                       2774 
semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x7fff8d0606c2]


Does anybody know why this is happening? I guess I'm abusing the use of 
NSUserDefaults somehow, but I don't know how. And it certainly used to work 
fine - it's a very old piece of code.

Many thanks for clues or insights,

Martin


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to