0

Hi this is my first attempt to use xcode(6.4). I face one issue I created some viewContoller with Buttons,label etc. Once i shutdown my PC and start today now all the views are empty not showing anything in Main.StoryBoard. But once i run in emulator it is working. I am attaching here the screenshot. Document View

And the ViewController in Main.StoryBoard likeViewController

I hope i do some blender mistake please anyone help me to find out.

Amsheer
  • 7,046
  • 8
  • 47
  • 81

2 Answers2

2

You are using size classes in your storyBoard, now if you add any of your controller for any specific view like this

enter image description here

After adding that view when you change your view like this

enter image description here

Then the previously added controller will be disabled for this view.

That added controller will be accessible for that view only.

Community
  • 1
  • 1
Rajat
  • 10,977
  • 3
  • 38
  • 55
  • Yes i fixed the issue. Can you help me with one thing if i want same design for iphone4s, iphone5, iphone6. Simply i want my design work in all devices. How can i do it? – Amsheer Aug 31 '15 at 07:13
  • Check some Adaptive Layout Tutorial for managing the views. – Rajat Aug 31 '15 at 07:14
  • Thanks for the hint. – Amsheer Aug 31 '15 at 07:15
  • 1 more doubt i set it into for compactwidth|Any Height that is the issue. Now i want it to Any Height | Any Width . How can i do this? I hope Any Width Any Height will work in all devices so only i try this. – Amsheer Aug 31 '15 at 07:28
  • Yes, Any Width Any Height is a generic view which will work for all devices.And add the controllers , so that it will work on all devices. – Rajat Aug 31 '15 at 07:32
  • Now i want change from compact width | Any height to Any Width | Any Height. But it shows empty. Do i need to re design all the things? – Amsheer Aug 31 '15 at 08:37
  • Yes, you have to redesign the view. – Rajat Aug 31 '15 at 08:48
  • Thanks. I have only idea with Android it is very much different from that. I will ask you if i have any questions – Amsheer Aug 31 '15 at 09:33
2

You added those views for some particular size classes so for the maximum size classes those elements are not visible

Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
  • Yes i fixed the issue. Can you help me with one thing if i want same design for iphone4s, iphone5, iphone6. Simply i want my design work in all devices. How can i do it? – Amsheer Aug 31 '15 at 07:21
  • I generally dont work with class sizes, rather i take the default class size and apply auto layout or rather i used to take the VC size for 3.5inc device and then apply autolayout so that every element gets placed accordingly – Saheb Roy Aug 31 '15 at 07:28