interface-builder

'Receiver has no segue with identifier' when identifier exists

做~自己de王妃 提交于 2019-12-18 17:29:44
问题 For an iOS app, I have a story board and multiple controllers, and a segue going from controller GameClass to controller SettingsClass . The segue, in view Controller GameClass has an identifier called GameToSettings : However, when I want to call the segue from my GameClass : [self performSegueWithIdentifier: @"GameToSettings" sender: self]; I get the error message *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<GameClass: 0xcf0c550>) has no

Create a XIB only Cocoa Project in xcode 8.3

情到浓时终转凉″ 提交于 2019-12-18 17:08:53
问题 I'm trying to create a XIB based application in XCode 8.3 but the option to Start a project without a Storyboard has been removed. Here are the steps I am taking to set up my project: Create a new Cocoa Application. Delete Main.Storyboard Delete ViewController.swift Add a new file to the project - a Cocoa Class - subclass of NSWindowController, Also create XIB file checked - named MainWindowController Under General project info- delete reference to Main for Main Interface in app delegate: add

UITableViewCell outside of UITableView

﹥>﹥吖頭↗ 提交于 2019-12-18 14:55:35
问题 I notice that InterfaceBuilder has UITableViewCell in its library of objects I can drag onto a view. I wonder if it ever makes sense to use one outside of a UITableView . 回答1: UITableViewCell s are meant to be used in UITableView s only. Feel free to stick them elsewhere, but you do so at your own risk. 回答2: I have tried this and yes it does not appear to work. Which is, of course, fair, given the purpose and use of cells. A reason for wanting to do this, in my case I have the cell used in a

Designing the iPhone interface in a nib or in code?

 ̄綄美尐妖づ 提交于 2019-12-18 12:55:24
问题 I've been pondering over this question for a while now... On the one hand, Interface Builder offers a really easy way to design the interface and wire the elements up with objects in code. On the other hand, in larger projects, Interface Builder becomes a hassle to maintain. Any suggestions would be greatly appreciated. 回答1: I was once very strongly against using Interface Builder in my own projects. This was due to a number of factors. I started first working with the Xcode tools when the

How to access IBOutlets declared in superclass?

。_饼干妹妹 提交于 2019-12-18 12:20:28
问题 I'm currently refactoring a couple of view controllers that share a few IBOutlet s and IBAction methods. I moved the outlet declarations and the IBAction method into a superclass, cutting these out of the subclasses. Now, when I open up Interface Builder, I find that I can't see the outlets or actions declared in the superclass. The connections still exist, as I'd wired them up before the refactoring, but they're grayed out. (It's important to note that the connections also WORK, as my action

applicationDidFinishLaunching not invoked

落花浮王杯 提交于 2019-12-18 12:07:21
问题 In my appdelegate.m, the applicationDidFinishLaunching is not invoked. I have read that this is due to the fact my "Application"'s delegate is not properly connected, but I don't know how to connect it. What I do is right-clicking on Application from the XIB file, and drag the delegate outlet somewhere... but don't know where. Any help appreciated. Thanks ! 回答1: In your MainMenu.xib, make sure there's an instance of your AppDelegate class. To make one, drag a plain object (blue cube) into the

How to do Custom Fonts at design time in Xcode 6?

ぐ巨炮叔叔 提交于 2019-12-18 11:50:01
问题 It was explained in the WWDC 2014 videos that you can have Custom Fonts at designing time directly in Storyboard, but so far I only see the list of iOS fonts. Any help? 回答1: All you have to do is to drag and drop the font files to your Xcode project, then you can find the font in the Custom font list. You don't even have to have them included in your Application Plist. That makes things simpler. If you already had fonts added to Xcode 5.1 project, they will not show up in the custom fonts

Interface Builder - How to create a custom UIView with many subviews

戏子无情 提交于 2019-12-18 11:41:01
问题 How can I create a custom UIView (with many subviews, UITextFields etc) in interface builder? I don't want a viewController with NIB just a simple UIView, with lots of subviews, created in IB that I can then just alloc init and use, is this possible? 回答1: Yes, you can create a UIView in a nib -- when you create a view based nib, that's what you're creating, a UIView. There is no view controller (though often, you make a view controller the File's Owner of the nib). You would need to create a

Infinite loop when overriding initWithCoder

≡放荡痞女 提交于 2019-12-18 11:11:23
问题 I have a UIViewController with some controllers and some views. Two of these views (Grid Cell) are other nibs. I've got outlets from the Grid Cells to File's Owner, but they aren't loaded automatically. So I try to override GridCell.m 's initWithCoder . This starts an infinite loop. I know it's possible to just override initWithFrame and add the subview from code, but this is not what I want. I want to be able to move the view around in Interface Builder and have Xcode initialize the view

“Any” size class missing in Xcode 8

北慕城南 提交于 2019-12-18 11:06:18
问题 I'm a little confused when seeing the new interface builder's size class options in Xcode 8 beta. I used to build my apps' UI by first design them in "Any" size class and then do some custom adjustments in the other ones. Is the workflow supposed to be changed in this new version of Xcode? 回答1: The way to do this has changed slightly in the new version of Xcode. It should build for "any-any" automatically. Have a look at this WWDC video that I think explains it in detail. There is also a part