Following on from this question, I have so far been unable to rearrange tab bar items in my iPad app.
I have zoomed in as far as I can go and double-clicked the tab bar controller so that it is highlighted in the Document Outline inspector.
I then try to click-drag individual items left or right but nothing happens, i.e. I'm unable to select them.
Following the comments on the other question, I've tried clicking on another .h or .m file, then switching back to the Storyboard. I've also tried closing x-code and restarting but neither made any difference.
Can anyone tell me what I'm doing wrong?
In the end I took the brute force approach of deleting the segues then reconnecting in the preferred order.
Not particularly elegant but it did the job.
Related
I'm trying to get the split view controller working properly but apparently there's a bug in there or I'm missing something.
First of all, I've started a blank OSX Obj-C application, and in the Storyboard I've dragged the split view controller. Next, I've linked the segues from the main window controller to the split view and added two labels.
http://i.imgur.com/dlFObaF.png
When I build the project, it shows only the second page. Not to mention strange window size in the final build.
http://i.stack.imgur.com/IqRqr.png
I've tried everything.
This occurs in both vertical and horizontal split view.
Any suggestions?
I had the same issue myself today, but it's just the split line wasn't initiated properly.
To see, this, once you run your app, move your mouse toward the edge of the window and drag it, you will now see another view emerging.
To my best knowledge, I do not know how to fix this in IB or in code. Apparently NSSplitViewController does not have a property like UISplitViewControllerAutomaticDimension. Would appreciate if someone can contribute to this.
Edited: Found an answer via another thread. Basically, try to add some constraints to the subviews inside each view and that should prevent the size of a view to be zero. In my toy example, adding margin constraints to my buttons worked out well.
I am just learning Xcode. I did something that caused a view controller to turn black below the navigation bar when you build app.
It looks white in storyboard.
Also, when I pull a label onto the storyboard, it aligns to the left margin and does not show the drag boxes around it.
I may have inadvertently clicked something but when I compared it in attributes and identity inspectors line by line to another project, nothing seems amiss, i.e. everything is the default value.
Has anyone run across this?
There is not code in associated class that would cause this as it is generic i.e. plain vanilla.
Would appreciate any suggestions. Thx.
With that little information i'd say you removed the root view of the controller?
Either way, you say there is no code, so I'd suggest you simply delete that controller and create another one (bottom right, objects, viewcontroller). Since it's empty you're not gonna lose any data or time :)
Then link it to your class in the Identity Inspector and you're good to go as if it was a new one.
I have an NSSplitView inside an NSTabView. If the split view's tab is the one initially shown, it seems to work fine, but if the split view's tab is shown later instead, it appears with the first pane fully expanded and the second one collapsed. Because I want to use a thin divider for the split view, there is no way for the user to get out of this.
Returning NO from splitView:canCollapseSubview: doesn't help, even though I verified that it does get called.
As a workaround, I tried letting the split view's tab be initially shown, and then manually switching after the window is loaded (in awakeFromNib), but this did not fix it.
Is this a known issue with NSSplitView if it isn't initially shown? Is there a better way to apply the tab switching workaround? Or is there a better workaround?
I ended up getting around the issue by switching to RBSplitView. I also made a fork on GitHub to update the project to work with the latest Xcode.
Summery:
I have a custom UITabBarAutoRotateController which returns YES from shouldAutorotateToInterfaceOrientation. This has no effect.
If I minimize and show the app again, the rotation issue goes away.
How do I refresh the screen so the user does not have to do this (so rotation works again)?
Details (setup graphically, so no code):
I have two UITabBarController in MainWindow.xib. I only want one to show at a time. So I am linking graphically rootViewController = tabBarController_name1. There is also tabBarController_name2.
I will also have an alert MessageBox for a user to choose what type of application they need, and it will choose a tab bar controller based on their request (per customer definition). This is commented out for now.
There is a bug with Rotation when two UITabBarControllers exist on the same xib. When I try to rotate the screen, it stays upward with wherever the main screen button (power button looking button) faces. HandleOrientationChange does not get called on the active custom ViewController being shown.
The reason I believe it's a bug is because if I hit the main screen button (minimizing the application), and click back on the application (brings it back to the foreground), rotation works perfectly!
Sorry for making you read all that mumbo :). My true question is, "Is there anyway I could refresh the main window or likewise UITabBarController's to get rotation working (without requiring the program be minimized and shown)"? A work-around, if you will?
p.s. I cannot use Storyboard for backwards compatibility reasons. The customer will be receiving this code/project. So I would like to keep this in one graphical page, rather than hiding/showing UITabBarItem's.
EDIT: two-uitabbarcontrollers-and-autorotation and uitabbarcontrollers-and-uinavigationcontrollers were both helpful, but did not address "why" this issue happens. "noob" here when it comes to xcode :)
Tab bar controller inside a navigation controller, or sharing a navigation root view is the answer. Do not use a TabBarViewController. Which, as a noob, I'm not quite sure why TabBarViewController exists (or at least isn't depreciated).
Dragging two TabBarViewControllers into the same page should result in a warning saying that you probably want to implement TabBarViewController by making a custom UIViewController and attaching a plain UITabBar to it.
Frustrating...but finally making progress :)
I'm using Xcode for the first time. I've been following a tutorial, and I'm completely stumped by something that's surely trivial. I've dragged a "Menu" from the Library into my "MainMenu.xib" window. Double-clicking this menu makes it appear.
No trouble thus far. Editing the three items is intuitive, as is deleting items. How on earth do I add an item to this menu, though?
You want to drag an NSMenuItem from the library palette onto the menu:
You can add submenus and separators similarly.
Cmd-D duplicates anything as well if you are getting tired of the drag-drop thing.
You just have to watch out that as your tags and action connections are getting duplicated too they might not be connected to the thing you wanted them to be.