xib

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

非 Y 不嫁゛ 提交于 2019-12-18 11:44:46
问题 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

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

懵懂的女人 提交于 2019-12-18 10:29:32
问题 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

Localizing a modern xib-based Mac application

久未见 提交于 2019-12-18 10:14:12
问题 Ours is an open-source Mac application localized by volunteers. These volunteers will do their work on special localization builds of the software (with unstripped nibs), then send us the changes to integrate into the original xib and strings files. The problem is that, while there is a way to integrate string changes without blowing away previous size changes, I can't see a way to integrate new string and size changes (as when we add or replace views). The only way to do both that I can see

Swift TableViewCell xib doesn't have constraints

爷,独闯天下 提交于 2019-12-18 07:16:20
问题 I have two TableView s, when I designed the original I designed it using the prototype cell in the storyboard, to make it reusable I tried to pull it out into a .xib and load that instead. When it is loaded from cellID.xib however it loses all the constraints at runtime, and everything is layered on top of each other. TableViewController let cellIdentifier = "cellID" override func viewDidLoad() { super.viewDidLoad() tableView.register(UINib(nibName: cellIdentifier, bundle: nil),

Load different xib files on Orientation in iOS

旧时模样 提交于 2019-12-18 07:14:48
问题 I have created two .xib file one for portrait mode and other for landscape mode, on each rotation i want to load respective .xib file, Here is my code snippet, ViewAppDelegate.m class - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; if ([UIApplication sharedApplication].statusBarOrientation==UIInterfaceOrientationPortrait | [UIApplication

How does Xcode decide which XIB to show first

有些话、适合烂在心里 提交于 2019-12-18 04:14:09
问题 When I create a new cocoa project in Xcode, it creates a MainMenu.xib file with a Window. I would like to separate the window into a MainWindow.xib and have that show up as the main window - how do I do that? If I create a 'document' based application - I see two xibs (MainMenu.xib and MyDocument.xib) and I notice that MyDocument.xib gets displayed right away - but I don't understand where this is identified. There doesn't seem to be explicit code and I'm not sure where to look in the plists.

Unable to use iOS framework which is internally using .xib file

喜欢而已 提交于 2019-12-18 04:02:42
问题 I am trying to make a universal framework, for iOS by following steps specified in this URL: Universal-framework-iOS I have a viewController class within, that framework which internally loads a .xib file. Below is a part of code which shows, how I am initializing that viewController and showing related view: /*** Part of implementation of SomeViewController class, which is outside the framework ***/ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view,

Xcode 4.5 corrupting XIBs?

本秂侑毒 提交于 2019-12-17 23:02:43
问题 i am using the new xcode 4.5, i have this lines of code on some view controller: DiscoverCell* cell=[table dequeueReusableCellWithIdentifier:@"DiscoverCell"]; if(cell==nil){ NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"DiscoverCell" owner:self options:nil]; cell = [nib objectAtIndex:0]; } when i run the app its throwing: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The NIB data is invalid.' on the LoadNib line, what is that? does this xcode is

Swift - “use of unresolved identifier”

时间秒杀一切 提交于 2019-12-17 16:58:27
问题 I am studying Swift! I want create Main interface on xib. But have error "use of unresolved identifier". Add code from MainViewController import Foundation public class MainViewController : BaseViewController { override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) // TODO: Write your test code here // ... } } UPD:(Add image) 回答1: 1) Right Click your MainViewController.swift 2) Select Show File Inspector 3) On Right side panel, look at Target Membership 4) Add your

Create UICollectionViewCell subclass with xib [duplicate]

三世轮回 提交于 2019-12-17 15:47:24
问题 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'm trying to create a UICollectionViewCell subclass with linked a xib, I have do this: I have create a new xib file and I have add a UICollectionViewCell in it, then I have create this subclass file: @interface MyCell : UICollectionViewCell @property (weak, nonatomic) IBOutlet UILabel *label; @end