Re: a bug in iphone SDK's creation of view based xib files.
Re: a bug in iphone SDK's creation of view based xib files.
- Subject: Re: a bug in iphone SDK's creation of view based xib files.
- From: Joey Hagedorn <email@hidden>
- Date: Wed, 2 Sep 2009 23:15:15 -0700
Hi Jon,
On Aug 30, 2009, at 8:01 AM, jon wrote:
a bug in iphone SDK's creation of view based xib files. (this is
using 3.1, but other's probably apply)
steps to reproduce.
Please do not discuss unreleased software on this list. You have
access to the developer forums which are an appropriate place to
discuss issues you may have. The issue you're discussing applies to
iPhone OS 3.0 as well, so I'll continue to answer.
step 1. create a new iPhone View-based Application in Xcode.
step 2. add a new Class.. "Cocoa Touch Class" of
UIViewController subclass.
step 3. be sure to include the "option" of "with XIB for user
interface."
step 4. open the newly created XIB file in interface Builder.
(change the view's back ground color to some color that you can see
easily if incorrectly placed in the iphone simulator)
step 5. under the view size tab in the inspector of interface
builder of this newly created "view" in the XIB, you will find it
impossible to adjust the "stretch" arrows of the autoSizing.. .
The adjustment of autosizing controls are disabled when there are
enabled Simulated User Interface attributes. If you disable the the
Simulated Status Bar on the view, you should be able to adjust the
springs and struts freely.
so if you compile a working app that can be rotated in the iphone
simulator. (you will need a working app that can rotate the view in
the iphone simulator)
(and have the app's view in the simulator rotate automatically),
you will see that the view is no longer sized correctly (in the
iphone simulator). (you will see the background color in the wrong
places)
the part that is wrong, and can be corrected:
inside the newly created XIB file, you will find a line "<int
key="NSvFlags">256</int>" (or something similar for the number)
this makes it impossible to change the autoSizing arrows to stretch
the "view" of the new xib in interface builder... (notice the first
xib file in the new project is set correctly, but this new xib you
create with tne new class is incorrect)
if you change it instead to ""<int key="NSvFlags">274</int>" then
you regain the function of being able to size your view in the
"autosize" area, and be able to rotate your view automatically in
the running app's iphone simulator.
this "key" should be changed so that you can change the stretching
ability to the programers preference, which is some other code that
i do not know at this time. the code given hard wires the auto
stretch permanently... the incorrect code turns off auto stretch
permanently.... but the correct code should make it the programers
option to have stretching or no stretching…
You should never edit the contents of a XIB file by hand; always use
Interface Builder to edit XIB files. The springs and struts are
disabled on views with simulated user interface attributes, so this is
expected.
In any case, whenever you believe there is a bug, please file a report
at http://bugreporter.apple.com
In this case, it sounds like you expect the view provided in the
UIViewController Subclass with XIB file template to have the
autosizing parameters set differently.
Thanks,
--Joey_______________________________________________
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