1

The following line sometimes throws SIGABRT:

[[NSUserDefaults standardUserDefaults] synchronize];

I have not idea why it happens. By the way, the app is multithreaded.

Erik Sapir
  • 23,209
  • 28
  • 81
  • 141

2 Answers2

1

NSUserDefaults is thread safe, that's not the problem. You are over releasing some object in your defaults and synchronize is crashing when it finds it.

Jano
  • 62,815
  • 21
  • 164
  • 192
  • No, this is probably not the reason. – Erik Sapir Jul 19 '11 at 12:09
  • Can you enable NSZombieEnabled and see what happens? Is there any particular reason why you are running synchronize manually? – Jano Jul 19 '11 at 12:16
  • See http://stackoverflow.com/questions/2685464/nszombieenabled-hides-exc-bad-access-error-entirely/2695707#2695707 and http://stackoverflow.com/questions/2190227/how-do-i-set-nszombieenabled-in-xcode-4/4917557#4917557 – Jano Jul 19 '11 at 12:43
0

This can also happen if you added a Key Value Observer on a preference and did not implement

-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context

Climbatize
  • 1,103
  • 19
  • 34