• 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: class changes and serialized objects in a nib file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class changes and serialized objects in a nib file


  • Subject: Re: class changes and serialized objects in a nib file
  • From: Chris Hanson <email@hidden>
  • Date: Wed, 30 Nov 2005 10:46:20 -0800

On Nov 30, 2005, at 8:45 AM, A. Blue wrote:

Note that the class name has remained the same, the order of the ivars
has been swapped, and the nib file remains unedited.  What happens
when I run my application?

Everything should work as expected. Outlets are looked up and set by name when a nib is loaded, not by byte offset. In fact this works similarly to key-value coding; if an object has a "foo" outlet and a - setFoo: method, the nib loader will invoke that method to set the "foo" outlet rather than manipulate the instance variable directly.


How do I update an object in a nib file when its corresponding class
has changed out from under it?  Is there no other way to do this than
to delete the object from the nib file, instantiate a new object, and
wire up the connections all over again?

There are a couple ways you can do this.

One way is to drag the header file containing the class definition to the Interface Builder document window. (That's the window with the icons in it; a window you're putting controls into is a design window.)

Another is to bring up the context menu for the class in Interface Builder's class browser, and to tell it to re-import the header. I think you can also do this from the inspector when the class is selected in Interface Builder's class browser.

Wouldn't it be nice if XCode/Interface Builder notified developers
when a class is changed in a way that obviously invalidates nib file
objects?

As I describe above, just changing the order of a couple instance variables in a class doesn't invalidate any nibs using that class.


That said, if there are features or enhancements that you'd like to see in the developer tools, please file them at <http:// bugreport.apple.com>.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >class changes and serialized objects in a nib file (From: "A. Blue" <email@hidden>)

  • Prev by Date: Re: getting NSTextView to work
  • Next by Date: Re: Warnings that won't go away
  • Previous by thread: Re: class changes and serialized objects in a nib file
  • Next by thread: Re: class changes and serialized objects in a nib file
  • Index(es):
    • Date
    • Thread