xib

How to close a window programmatically in Cocoa Mac?

帅比萌擦擦* 提交于 2019-12-20 10:41:32
问题 How can I programmatically close a window in cocoa mac ? I have opened a second window/xib from the first window/xib using button click. I need to close the first window/xib programmatically on opening or clicking the button. How can I do that? 回答1: Apple has some useful sample code on Nib Loading. It doesn't directly address this question however; the following code does. @interface CloseWindowAppDelegate : NSObject <NSApplicationDelegate> { NSWindow *window; IBOutlet NSWindow * secondWindow

How to disable Interface Builder document versioning from auto updating?

孤街醉人 提交于 2019-12-20 10:30:05
问题 This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar Viewing a nib / xib, modifies the file, forcing me to either commit the change or undo the change. This is not an issue, until there are merge conflicts. Detail: I work in a team of 5 iOS developers, and the last few versions of XCode, we are experiencing an issue with the .xib / nib files getting touched / modified when anyone opens the file

Xcode: Run project with specified localization

雨燕双飞 提交于 2019-12-20 08:19:02
问题 My Cocoa project is localized in Italian (my language) and English language. If I run it, i see everything in Italian (of course, my OS is italian!). How can I run it to test the English localization without changing the OS language? 回答1: In the old times, Leopard and before, the get info window in Finder would let you choose the available languages. So it was a matter of deselecting the language that you don't want to use and it would "default" to the other. These days you can use an utility

Xcode adds a lot of <animations/> tag in my storyboard and xib file

妖精的绣舞 提交于 2019-12-19 12:25:11
问题 Just wanna know if anybody has the same issue as mine: Xcode adds a lot of tags into the storyboard I touch. I try to remove but I can't because it keep adding those tags back. It this a bug of the new Xcode I'm using (7.0.1)? 回答1: As of Xcode 7.2 Beta (7C46I) released on 10/28/2015, just like these tags were added automatically when opening a Storyboard or XIB file in Xcode 7 or 7.1 on El Capitan, these tags are now being removed automatically by just opening a Storyboard or XIB file. (It

iPhone Interface Builder - Moved resources to sub-directory, now IB can't see them!

假如想象 提交于 2019-12-19 09:22:00
问题 I had a bunch of images in my Xcode project. They were originally added without choosing "Create Folder References for any added folders". So I removed the references and re-added as per these instructions Include a resource directory hierarchy into app bundle Unfortunately, Interface Builder will not display any of the images inside that directory. On the project tree the directory comes up with a blue icon and all the files are there! The file names show in the IB Inspector (i.e. under the

Subclassing a subclassed UIViewController that has a xib

痞子三分冷 提交于 2019-12-19 06:16:31
问题 I need to have a few UIViewControllers that look very similar yet have different behaviours, so I thought I'd make a general UIViewController subclass with a xib, then subclass it when I need to, for those different UIViewController's that look alike. I'm trying to achieve the following UIViewController subclass (that has a xib file associated) -> and being able to subclass it as many times as i'd like (without additional xib files for the children) what I've done so far : xib file represents

Subclassing a subclassed UIViewController that has a xib

和自甴很熟 提交于 2019-12-19 06:16:08
问题 I need to have a few UIViewControllers that look very similar yet have different behaviours, so I thought I'd make a general UIViewController subclass with a xib, then subclass it when I need to, for those different UIViewController's that look alike. I'm trying to achieve the following UIViewController subclass (that has a xib file associated) -> and being able to subclass it as many times as i'd like (without additional xib files for the children) what I've done so far : xib file represents

Adding border with width to UIView show small background outside

混江龙づ霸主 提交于 2019-12-19 04:25:18
问题 I'm trying to add circle border to a UIView with green background, I created simple UIView subclass with borderWidth, cornerRadius and borderColor properties and I'm setting it from storyboard. @IBDesignable class RoundedView: UIView { @IBInspectable var cornerRadius: CGFloat { get { return layer.cornerRadius } set { layer.cornerRadius = newValue layer.masksToBounds = newValue > 0 } } @IBInspectable var borderWidth: CGFloat { get { return layer.borderWidth } set { layer.borderWidth = newValue

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

Objective C, Thread 1 Program Received Signal SIGABRT [duplicate]

老子叫甜甜 提交于 2019-12-18 14:23:13
问题 This question already has answers here : Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error? (68 answers) Closed 4 years ago . I am trying to compile and run a simple tutorial for an Objective C app using Interface Builder. I am using Xcode 4.0.2 and simulating on iOS (iPhone) 4.3 http://www.switchonthecode.com/tutorials/creating-your-first-iphone-application-with-interface-builder When I build the project, it builds alright