• 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: Interface Builder Questions...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface Builder Questions...


  • Subject: Re: Interface Builder Questions...
  • From: Joar Wingfors <email@hidden>
  • Date: Sun, 28 Jun 2009 13:21:19 -0700


On 28 jun 2009, at 13.05, Kyle Sluder wrote:

On Sun, Jun 28, 2009 at 12:59 PM, Phil Hystad<email@hidden> wrote:
(1) The default Cocoa Application created by Xcode creates a simple
application with a single window and a default menu (among other things I
presume). This window has a content view which I am assuming is an instance
of NSView but I actually can't find out if that is true. Therefore, are
there any inspectors that tell me the actual class used for a particular
view. The class identity part of the Inspector for the content view
suggests has a drop down that allows me to choose various classes but there
must be a specific class that is used already. How do I find this?

Don't worry about it. You shouldn't muck with the content view of a window; the window treats it specially. It's only exposed as an NSView, regardless of what subclass it is actually an instance of. Just add your views as children of it.


That's not correct. It's perfectly valid to replace the content view with any other view of your choosing. You're probably right in pointing out that it's not commonly done though. For a very simple window with some sort of custom view that provides all drawing, that would be a fine thing to do though.

You should be able to set the class of view used in the identity inspector, or replace the content view of the window at runtime, just like for all other views.


(2) I am trying to understand how the window sizing features of the view
inspector relate to the window itself. As best as I can tell, none of the
actual window sizing features for the content view are usable as they do not
really seem to do anything. Is this true? Is it possibly the case that the
content view, being bound to the window frame, is sized automatically based
on the window size?


Yes that's correct. The content view is always resized to fit the content area of the window.


(3) Again, on the window sizing inspector, if I resize the window using the
resize thingy in the lower right hand corner, I can see the updated pixel
size in the inspector, but only after I stop resizing. If I want to resize
to a particular dimension, say 300 x 225 (or, whatever), it is a try this,
check, try that check, and so on. Is there a way to enable the size values
of height and width to resize dynamically as I change the window size? I
have looked all over the documentation and tried a lot of things but nothing
seems to make the behavior different.

Don't think so. File a radar: http://bugreport.apple.com You can also enter the values directly in the text fields.


Good suggestion. Note though, that if you already know the dimension you want to use, it's probably easier to set it using the numeric input fields in the inspector directly. Also note that if you hold down the Command key while resizing in IB it will resize smoothly, and not snap to guides. This often makes pixel resizing / alignment a lot easier.


(4) And, finally, on the window sizing inspector, in the part called
"autosizing" when I click on the content view (remember, it is empty, just
as created by Xcode), there is an animated image that expands and contracts
in size and I have absolutely no idea why it is animated or what it means.
Any help?


Read up about autosizing of subviews here:

<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/WorkingWithAViewHierarchy.html#//apple_ref/doc/uid/TP40002978-CH4-SW12 >


j o a r


_______________________________________________

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: Interface Builder Questions...
      • From: Kyle Sluder <email@hidden>
    • Re: Interface Builder Questions...
      • From: Phil Hystad <email@hidden>
References: 
 >Interface Builder Questions... (From: Phil Hystad <email@hidden>)
 >Re: Interface Builder Questions... (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Dispose patern (was: Re: GC pros and cons)
  • Next by Date: Re: Interface Builder Questions...
  • Previous by thread: Re: Interface Builder Questions...
  • Next by thread: Re: Interface Builder Questions...
  • Index(es):
    • Date
    • Thread