Forum Navigation
You need to log in to create posts and topics.

Crash when window is closed but OK when on normal Quit.

Posted by: fblistserve <fblistserve@...>

On Sep 30, 2012, at 7:09 PM, Brian S <fblistserve@cox.net> wrote:


My main app delegate contains:

-(void)doQuitHouseKeeping
{
    // save selected tabview pane in preferences
    NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
    [ud setInteger: [self getPaneLastUsed] forKey:kPaneLastUsedKey];// <<<<<<<<<<<< crashes here on window close
    [ud synchronize];
}

Apologies. I failed to post the called method which actually crashes. In case anyone is interested it is:

- (int) getPaneLastUsed
{
    NSTabViewItem *item = [theTabView selectedTabViewItem];  <<<<< this Cocoa method is the actual crash point.
    if ( item != nil )
    {
        return [[item identifier] intValue];
    }
    else
    {
        return 0;
    }
}

Brian S.


To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@freegroups.net