• 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: load a NIB from NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: load a NIB from NSData


  • Subject: Re: load a NIB from NSData
  • From: Itrat Khan <email@hidden>
  • Date: Tue, 18 Jun 2002 16:11:42 -0400

On Wednesday, June 12, 2002, at 10:41 AM, Timothy Ritchey wrote:

I am trying to figure out if there is a way to load a NIB file that has been loaded into an NSData object that I am passing over a DO connection. The inelegant method would be to write the NSData object out to a file, and then use the loadNibNamed:owner: selector on it. Any ideas how I might just do it with the in-memory object? Is there a way to treat an NSData object as a memory mapped file perhaps?


To treat a file as on object in memory, use NSFileWrapper. Give it the path to your nib file using initWithPath: and ask for a serializedRepresentation (an NSData object); send that NSData object to a DO connection, and recreate the file wrapper on the other end using initWithSerializedRepresentation:.

As for loading the nib, you may have to tell the DO's NSFileWrapper to writeToFile: and then call loadNibNamed: on the result, which, by the way, I don't see as being inelegant. :)

Regards,
Itrat.

............................................................
Modeless Software, Inc.
London, Ontario (Canada)
Tel: +1 519 473 2037
Web: www.modeless.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: load a NIB from NSData
      • From: Sherm Pendley <email@hidden>
References: 
 >load a NIB from NSData (From: Timothy Ritchey <email@hidden>)

  • Prev by Date: NSClipView and ATSUI drawing
  • Next by Date: Re: load a NIB from NSData
  • Previous by thread: Re: load a NIB from NSData
  • Next by thread: Re: load a NIB from NSData
  • Index(es):
    • Date
    • Thread