• 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: Is it possible to pass an object to a NIB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to pass an object to a NIB


  • Subject: Re: Is it possible to pass an object to a NIB
  • From: DeNigris Sean <email@hidden>
  • Date: Sun, 6 Dec 2009 13:35:22 -0500

I tightened up the code a bit:
#Obj-C version: - (id)initWithContentsOfURL:(NSURL *)nibFileURL
nib_file = NSNib.alloc.initWithContentsOfURL NSURL::fileURLWithPath(@@NibPath)

#Obj-C version: - (BOOL)instantiateNibWithOwner:(id)ownertopLevelObjects:(NSArray **)topLevelObjects
#The Ruby bridge puts the top level objects in the second return value because the 2nd param takes a pointer
# and Ruby does not have pointers
result, top_level_objects = nib_file.instantiateNibWithOwner_topLevelObjects NSApplication.sharedApplication

view = top_level_objects.find { |obj| obj.class == object_type }

- Sean_______________________________________________

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

References: 
 >Is it possible to pass an object to a NIB (From: DeNigris Sean <email@hidden>)
 >Re: Is it possible to pass an object to a NIB (From: Chris Hanson <email@hidden>)
 >Re: Is it possible to pass an object to a NIB (From: DeNigris Sean <email@hidden>)
 >Re: Is it possible to pass an object to a NIB (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Programatically Setting Delegate
  • Next by Date: [MEET] CocoaHeads-NYC this Thursday (*note location*)
  • Previous by thread: Re: Is it possible to pass an object to a NIB
  • Next by thread: Re: Is it possible to pass an object to a NIB
  • Index(es):
    • Date
    • Thread