interface-builder

'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the GameView nib but the view outlet was not set

南笙酒味 提交于 2019-12-17 20:43:50
问题 This is not the same situation as the multitude of other similar questions here. * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the GameView nib but the view outlet was not set.' You might be thinking "do as it says, connect the File's Owner to the View in IB!". But the thing is, I don't even HAVE a GameView.xib in my project or even in the project directory. I do have a "GameViewController.m"

start position of table view is wrong in simulator, and is not the same in storyboard

本秂侑毒 提交于 2019-12-17 20:30:05
问题 I created a tableview in storyboard, which looks good, but the start position is wrong in the simulator or device. The 'Label' should not be at the same position as the time. How could I solve it?? 回答1: Simulated metrics are just that. Simulated. They're useful to set to how the view will actually display in order to help set up the look in the storyboard, but whether or not a navbar or tabbar shows up in the actual program is irrelevant to whether or not you've selected it as a simulated

Trouble with loading a separate XIB for iPad or iPhone

余生颓废 提交于 2019-12-17 19:13:09
问题 Im having trouble figuring out how to load a separate XIB for iPad or for iPhone in a Universal app. Its easy enough to convert the Xcode project to Universal and have separate Main view interfaces. My problem is the secondary view and getting it to have separate interfaces for both iPad and iPhone. Please offer any help you can give as I have been working on this issue for days without success. Thanks in advance! 回答1: I know that @indragie's answer is a very common one, but it's a common

Using xib object inside another xib

﹥>﹥吖頭↗ 提交于 2019-12-17 18:36:44
问题 I'm designing using IB a specific button (with some labels,and imageView and other stuff). I would like then to use that xib object (the button) in another xib, where I have 6 objects of that button. I know I can do that programmatically using the Class Identifier, but then I have to position my lables and image view, and set the default values and everything else in code. I'm wondering if it's possible to do the same thing using just the IB ? (of course I would still set the values in code,

Interface Builder, @IBOutlet and protocols for delegate and dataSource in Swift

和自甴很熟 提交于 2019-12-17 18:22:17
问题 Can't connect delegate property of CustomView declared as @IBOutlet to ViewController in Interface Builder – simply can't establish a connection. Here's the code class CustomView: UIView { @IBOutlet var delegate: CustomViewDelegate? } @objc protocol CustomViewDelegate { ... } class ViewController: UIViewController, CustomViewDelegate { ... } @objc is used because of swift protocol, IBOutlet property cannot have non-object type, don't know why protocol CustomViewDelegate: class {} doesn't work

Loading custom UIView from nib, all subviews contained in nib are nil?

末鹿安然 提交于 2019-12-17 17:30:03
问题 I have a custom UIView object with a nib that defines the view/subview layout. My outlets are connected, and when I init the object from initWithFrame: everything is in order. The problem I'm having is when I'm using IB to embed the UIView into another nib; the custom UIView appears, but none of the subviews it contains appear - in fact their symbols all resolve to nil. I have a very minimal initWithCoder: and awakeFromNib: implementation (just does logging) and my understanding is that as

NSViewController and multiple subviews from a Nib

你。 提交于 2019-12-17 17:28:30
问题 I'm having a difficult time wrapping my head around loading views with Interface Builder and NSViewController. My goal is to have a view which meets the following description: Top bar at the top (like a toolbar but not exactly) which spans the entire width of the view, and a second "content view" below. This composite view is owned by my NSViewController subclass. It made sense to use Interface Builder for this. I have created a view nib, and added to it two subviews, laid them out properly

How can I create Yosemite-style view with translucent/blurry background?

空扰寡人 提交于 2019-12-17 17:27:10
问题 In Yosemite sidebars have a semitransparent "vibrant" background. How can I create a view like that in 10.10/Xcode 6? Can I give any view such background? I've found that NSOutlineView will default to such background when you give it "Source list" highlight style, but the sidebar in the Calendar.app doesn't appear to be an NSOutlineView, so I wonder if there's a generic solution for this. 回答1: With the introduction of the Yosemite version of the OSX operating system, Apple introduced a new

Failed to render instance of IB Designables

天涯浪子 提交于 2019-12-17 17:26:22
问题 I have an Objective-C and Swift mixed dynamic framework. And the mixed framework was linked with two pure Objective-C dynamic frameworks. When I tried to mark any class in the mixed framework with IB Designable and using that class in either storyboard or nib, the Xcode always says the instance of it was failed to render. And there was the error message: IB Designables: Failed to render instance of WZUITokenField: dlopen(WZUIKit.framework, 1): Library not loaded: /Library/Frameworks

Do I have to call addSubview after calling addChildViewController?

纵饮孤独 提交于 2019-12-17 17:25:44
问题 I'm trying to create a container view controller using iOS5 and new methods like addChildViewController . Do I have to call addSubview after calling addChildViewController ? Do I have to call removeFromSuperview before calling removeChildViewController ? I don't see anything about this in Apple docs. What do you think? 回答1: Short answer: "Yes, and yes." The view hierarchy and the view controller hierarchy are still independent. The containment API simply allows views from other controllers to