xib

How to open a new window on button click in Cocoa Mac Application?

家住魔仙堡 提交于 2019-11-30 06:24:34
问题 I want to know how to open a new window on button click in Cocoa Mac Programming. Help me. I am doing a mac application which needs to open a new mac window on particular button click. 回答1: If you want to create a separate class for New Window, these are the steps: Create a class which is a sub class of NSWindowController e.g. NewWindowController Create a window xib for NewWindowController class. On button click code as: NewWindowController *windowController = [[NewWindowController alloc]

One xib File with Multiple “File's Owner”s

爷,独闯天下 提交于 2019-11-30 04:43:23
I've got three different UITableViews, each in it's own view, accessed via tabs. All three tables would ideally share the same custom UITableViewCell class and .xib file. I started with one table, setting the class of the .xib to my custom class and the File's Owner of the .xib to the table's parent UIViewController, which works great. All of the custom view-related code is in the cell's class (background images based on a property set by the controller, custom cell height based on the number of lines a label requires based on a cell property set by the controller, etc.). The result is nice:

Xcode 4.2 , change the iPhone xib to iPad xib

跟風遠走 提交于 2019-11-30 04:05:47
I have created the project which consists of 5 xibs. When I try to run the project in the iPad simulator . Some of the Xibs are coming in the iPhone screen size. I want to convert those iphone xibs which will support the iPad Xib screen size. Any idea how to do it ? NOTE: I want to support both the iPhone and iPad You can convert iPhone xib into iPad xib using following step. Right click the file (in xcode) and Open As > Source Code The 2nd line should look like: <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> Replace with: <archive type="com.apple.InterfaceBuilder3

Loading ViewController from xib file

旧街凉风 提交于 2019-11-30 02:58:37
I had a MyViewController.swift and a MyViewController.xib presenting the layout of MyViewController. I tried different methods to load this view controller including: //1 let myVC = UINib(nibName: "MyViewController", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as? MyViewController //2 let myVC = NSBundle.mainBundle().loadNibNamed("MyViewController", owner: self, options: nil)[0] as? MyViewController //3 let myVC = MyViewController(nibName: "MyViewController", bundle: nil) The third one is the only successful initialisation, but the previous two are causing error: Terminating app

Add a ContainerView inside a UIViewController created from .xib

放肆的年华 提交于 2019-11-30 00:23:49
问题 I have a .xib file and i want to add it a container view (to place inside a ViewController). Unfortunately a container view is only disposable by storyboard. But when i create a .xib file and i search for the container view controller, i don´t found it. Can someone give me a tips how to achieve my task? 回答1: If you're using a xib instead of a storyboard , you can just add a plain UIView to the xib to act as a container. Then in code, add your childViewController's view as a subview of the

Can I use two xibs with one viewcontroller - re: porting to iPhone 5

吃可爱长大的小学妹 提交于 2019-11-29 22:25:36
I just submitted my first app to the app store ( yay it was just approved! ). I now want to update it to work with (look nicer on) the larger iPhone 5 screen. I don't intend to change anything other than to change the layout a bit for the larger screen. NOTE: I don't want to have my current xib stretched. Is it possible to create two xib files (ie: copy my current xib file for the main screen) and hook them both into the view controller and have it so that when the app launches, the app detects if there is an iPhone 5 screen or an earlier screen. Then, depending on which device it is, show the

How can I extract all localizable strings from all XIB files into one file?

匆匆过客 提交于 2019-11-29 21:06:26
I am looking for a way of extracting all localizable strings from .xib files and have all of them saved in a single file. Probably this involves ibtool but I was not able to determine a way of merging all these in only one translation dictionary (could be .strings , .plist or something else). Open terminal and cd to the root directory of the project (or directory where you store all XIB files) and type in this command: find . -name \*.xib | xargs -t -I '{}' ibtool --generate-strings-file '{}'.txt '{}' The magic is the find and xargs commands working together. -I option generates placeholder.

iAd — cannot click banner

浪尽此生 提交于 2019-11-29 20:50:55
问题 I am creating a universal-app template. This template will need to support optional iAds, and optionally all orientations. I coded up a solution only to find a bizarre bug. in certain situations I was unable to click on the banner I then recoded another revision, tidied everything, and gutted out most of the code to reveal a minimal test case failure. https://github.com/p-i-/iAdUniversalTemplate/commit/2c829d268a9452e1a054802e7ccb9cde5de17853 In this new code, only 3 views: window, uberview

Developing same UI for 3.5, 4.0 (updated 4.7 and 5.5) inches screens in Xcode 5.0.1 (updated xcode 6), no landscape, no iPad and no storyboard

心不动则不痛 提交于 2019-11-29 20:31:40
I have developed app considering 3.5 inch with .xib files and not storyboard. I am unable to find any tutorial or guide which will help me in designing app similar for all screens. I am using Xcode 5.0.1 I am developing only plain app with no auto layout and only for iOS 6 and iOS 7 (IPhone). Below is the screenshot how it differs on different screens. A. IPhone iOS 6 simulator: B. 3.5 Inch (Ios 6 and Ios 7) C. 4.0 Inch (Ios 6 and Ios 7) Update: Please update below answers to also know 4.7 and 5.5 inches screen. If you want check it Programmatically : FOR Swift extension UIDevice { var iPhoneX

Text search though all .xib files in Xcode?

梦想与她 提交于 2019-11-29 18:59:46
This seems like such a basic task, but I'm stumped. How, in Xcode, do you execute a textual search though (the XML contents of) all the .xib files in a project? For example, all of our .xib files contain this string on the second line: com.apple.InterfaceBuilder3.CocoaTouch.XIB . So I'd think that searching all project files for that string would return all .xib files, but Xcode insists "0 occurrences". I've double checked that the Project Find Options look correct. I must be missing something obvious. (Or Xcode is somehow hard-coded to skip .xib files.) I'm trying to find all the .xib files