views:

48

answers:

1

Heyho!
I've a little app running as LSUIElement with a NSStatusItem.
Sometimes the popupmenu's menuitems are updated by the code. But when the updated NSMenuItem (or its supermenu) is "highlighted" the app crashes without logging something.

Do you have any idea? Thank you very much for your answers.

+1  A: 

Can you reproduce the crash while running in gdb? Gdb works fine from the command line and I have often run GUI applications via gdb at the command line to catch the intermittent crash.

Once it crashes in gdb, use the bt command to grab the backtrace of the crash location.

Crashes of this nature -- intermittent -- are almost always caused by memory corruption, incorrect threading or over-releasing objects. Have a look at your code and make sure you followed the Cocoa memory management guidelines. If you are using threads, make sure you aren't diddling UI objects inappropriately from a non-main thread.

bbum
Mmh. It seems that I was "diddling UI objects inappropriately from a non-main thread". Thank you very much!This helped:(void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait
papr