xcode-storyboard

How does OS X load a storyboard based app, and how does it do window management?

て烟熏妆下的殇ゞ 提交于 2019-12-03 12:42:39
问题 I'm working on a brand new OS X app, and I've taken the daring route of working with a few technologies I haven't used much before. (I'm an iOS developer.) I'm using Storyboards, Swift, and Core Data in my app, all from the Xcode template. When my app starts, it creates an NSWindowController from a Storyboard. In another OS X app I made in Objective-C, I use the delegate method applicationShouldHandleReopen:hasVisibleWindows: to tell the window controller to bring up the window controller's

how to make UILabel autosize text in storyboard (or interface builder), NOT programmatically

折月煮酒 提交于 2019-12-03 08:06:08
问题 Every time I click-and-drag a UILabel to storyboard, and then add text to Text field, the text is cut off, so I then have to click-and-drag the UILabel to stretch it big enough so that the text appears. I can't figure out how to make the UILabel automatically get big enough to fit the text. This would save time while designing new views. 回答1: On any element in Interface Builder you can select the element and hit... Editor > Size to Fit Content (keyboard shortcut: CMD + = ) This will do a

How do you bind a storyboard view to a Core Data entity when using NSDocument?

北城以北 提交于 2019-12-03 08:05:57
I'm building an OS X app that uses core data, NSDocument, storyboards, and Cocoa bindings. My expectation is that the following occurs: An instance of MyDocument ( NSDocument subclass) is created. MyDocument creates a Core Data NSManagedObjectContext that represents the document's data. MyDocument instantiates an NSWindowController from the storyboard by its identifier. Within the storyboard, the window controller contains DocumentEditorViewController ( NSViewController subclass) which displays and edits the document. Within the storyboard, DocumentEditorViewController has an NSArrayController

How to tell the active view controller when applicationDidBecomeActive is called?

谁说胖子不能爱 提交于 2019-12-03 06:59:02
问题 I feel I am missing a trick here... I just want to call viewDidLoad or viewDidAppear on the current active view controller when applicationDidBecomeActive gets called, so I can reset some animations or whatever, when the app is started up again from the background. Some of my views don't care, but others really need to know. I am using Storyboards and my app delegate file has the standard functions - but all with EMPTY bodies. For example, didFinishLaunchingWithOptions just returns YES and

How does OS X load a storyboard based app, and how does it do window management?

点点圈 提交于 2019-12-03 03:46:08
I'm working on a brand new OS X app, and I've taken the daring route of working with a few technologies I haven't used much before. (I'm an iOS developer.) I'm using Storyboards, Swift, and Core Data in my app, all from the Xcode template. When my app starts, it creates an NSWindowController from a Storyboard. In another OS X app I made in Objective-C, I use the delegate method applicationShouldHandleReopen:hasVisibleWindows: to tell the window controller to bring up the window controller's window. I know that the language semantics remain the same in Swift, but Core Data and Storyboards leave

Change Container View Content with Tabs in iOS

天涯浪子 提交于 2019-12-03 02:27:21
问题 I'm trying to make a form that spans three tabs. You can see in the screenshot below where the tabs will be. When the user taps a tab, the Container View should update and show a particular view controller I have. Tab 1 = View Controller 1 Tab 2 = View Controller 2 Tab 3 = View Controller 3 The view controller shown above has the class PPAddEntryViewController.m. I created an outlet for the Container view within this class and now have a Container View property: @property (weak, nonatomic)

Storyboard “Main”, but didn't get a UITableView when using UITableViewController

穿精又带淫゛_ 提交于 2019-12-03 01:27:25
I have been going through this tutorial , "Option 2: Prototype Cells" I implimented all the steps, but, the following code gives me an error: @interface MTViewController : UITableViewController @end the error message is: instantiated view controller with identifier "UIViewController-BYZ-38-t0r" from storyboard "Main", but didn't get a UITableView.' Here is what I tried - I changed UITableViewController to UIViewController and the error went away. But, the tableview remains blank. Can you tell me why this is ? In your storyboard, you need to make the root view of your UITableViewController a

Switching between localized storyboard at runtime

岁酱吖の 提交于 2019-12-03 00:05:03
I have iPhone application using storyboard with two language (Arabic / English) how i can switch from Arabic localization storyboard to English storyboard without need to change language iPhone settings (At run time) I have resolved you can do it as the following below code : UIStoryboard *storyBoard; if ([language isEqualToString:@"ar"]) { lan = [[NSLocale preferredLanguages] objectAtIndex:0]; storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone5Arabic" bundle:bnd]; } else if([language isEqualToString:@"en"]) { NSLog(@"DDD "); lan = [[NSLocale preferredLanguages]

how to make UILabel autosize text in storyboard (or interface builder), NOT programmatically

会有一股神秘感。 提交于 2019-12-02 21:34:49
Every time I click-and-drag a UILabel to storyboard, and then add text to Text field, the text is cut off, so I then have to click-and-drag the UILabel to stretch it big enough so that the text appears. I can't figure out how to make the UILabel automatically get big enough to fit the text. This would save time while designing new views. Fogmeister On any element in Interface Builder you can select the element and hit... Editor > Size to Fit Content (keyboard shortcut: CMD + = ) This will do a "sizeToFit" on the selected element. Labels will fit their text size, image view will resize to the

Get attribute of viewcontroller created with storyboard

依然范特西╮ 提交于 2019-12-02 18:19:08
问题 I'm currently learning swift and I'm trying to learn of instanciation from storyboard works, but the error I'm facing now isn't documented very much. I created a viewcontroller in my main storyboard and I specified it's type as a custom class I called previously SimpleNewsViewController , here's the code of my class, it is'nt complicated: class SimpleNewsViewController: UIViewController { @IBOutlet weak var myImage: UIImageView! @IBOutlet weak var myLabel: UILabel! @IBOutlet weak var myText: