nib

nib2objc: command not found

邮差的信 提交于 2019-12-11 05:14:24
问题 I've been trying to convert NIB files to Objective C code. I found the project NIB2OBJC on GitHub: https://github.com/akosma/nib2objc but when I type the command line: nib2objc tab.xib > tab.m I got the following error: -bash: nib2objc: command not found Could you tell me what am I missing? Thanks 回答1: If you're in the folder where nib2objc is located, then you've to run ./nib2objc . Otherwise, if it's located in /bin/ , /usr/bin/ or any other folder in $PATH , then make sure that it has

Loading a table view nib after button push

不问归期 提交于 2019-12-11 04:18:27
问题 I have used the following code to add a button to my navigation bar that when pressed will call the method showCountries: UIBarButtonItem *countriesButton = [[UIBarButtonItem alloc] initWithTitle:@"Countries" style: UIButtonTypeRoundedRect target:self action:@selector(showCountries:)]; self.navigationItem.leftBarButtonItem = countriesButton; [countriesButton release]; Now this works, the button appears and when pressed goes to the showCountries method as planned. What the show countries

Invalid nib registered for identifier

我的梦境 提交于 2019-12-11 03:07:22
问题 I'm trying to get a view created in a nib file to be used as a section header in my UITableView. I'm following the 3rd option as described here http://hons82.blogspot.it/2014/05/uitableviewheader-done-right.html But I'm getting this error *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'invalid nib registered for identifier (sectionHeaderIndentifier) - nib must contain exactly one top level object which must be a UITableViewHeaderFooterView instance'

iPad app crashes on loading nib only on device not in simulator

大憨熊 提交于 2019-12-11 03:07:16
问题 I know this question has been asked before and I spent a lot of time following the suggestions in various threads, not just on this site, but to no avail. I'm developing an app for the iPad which consists of multiple views. Each one of these views contains a UITableView. Some of the TableView cells contain custom cells implemented with a UITableViewCell. The problem now is that I can run my app without problems on the iPad Simulator but not on the actual device. On the device - as soon as I

Is it possible to unit test a WindowController thats initialised with a nib?

梦想的初衷 提交于 2019-12-11 02:27:18
问题 I have a simple Mac OS application that comes with the default MainMenu.xib . In there I have a second window for preferences and a PreferencesWindowController . I'd like to get the following test working: @implementation TestPreferencesWindow - (void)testProtectsUserPasswordByUsingAPasswordField { PreferencesWindowController *controller = [[PreferencesWindowController alloc] initWithWindowNibName:@"MainMenu"]; XCTAssertInstanceOf([[controller passwordField] class], NSSecureTextField); } @end

iOS - Support iPad & iPhone without using nib

百般思念 提交于 2019-12-11 01:54:35
问题 I'm trying to write an app without using nib , everything I'll do it programmatically. Now the problem is, how am I going to support both iPad and iPhone ? Obviously, I can't do it with if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { // load iPad nib } else { // load iPhone nib } If I create 2 ViewControllers , then the IBAction will be redundant. Any suggestion? 回答1: You should probably just figure out the device type in applicationDidFinishLaunching and then

QLPreviewController crashing when tapping share button, internal consistency nib bundle error

戏子无情 提交于 2019-12-11 01:36:33
问题 I'm presenting a QLPreviewController modally. Everything works-- it pops up, shows the preview item and everything. However, once the share button is tapped, the app crashes on the device and in the simulator with this: 2013-05-03 20:10:53.563 appname[16860:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle <{{app_path}}> (loaded)' with name '_UIDocumentActivityViewController'' Here is the relevant code:

Subviews for custom UIView with Nib (.xib) don't load?

别说谁变了你拦得住时间么 提交于 2019-12-11 01:18:06
问题 I am trying to create a custom UIView class with an associated Nib (.xib) file to help with layout and creation. Right now, no subviews in my custom view appear, even though they exist in my nib file and are hooked up properly to my custom view class via IBOutlets. I tried going through the following other answer: Load custom UIView with XIB from a View Controller's view using IB and this one: How do I get a view in Interface Builder to load a custom view in another nib? and this one: http:/

Custom view with nib as subview doesn't seem to be loading

こ雲淡風輕ζ 提交于 2019-12-10 21:02:34
问题 I've created a custom view that loads its content from a nib, like this: /* PricingDataView.h */ #import <UIKit/UIKIt.h> @interface PricingDataView : UIView { UIView *contentView; } @property (nonatomic, retain) IBOutlet UIView *contentView; @end /* PricingDataView.m */ #import "PricingDataView.h" @implementation PricingDataView @synthesize contentView; - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { [[NSBundle mainBundle] loadNibNamed:@"PricingDataView" owner

Single View controller with multiple nibs?

安稳与你 提交于 2019-12-10 12:54:41
问题 I am trying to construct a view controller that can be 'skinned' -- that is, have multiple appearances or personalities but that uses a single controller. Each view will have the same buttons, etc, but I would like to be able to load each nib file (skin) into the same view controller. I can create multiple nib files, but I don't see how to connect the buttons, and actions. Can I specify the same 'file's owner' for multiple nib files? (HOW?). Can this be done? 回答1: This is totally possible.