nib

How to close a window (unload a NIB)?

跟風遠走 提交于 2019-12-10 10:15:45
问题 I have a custom NSWindowController subclass that loads a NIB file during initialization like this: self = [super initWithNibNamed:@"myNib"]; if (self != nil) { [self window]; } The nib contains some custom views and some other controls. The NSWindowController is the file's owner and at least one of the views even binds to it. Simply, what do I have to do to close and release that window? I spend the whole day trying to figure that out and I am still clueless. 回答1: You don't unload a nib;

Could not load nib in bundle base internationalization

半世苍凉 提交于 2019-12-09 19:41:56
问题 I have a project that I created in xcode 4.5 with a target ios of 5.0 and I used Base Internationalization. Base Internationalization moves the nib files to Base.lproj. The project runs on my iPhone 4 running ios 6 and on my iPad 3 running ios 6. But this error shows when I try to run it on my iPad 1 running ios 5.1.1. In the Build Phase section of the target, the nib files are shown in red. When I try to add the nib files to the Build Phases bundle resources, they add but they are still red

Issues with AutoLayout with Custom Views defined in NIB file and used in StoryBoard

好久不见. 提交于 2019-12-08 15:51:55
问题 I've defined a custom view in a NIB file and would like to instantiate a copy in a StoryBoard but I'm having issues with autolayout. In a simple example, the custom view has single label with a fixed size and centered both vertically and horizontally, all using autolayout. The file owner is set to my class, it has an outlet to the top view. In the custom view implementation I do: - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if(self) { [[NSBundle mainBundle]

How can I view an XIB from an app store app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 13:14:47
问题 I downloaded an app with nice design and unpacked it's contents. I'd like to look at the NIBs to see how the app is put together. I renamed the NIBs to XIB, but Interface Builder won't open them ("Interface Builder was unable to determine the type of PageView.xib"). Is there any way to force it to open the file. Would I be able to see anything without the original project? 回答1: Short answer: No. You can't just rename nib to xib, they are different formats. A nib is a package containing

A view loaded from the nib doesn't receive touch events

倾然丶 夕夏残阳落幕 提交于 2019-12-08 13:01:56
问题 I am trying to load a a view from the nib and add it to the main view. Here is my code. I loaded the nib in the initWithFrame of the @interface AddTaskView:UIView : - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { NSLog(@"init with frame"); // Initialization code NSArray *addTaskArrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"AddTaskView" owner:self options:nil]; self=[addTaskArrayOfViews objectAtIndex:0]; } return self; } After that I init the view and

Loading the Different Nib Files

南笙酒味 提交于 2019-12-08 11:06:10
问题 I created two nib files for the iPhone and iPad, so my app will be universal. I use this method to check if it is an iPad: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) but I don't know how to load the proper nib when it knows which it is. Does anyone know the correct method to load to nib file, accordingly? 回答1: Your interface files should be named differently so something like this should work. UIViewController *someViewController = nil; if (UI_USER_INTERFACE_IDIOM() ==

Is this a correct way of creating a universal iOS app? Xcode 4 - Seems to work?

冷暖自知 提交于 2019-12-08 05:18:45
问题 Here is how I made a universal app from an existing iPhone project by creating ~ipad.xib(s) using duplicate and then adding them back to a backup of the project, and checking universal. I used xcode 4.02 with a base sdk of 4.3.3 with a deployment target of 3.1.2. Back up your whole project somewhere. Right click on iPhone target and choose duplicate. Choose duplicate for iPad rather than just duplicate. This makes a new folder called Resources-iPad with a subfolder called classes under that,

UIViewController's initWithNibName: a reason behind this design?

故事扮演 提交于 2019-12-08 00:58:08
问题 I tend to agree with Joe Conway’s and Aaron Hillegass’s analysis, as reported today by Ole Begemann in http://oleb.net/blog/2012/01/initWithNibName-bundle-breaks-encapsulation/ Basically, they state that the NIB's filename is an implementation detail of the corresponding UIViewController class, and that it is not the business of the calling class to pass in the NIB's filename in the init method. I was wondering if there was any particular reason for this design choice from the creators of

Pyqtgraph with anaconda python on MAC gives nib error

淺唱寂寞╮ 提交于 2019-12-07 14:31:09
问题 I'm trying to use the pyqtgraph with anaconda python on Mac os Python 2.7.5 |Anaconda 1.6.1 (x86_64)| (default, Jun 28 2013, 22:20:13) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin I installed pyqtgraph with pip install pyqtgraph , which seemed to work fine. However, if I run any command from the library I get this error: Qt internal error: qt_menu.nib could not be loaded. The .nib file should be placed in QtGui.framework/Versions/Current/Resources/ or in the resources directory of your

Subclassed UIView from NIB File not typed to subclass

我的未来我决定 提交于 2019-12-07 08:41:08
问题 I have a NIB file, with some class (SomeClassView : UIView) set as the custom class of the top level view of the NIB. SomeClass has IBOutlets that I use to hookup subviews of SomeClass that I lay out in Interface Builder. I instantiate SomeClass like this: - (id)initWithFrame:(CGRect)frame { self = [[[[NSBundle mainBundle] loadNibNamed:@"SomeClassView" owner:nil options:nil] objectAtIndex:0] retain]; // "SomeClassView" is also the name of the nib if (self != nil) { self.frame = frame; }