• 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: drag and drop: NSView vs. NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drag and drop: NSView vs. NSImageView


  • Subject: Re: drag and drop: NSView vs. NSImageView
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Fri, 5 Mar 2004 19:00:30 -0800

Hello...

If you want initWithFrame: to be called, you should continue to use the "Custom View" NSView placeholder in InterfaceBuilder.

You don't have to change your nib to use an NSImageView and then set the custom class to PCFolderDrop... if you leave the object in your nib as an NSView instance with the custom class set to your subclass everything will still work correctly. The only difference is that you won't be able to change any of the settings of an NSImageView in the IB inspector, you will have to set them in your code.

Essentially, you will have to choose between (1) being able to use the normal designated initializer for your view subclass, or (2) being able to change settings for your superclass in the InterfaceBuilder inspector.

Hope that helps,

Louis


On 5. Mar 2004, at 16:27, Michael Becker wrote:

Even my initWithFrame: method doesn't get called.
[...]
And of course I changed the NIB. (I deleted the old NSView, put in an NSImageView, then configured it to be of the custom class PCFolderDrop).

What am I missing here?

The Interface Builder documentation :)

IB will place the actual NSImageView in the Nib file with instructions about it should be swapped with an implementation of your subclass when the Nib is read -- the reason it does not put your class is, that it does not have the source for your class when the Nib is saved.

You can implement awakeFromNib to do your initialization.
_______________________________________________
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.


References: 
 >drag and drop: NSView vs. NSImageView (From: Michael Becker <email@hidden>)
 >Re: drag and drop: NSView vs. NSImageView (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Delegate methods not working...
  • Next by Date: Re: Delegate methods not working...
  • Previous by thread: Re: drag and drop: NSView vs. NSImageView
  • Next by thread: Re: drag and drop: NSView vs. NSImageView
  • Index(es):
    • Date
    • Thread