Why Main.storyboard doesn't show? - ios

I'm new to ios develop,I learned about storyboard recently and I'm trying to use it.But at last the storyboard file looks doesn't be loaded.
What I have done is:
1.add some ui elements like Button to initial xib file of storyboard
2.modify Main Interface in project - General page to Main.(my storyboard file name is Main.storyboard)
When I start the app,the screen is all white with nothing.Anyone can tell me why this happened and how can I solve this bug.Thanks!
Update1:As this image shows,I have set initial xib for storyboard.

Since you said you didn't created the project with a storyboard template, look for this line in your info.plist
This could happen because the subview frames are being created outside the view frame. Try setting some alignment constraints in your subviews.

You have to set your controller as initial view controller.
You can find it in your Main.Storyboard on the right site, if you select your first controller.

Here in 2021, a default Xcode project uses scenes, but that requires iOS 13 and I wanted to support iOS 12. I deleted the SceneDelegate file from my project and the scene delegate functions from the AppDelegate file, but then my storyboard wasn't loading either. The problem is that I also needed to remove the Application Scene Manifest section from info.plist.

Related

Cant control drag a reference object to the ViewController in Xcode 9.2 (9C40b) iOS project

How to a create an outlet for an iOS control on the storyboard that is connected to my swift ViewController code?
All the tutorials for iOS development show that you can control drag a UI element to your ViewContoller swift code for an outlet. However it never works for me, it shows the blue line from the storyboard, but on the drop it never brings up the dialog to add a new outlet.
Creating a new Action drag and drop works just fine for buttons. I have seen many ask this question and there seems to be no definite answer.
Is there something different with iOS projects?
I tried to set the View Controller custom class to my specific ViewController class, and then I can drag and drop a new outlet. However the project fails to compile.
LaunchScreen.storyboard: error: Illegal Configuration: Launch screens may not set custom classnames
I seem to be missing something here, but all the tutorials I watch/read (none seem to cover Xcode 9 or swift 4) all show this behavior as being the normal way to create an outlet.
Launch screens are not able to have outlets attached to them. They are static. If you'd like to have a "launch screen" that you can manipulate, duplicate your launch screen layout into an initial view controller and do what you like there.
I think this is because you are connecting it from the LaunchScreen.xib instead of the main.storyboard files.

Main interface can not be changed to my own storyboard

I'm happy to know that zero code is needed to create interface for iOS app using storyboard somehow, but failed to show my own storyboard by changing 'main interface' of project setting in XCode.
Launching app brought me to a black screen which is expected to be a tableview within a navigation.
Having set Colorboard.storyboard as interface should add a grey arrow line pointing to navigation controller in the storyboard....however there wasn't such line.
Xcode I am using is 6.3...I am wondering if there is something I missed?
As far as I see you didn't set the initial view controller for storyboard.
In Attributes inspector select the param called "Is Initial Controller"
More details in documentation.

xcode: Problems connecting main storyboard

I am following the tutorial here. I just created my first storyboard and tried to set it as the main storyboard. After following the tutorial I clicked the run button and the simulator doesn't render any of the changes ive created.
I have a screen shot of my xcode project here(not sure how else to display it): https://app.box.com/s/okw7jlzq5zmcetd5cehu
What am I doing wrong?
Here is another screenshot of the storyboard itself: https://app.box.com/s/jt6i0an3maowwvgsamk7
Place a checkmark in the box "Is Initial View Controller" for the view controller you want to load.
I think your problem is the code in the app delegate. When you use a storyboard, you don't need anything in there except "return YES". The storyboard creates the window, so the code you have in there is making another window, not the one that your storyboard controller is a subview of.
Using this tutorial might teach you some things about the structure of an iOS app, but if you just want to make an app with a storyboard, you should start with the "single view" template instead of the "empty" one. It will give you a storyboard and an initial controller.

Why a singleView application doesn't load a storyboard if a storyboard is added later to the project?

I created a new singleView application without storyboard (say FirstProject) and another single view application with storyboard (say SecondProject)and then added a storyboard in the application which didn't have a storyboard previously.
Then I went in the FirstProject and changed the class of the storyboard to the viewcontroller class in identity inspector.
After that I opened other files in the two projects individually and made changes in the code to be same in the corresponding files in the two projects.
Now when I run the project which had storyboard at the time of creation shows a white blank screen but the other application (in which storyboard was added later) shows just a black screen with no errors and no warnings.. What is the difference in these two files?
What is it that I am missing. How to tell an application that it should now load its view from storyboard and not from a XIB file as there is none?
I second the "Good Job" building from scratch to truly Grok storyboards.
You need to delete the template code and just return YES; in application:didFinishLaunchingWithOptions:
Complete Process
Create a new project using the "Empty Application" template.
New File, User Interface, Storyboard
Set the storyboard in the targets summery (updates the info.plist)
Delete the template code and just return YES; in application:didFinishLaunchingWithOptions:
The way that a storyboard application knows to use the storyboard at launch time is that the Info.plist file contains an entry pointing to the main storyboard. You need to set that up. The "Main storyboard file base name" (UIMainStoryboardFile) must match the base name of the storyboard file; the system sees this and loads the designated storyboard file automatically as the app launches.
Also you need to make sure that the initial view controller in the storyboard is marked as the initial view controller.

Using Storyboard how to interact with viewcontroller objects

I've reviewed many websites and youtube videos that have IOS 5 storyboarding information. Most of them are pretty basic and only describe how to get started with storyboarding and how to segue into other views. I'm interested in taking it a step further and actually adding custom code to the views contained within the storyboard.
Is the "normal" workflow when creating an IOS app using storyboard?
Create the layout of an app using storyboard (adding views and objects to those views).
Create viewcontroller files (.h and .m), one for each view contained within the storyboard.
Hook up the scenes from the storyboard with your own view controller subclasses by editing the "class" values in Identity Inspector.
I believe I followed those steps, but when I implemented step #3 above and ran my application, I was only able to see a black screen. The view I had created in storyboard wouldn't display.
You have the right steps. Make sure you create your .m and .h without a xib. Post your code for the view controller for your first view to get more help.
yes, this is the normal workflow. have you set the "initial viewcontroller? ?
see this image: http://dl.dropbox.com/u/31437518/Screen%20Shot%202012-01-24%20at%2012.29.34%20AM.png
It sounds like you made a storyboard file but it isn't being loaded.
Do you have the main storyboard setting in the target summary screen filled in?

Resources