• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa bootstrap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa bootstrap


  • Subject: Re: Cocoa bootstrap
  • From: Andrew Merenbach <email@hidden>
  • Date: Thu, 10 May 2007 16:29:55 -0700

Hi, Yakov,

You've already received an answer from Nick Zitzmann, but you may wish to change part of your code to:

XTensionController* cntl = [[XTensionController alloc] initWithWindowNibName:@"Converter"];

The -new method is not used much, anymore, as it is a bit clearer as to what's happening when one uses -alloc/-initWithWindowNibName. Additionally, if you do use -new, you can't use - initWithWindowNibName afterwards, since -new already performs a plain -init. So you're probably best off just using -alloc and - initWithWindowNibName, and discarding the -new.

The same applies with objects that require a standard -init.

Cheers,
	Andrew

On May 10, 2007, at 11:21 AM, Yakov Zaytsev wrote:

Hi,

I'm a Cocoa newcomer. I've just subscribed to Cocoa-dev and.. I want to allow myself probably newbie question as a first post ;)

I want to open a window from a Carbon-ized application or from plain main() like this [in order to plug in this code into "big" application]


XTensionController* cntl = [XTensionController new]; /* [cntl initWithWindowNibName:@"Converter"]; [cntl showWindow:nil]; */

    [NSBundle loadNibNamed: @"Converter.nib" owner:cntl];

    NSLog (@"window name:%@", [cntl window]);


The problem is that in any case I got nil...
Should I add some cocoa specific startup code? Yeah, besides bunch of leaks which are shown in console log..
In general is it hard to add Cocoa to a Carbon-ized application? How much set up code would be involved..


Thanks in advance for any pointers!..


--- Yakov Zaytsev Envion Software http://www.envionsoftware.com

<Talk Small and Carry a Big Class Library>





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40ucla.edu


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa bootstrap
      • From: Sherm Pendley <email@hidden>
References: 
 >Cocoa bootstrap (From: Yakov Zaytsev <email@hidden>)

  • Prev by Date: Re: Place for app version value in document wrapper
  • Next by Date: Re: Cocoa bootstrap
  • Previous by thread: Re: Cocoa bootstrap
  • Next by thread: Re: Cocoa bootstrap
  • Index(es):
    • Date
    • Thread