iOS 7 brings several changes to how you layout and customize the
appearance of your UI. The changes in view-controller layout, tint
color, and font affect all the UIKit objects in your app. In
addition, enhancements to gesture recognizer APIs give you finer
grained control over gesture interactions.
Using View Controllers
In iOS 7, view controllers use full-screen layout. At the same time,
iOS 7 gives you more granular control over the way a view controller
lays out its views. In particular, the concept of full-screen layout
has been refined to let a view controller specify the layout of each
edge of its view.
The wantsFullScreenLayout
view controller property is deprecated in
iOS 7. If you currently specify wantsFullScreenLayout = NO
, the view
controller may display its content at an unexpected screen location
when it runs in iOS 7.
To adjust how a view controller lays out its views, UIViewController
provides the following properties:
The edgesForExtendedLayout
property uses the UIRectEdge
type,
which specifies each of a rectangle’s four edges, in addition to
specifying none and all. Use edgesForExtendedLayout
to specify which
edges of a view should be extended, regardless of bar translucency. By
default, the value of this property is UIRectEdgeAll
.
- extendedLayoutIncludesOpaqueBars
If your design uses opaque bars, refine edgesForExtendedLayout
by
also setting the extendedLayoutIncludesOpaqueBars
property to
NO. (The default value of extendedLayoutIncludesOpaqueBars
is NO.)
- automaticallyAdjustsScrollViewInsets
If you don’t want a scroll view’s content insets to be automatically
adjusted, set automaticallyAdjustsScrollViewInsets
to NO. (The
default value of automaticallyAdjustsScrollViewInsets
is YES.)
- topLayoutGuide, bottomLayoutGuide
The topLayoutGuide
and bottomLayoutGuide
properties indicate the
location of the top or bottom bar edges in a view controller’s view.
If bars should overlap the top or bottom of a view, you can use
Interface Builder to position the view relative to the bar by creating
constraints to the bottom of topLayoutGuide
or to the top of
bottomLayoutGuide. (If no bars should overlap the view, the bottom of
topLayoutGuide
is the same as the top of the view and the top of
bottomLayoutGuide
is the same as the bottom of the view.) Both
properties are lazily created when requested.
Best Answer
You may have a Segue in the Storyboard which triggers when a table row is selected. When you also manually push a controller when a row is selected the error which you describe occurs. You should remove the segue from the storyboard.
EDIT: More details:
I assume you use a storyboard (more than one view controller in the design window). If you do not use it, I am on the wrong track. For example take this screenshot from one of my projects:
If you have control-dragged from the "Row" to the view controller on the right, you created a segue. It is likely that this segue is triggered when you select a row in the tableview in the left view controller. If you used a standard project, such a segue may already exist and you did not create it yourself.
The segue fires "automatically" when you select a row. When you manually push view controllers in code, you may cause a "second push" which disturbs the navigation controller.
You could just delete the segue by clicking on the thick line between the scenes or on that round icon and press delete.
If you need a segue which does not automatically trigger when a row is selected, you can control-drag it from that yellow icon to the target scene. A menu should appear and you would choose one of the options under "manual". Then the segue must be triggered manually which you would do in code with:
When you click on the round segue icon in the storyboard, you can set an identifier in the utilities window in the attributes inspector in the field "Identifier". That identifier is the string used in the code line above.