1

![enter image description here][1]How to embed in Navigation Controller as I am having two View Controllers with one of them as RootViewController and when I go to editor--->Embed-in--->no options are usable/Selectable !! Please suggest me the reason as I have used Navigation Controller earlier in previous sample app and it was working fine .

Please help on this!! Thanks in advance

another_it_guy
  • 111
  • 1
  • 10
  • Have you selected your rootviewcontroller first and then tried the embed option? – AppleDelegate Apr 11 '14 at 06:50
  • Yes I have selected that and then went to Editor – another_it_guy Apr 11 '14 at 06:52
  • I have added Navigation Controller by dragging and tried ? Is it OK or suggest @AppleDelegate – another_it_guy Apr 11 '14 at 06:53
  • click on the viewcontroller below viewcontroller scene and then try it – AppleDelegate Apr 11 '14 at 06:58
  • Plzz check the attached image, my scenes will be clear to you and then maybe you can suggest . Also i have tried as you said in previous comment but it not worked as well – another_it_guy Apr 11 '14 at 07:11
  • Your viewcontroller seems to have some problem.please delete this old controller and try it with new one – AppleDelegate Apr 11 '14 at 07:18
  • Your screen shot shows a nib file, not a storyboard. You need to create a storyboard and then you will be able to embed your view controller – Paulw11 Apr 11 '14 at 07:19
  • @Paulw11 Thanx for ur help, I am new to iOS development if i create new storyboard then how to add these xib file to that storyboard. – another_it_guy Apr 11 '14 at 07:24
  • You can't - you will need to recreate your view controller scenes in the storyboard. xib files and storyboards are alternatives - you cannot embed one inside the other – Paulw11 Apr 11 '14 at 07:34
  • @Paulw11:I have created new storyboard and deleted previous .xib file (remove references) and added all the button actions to storyboard but now it is giving "AutoLayout on iOS versions prior to 6.0error" .May be now I have to tell my code that now UI is storyboard instead of .xib!! Thanxx for ur help – another_it_guy Apr 11 '14 at 09:59
  • http://stackoverflow.com/questions/18735847/ios-7-auto-layout-on-ios-versions-prior-to-6-0 – Paulw11 Apr 11 '14 at 10:10

1 Answers1

0

Your screen shot shows a nib file, not a storyboard. You need to create a storyboard and then you will be able to embed your view controller.

You will also need to change your project settings to require iOS 6 as a minimum Upgraded app to iOS 7 - error "Auto Layout on iOS Versions prior to 6.0" (but want iOS 7 not older)

Also make sure you change your project to refer to your main storyboard rather than an xib How to convert a NIB-based project to a Storyboard-based?

Community
  • 1
  • 1
Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • Can you please let me know how to change my reference for storyboard as I am really not getting this and also that AutoLAyout error has gone. – another_it_guy Apr 11 '14 at 10:21