xib

Is it possible to use IBDesignable with UICollectionViewCells and live render them in storyboard?

假如想象 提交于 2019-12-10 13:56:08
问题 I know how to use @IBDesignable with custom views. but is it possible to use IBDesignable for cells and render them in storyboard? for example: i have a collectionViewController in storyboard, and added a uiCollectionCell and specified class as my customCellClass. p.s: i know for using Xibs in collecionViews and tableViews we have to call method registerNib:forReuseIdentifer in code (and i am doing it). just wondered, is it possible to see it's rendered view in storyboard or not. p.s2: i

iOS, unrecognized selector sent to instance?

会有一股神秘感。 提交于 2019-12-10 13:17:17
问题 I got a mainscreen with a imported custom actionBar. I created this actionBar in a separate .xib file, with a .m and .h file. I do some graphic setup in my actionBar.m's viewDidLoad like backgroundColor and some other stuff. I also got a button on this actionBar i linked the way i usually link buttons, with a IBAction . I load my actionBar into my mainscreen like this: ActionBarWithLogoff *actionBar = [[ActionBarWithLogoff alloc] initWithNibName:@"ActionBarWithLogoff" bundle:nil]; [topBar

Best way to change XIB files based on rotation? [closed]

前提是你 提交于 2019-12-10 12:33:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . My app has so far just been a portrait-based application. However, I am adding landscape mode to a new version, but have found that my XIB files look shocking when rotated from portrait to landscape. Apparently I need to make a landscape version of each XIB and use some code to

2 XIB and 1 viewcontroller but functions don't work in the ipad XIB

不打扰是莪最后的温柔 提交于 2019-12-10 11:48:23
问题 I believe that I did everything necessary to change my app for ipad (was for iphone at start). I can toggle the build status to either iphone (only), ipad (only) or iphone/ipad - and the app launches either in ipad or iphone simulator. I can do that forth and back at will. I added the idiom to check for ipad and basically for one of my xib, instead of using the string of my xib to create the controller, I use the one for the ipad. So it is a new xib for ipad with all same graphical objects (

Cocoa - loading a view from a nib and displaying it in a NSView container , as a subview

馋奶兔 提交于 2019-12-10 10:56:14
问题 I've asked about this earlier but the question itself and all the information in it might have been a little confusing, plus the result i want to get is a little more complicated. So i started a new clean test project to handle just the part that im interested to understand for the moment. So what i want, is basically this: i have a view container (inherits NSView). Inside, i want to place some images, but not just simple NSImage or NSImageView, but some custom view (inherits NSView also),

Localization strings file not working with xib in Xcode 5

十年热恋 提交于 2019-12-10 05:31:58
问题 I have the following file structure for localization. A.xib ->A.xib (Base) ->A.strings (Spanish) ->A.strings (English) Since it is "Use Base Internationalization". We can expect to have only one xib file and required strings file for the localization. But, soon as i convert this strings file to .xib (where for each language we have .xib file. This was the case before Base Internationalization). Things start working the iOS simulator and device responds to such changes. Note:- I had also tried

UIViewController IBOutlets are nil

百般思念 提交于 2019-12-10 03:28:22
问题 I have an UIViewController class with two labels and a UIImageView set as IBOutlets, and I have this outlets connected in my xib, I have double checked they are connected properly, however when I check the their value in the debugger they are 0x0 so I cant change them programatically. Any ideas on what I might be doing wrong. Heres the header file of my code: #import <UIKit/UIKit.h> @interface PlateDetailViewController : UIViewController { IBOutlet UIImageView *image; IBOutlet UILabel *price;

Initializing a view with custom initWithCoder

拥有回忆 提交于 2019-12-10 02:55:26
问题 In order to initialize a view that has xib, I use initWithCoder function. But what if I need to initialize the xib with custom parameter. I need something like this: - (id)initWithCoder:(NSCoder *)aDecoder andTitle:(NSString *)titleString { self = [super initWithCoder:aDecoder]; if (self) { self.titleLabel = titleString; } return self; } And when do I call it? After awakeFromNib ? 回答1: You can't modify the initWithCoder: method like that because the method is defined in a protocol you don't

iOS: Auto Layout vs autoresizingMask - resizing whole view to fill?

梦想的初衷 提交于 2019-12-09 13:01:18
问题 I've got a storyboard which is built using Auto Layout. Within that storyboard, I'm embedding a UIViewController subclass ( ButtonGridViewController ) in several locations, each of which is a different size. ButtonGridViewController 's view is defined in a xib. What I need is for the entirety of the ButtonGridViewController 's view to simply scale-to-fill the view I'm embedding it in. With the old struts-and-springs method, this was trivial -- just set all the subviews to resize in both

Where to put .xib file inside framework project?

不羁岁月 提交于 2019-12-09 10:05:17
问题 I lost half a day figuring this and I can't see a straight forward solution online. I created an iOS CocoaTouch Framework. I have some private and public classes in it and it all works fine. The problem is when I add .xib file inside that framework . Inside my framework I want to instantiate .xib file and the error I am getting is: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/dino/Library/Developer