nib

Endless recursive calls to initWithCoder when instantiating xib in storyboard

冷暖自知 提交于 2019-12-19 08:04:21
问题 In order to re-use a certain subview throughout my application (which is storyboard based), I decided to build the subview as a nib, and load it in. To do this, I have done the following: I have a UIView subclass we can call Widget. I create a corresponding xib file, set the File owner property to my new subclass, hook up the IBOutlets. Then, in my storyboard, I have a uiview inside of a view controller, and I set its class to the Widget class I created. Within the widget class, I override

Could not load “my-icon.png” image referenced from a nib (iPhone)

折月煮酒 提交于 2019-12-19 03:39:13
问题 I am receiving the following error message: 2011-02-11 14:47:13.815 myProject[13177:207] Could not load the "icon-troubleshoot.png" image referenced from a nib in the bundle with identifier "com.myCompany.myProject" This file is an old file that was being used before, but has now been deleted. As far as I know icon-troubleshoot.png is not used anywhere in my project. I tried cleaning and rebuilding, emptying caches but it didn't work. Searching for the string troubleshoot as a textual

Adding constraint to a UITableVIew headerview

不想你离开。 提交于 2019-12-19 03:23:08
问题 So I'm new to the constraints. I've a nib file which contains multiple Views as siblings. The ViewController's view contains a tableView and I've another view which is going to be added to the tableHeaderView (let's call it self.tableHeaderView). The problem i'm facing is that I want to resize the self.tableHeaderView based on certain conditions. I've added constraints to all of my UI elements and I can't, for whatever reason, add a height constraint to the self.tableHeaderView via the nib. I

Setting .reuseIdentifier on a UICollectionViewCell

孤街醉人 提交于 2019-12-18 06:14:44
问题 I have a particular UICollectionViewCell that I want to instantiate myself , and add to a UICollectionView . In order for this to work, the UICollectionViewCell instance needs its .reuseIdentifier property to be set. Normally, the class or Nib that describes the cell is registered with the collection view, and the collection view instantiates the cell with its .reuseIdentifier already set, with these methods: - registerClass:forCellWithReuseIdentifier: - registerNib:forCellWithReuseIdentifier

Setting .reuseIdentifier on a UICollectionViewCell

别说谁变了你拦得住时间么 提交于 2019-12-18 06:14:06
问题 I have a particular UICollectionViewCell that I want to instantiate myself , and add to a UICollectionView . In order for this to work, the UICollectionViewCell instance needs its .reuseIdentifier property to be set. Normally, the class or Nib that describes the cell is registered with the collection view, and the collection view instantiates the cell with its .reuseIdentifier already set, with these methods: - registerClass:forCellWithReuseIdentifier: - registerNib:forCellWithReuseIdentifier

Loading a UIView subclass from NIB size issues

纵然是瞬间 提交于 2019-12-18 02:42:33
问题 I have a subclass of UIView that needs to calculates it's height according to it's width. When created in code everything works. However when I try to create the view in Interface builder, and although I override all related methods, I can't get the size of the view set in interface builder. - (id)initWithCoder:(NSCoder *)aDecoder { NSLog(@"init with coder before super width %d",super.frame.size.width); // returns 0 self = [super initWithCoder:aDecoder]; NSLog(@"init with coder after super

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

Could not load the “” image referenced from a nib

房东的猫 提交于 2019-12-17 22:11:44
问题 I have no images called "" (nothing). I've gone through the .xib file of the screen where this pops up and can't find anything that would cause this. Anybody who have had the same issue? Here is the full warning: Could not load the "" image referenced from a nib in the bundle with identifier "com.blah.Blah" 回答1: You can do this to check it from your storyboard, or nib. Open it as Source Code: Then "Find" the image name in it, see if it exists but already invalid in your project, probably you

Loaded the nib but didn't get a UITableView Exception

半腔热情 提交于 2019-12-17 22:02:28
问题 I'm trying to load a uitableview using ECSlidingViewController methods. When I call this code: UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UITableViewController* page = [sb instantiateViewControllerWithIdentifier:@"tableViewPage"]; CGRect frame = self.slidingViewController.topViewController.view.frame; self.slidingViewController.topViewController = page; self.slidingViewController.topViewController.view.frame = frame; [self.slidingViewController

How to remove programmatically a tab bar item created in parent class NIB file?

北战南征 提交于 2019-12-17 19:35:36
问题 Within my iPhone application I have a common tab bar with three tabs that is presented from several views after pressing a button. The approach I followed was the workflow of Tweetie application, described in Robert Conn post. Note that the main controller is a navigation controller; the tab bar is placed in a view controller's NIB file of the navigation stack, and the effect of switching between tabs is handled in a delegate didSelectItem method. @interface GameTabBarController :