bugGNUstep - Bugs: bug #24950, Calling [NSApplication init]...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #24950: Calling [NSApplication init] mulitple times causes an NSException on GNUstep

Submitted by:  Gregory John Casamento <gcasa>
Submitted on:  Wed 26 Nov 2008 09:07:33 PM UTC  
 
Category: Gui/AppKitSeverity: 2 - Minor
Item Group: Change RequestStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 13 Jan 2009 06:29:17 AM UTC, comment #2:

I agree. I'm closing this. Thanks.

Gregory John Casamento <gcasa>
Project Administrator
Fri 09 Jan 2009 09:32:45 AM UTC, comment #1:

I just looked at our source, and read the comments about application startup ... and they sounded pretty convincing. It really looks like our behavior is better than MacOS-X here and any applications which wrongly call init more than once could trivially be modified to call +sharedApplication instead.

Richard Frith-Macdonald <CaS>
Project Member
Wed 26 Nov 2008 09:07:33 PM UTC, original submission:

On Mac OS X the following code does not cause an exception:

//
// GSTableView.m
// TestDesignatedInit
//
// Created by Gregory Casamento on 11/23/08.
// Copyright 2008 _MyCompanyName_. All rights reserved.
//

#import "GSTableView.h"

@implementation GSTableView
- (id) initWithFrame: (NSRect)frame
{
NSLog(@"initWithFrame was called.");
return [super initWithFrame: frame];
}

- (void) awakeFromNib
{
id app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
}
@end

It appears to return the same singleton instance over and over. While I know we shouldn't call init multiple times, we should consider making it behave consistently with Cocoa.

GC

Gregory John Casamento <gcasa>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by gcasa (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 13 Jan 2009 06:29:17 AM UTCgcasaStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Sun 07 Dec 2008 06:57:43 PM UTCgcasaSeverity3 - Normal=>2 - Minor

    Back to the top


    Powered by Savane 3.1-cleanup1