Example of iPad SplitView where there is an .xib file specified for Root Controller? - ipad

Is it possible to specify a xib file for the RootController of an iPad's splitview?

Open the MainWindow-iPad.xib that is autogenerated with your project. You should be able to expand the SplitViewController to display the viewControllers that are housed in it. You'll notice that the Detail side says something about "Loaded by DetailViewController.xib". You'll have to click the RootViewController icon and specify a nib name and make the necessary connections in Interface Builder.

I'm sure you found an answer already, but for folks who are reading this and want a good source, the Apple Sample COde "MultipleDetailView" uses a SplitView that goes to new nibs for the RootController...just use that as a guide!

Related

UIViewController defined in a xib file doesn't load in the storyboard

I'm trying to load a subclass of a UIViewController with its views defined in a xib file into a storyboard. Let's call it a NibViewController.
The point of this approach is to reuse the same ViewController in multiple screens of the app.
I know it's possible to do it manually in the code, but I'm looking for a solution in the storyboard. I've tried suggestions from other topics like this one, but nothing worked. The ViewController is correctly displayed in the simulator but not in the storyboard. Here is the code: https://github.com/srstanic/NibViewControllerInStoryboard
and here is the screenshot:
Am I mistaken to expect the contents of the NibViewController to appear in the storyboard?
Am I mistaken to expect the contents of the NibViewController to appear in the storyboard?
Yes, you are mistaken. Your app is working perfectly so you should stop worrying and just proceed.
By deleting the view from the view controller in the storyboard, you have specifically instructed the storyboard: "Do not make a view for this view controller. At runtime, the view should come from the xib file, not from you."
And that is exactly what does happen at runtime. So just design your interface in the xib file and all will be well.

Why Main.storyboard doesn't show?

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.

Xib view controller in storyboard

I'm trying to use this repository from Github and to use it you must have a xib file whether it's in your storyboard or not and I wanted to know how I can do to have my view controllers acting like xib but in my storyboard.
I'm sorry if I'm not clear enough but just tell me in the comments and I'll try my best to be clearer.
Kindest regards,
All you have to do is in your project select New File from the file menu or by right clicking in your file navigator. On the popupWindow select iOS on the left (This will let you see all the options) find the "View Option".
and this will create a View.Xib file. This is just the UI file for a view.

How do I know which xib is the first one to load?

I am researching a huge Xcode project, how do I know which xib is the first xib be loaded by IOS?
In main.m, I can only know the main delegation file, but how to find the main.xib.
BTW, I search the {project}-info.plist, but found nothing.
Addtion, I know which file is the rootviewcontroller.
From your description the project doesn't use storyboard(s), so the initial window and root view controller are created by the app delegate. This may or may not use an XIB file (you'd need to check the implementation if the view controller class).

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