• 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: Loading a .nib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a .nib?


  • Subject: Re: Loading a .nib?
  • From: "J. Todd Slack" <email@hidden>
  • Date: Fri, 2 May 2008 16:33:56 -0700

Hi,

One question though.

When I use:

[NSBundle loadNibNamed:@"SettingsDialog" owner:self]; // the nib name is SettingsDialog.nib

Xcode complains that this is the first time that self is used.

I am a bit rusty right now, can anyone explain why? I thought self could be used like this.

What am I missing?

Thanks.
-Jason


On May 2, 2008, at 4:31 PM, Michael Vannorsdel wrote:

You can convert this to the C equivalent if you absolutely must use C (off the top of my head):

Class mclass = objc_getMetaClass("NSBundle");
SEL s = @selector(loadNibNamed:owner:);
IMP f = class_getMethodImplementation(mclass,  s);

BOOL res = f(mclass, s, @"SettingsDialog", self);


On May 2, 2008, at 4:38 PM, J. Todd Slack wrote:

Yeah, I am using:

[NSBundle loadNibNamed:@"SettingsDialog" owner:self;]

But that is Objective-C, I need to do it from a .c file.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Loading a .nib?
      • From: Brian Stern <email@hidden>
    • Re: Loading a .nib?
      • From: Nick Zitzmann <email@hidden>
    • Re: Loading a .nib?
      • From: Michael Vannorsdel <email@hidden>
References: 
 >Loading a .nib? (From: "J. Todd Slack" <email@hidden>)
 >Re: Loading a .nib? (From: Jonathan Hess <email@hidden>)
 >Re: Loading a .nib? (From: "J. Todd Slack" <email@hidden>)
 >Re: Loading a .nib? (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: Loading a .nib?
  • Next by Date: Read XML from the web
  • Previous by thread: Re: Loading a .nib?
  • Next by thread: Re: Loading a .nib?
  • Index(es):
    • Date
    • Thread