xib

IBOutlets not being set EXCEPT when creating throwaway variables during initWithNibName:bundle:

你说的曾经没有我的故事 提交于 2020-02-08 06:25:26
问题 Let me first say that I've searched Google and, although many have similar issues, I haven't seen anything with the following bizarre behavior and remedy. I've created a UIViewController and associated nib with several IBOutlets. On trying to consume this nib from another class, I discovered that after instantiating it with initWithNibName:bundle:, the IBOutlets are still nil. I confirmed that they are correctly wired up, and yes, they are being synthesized, but still nothing. While

IBOutlets not being set EXCEPT when creating throwaway variables during initWithNibName:bundle:

萝らか妹 提交于 2020-02-08 06:25:05
问题 Let me first say that I've searched Google and, although many have similar issues, I haven't seen anything with the following bizarre behavior and remedy. I've created a UIViewController and associated nib with several IBOutlets. On trying to consume this nib from another class, I discovered that after instantiating it with initWithNibName:bundle:, the IBOutlets are still nil. I confirmed that they are correctly wired up, and yes, they are being synthesized, but still nothing. While

iOS7 XIB issue. blank space at top and bottom

╄→尐↘猪︶ㄣ 提交于 2020-02-02 01:32:51
问题 I am having a view on which I am setting an ImageView. Auto layout is checked. It looks good in the preview, but when app actually runs on the simulator, there is blank space is showing at the top as well as bottom only in the iPHone retina 4 inch simulator. on 3.5 inch it looks fine. Using iOS7 and XCODE 5. Even though i removed image from view, still there is the same problem. What can be reason for this blank space ? 回答1: I think are you Forget to adding splash screen Default-568h@2x.png

Hide tab bar item and aligning other tab items

旧城冷巷雨未停 提交于 2020-02-01 04:39:08
问题 In my app, i have 4 tab bar items. Iam adding these 4 tab bar items in XIB file. Initially i have to show 3 tab bar items and after sync i have to show 4th tab bar item in my app. So for this, i am hiding 4th Tab bar item using following code. [[[self.tabBarController.tabBar subviews] objectAtIndex:03 setHidden:YES]; The tab item is hiding but i am having blank space in place of the hidden item. Is there any chance to align other 3 items in full tab bar. The thing is i dont want to show blank

How to load a `.xib` / `.nib` file within a framework?

痞子三分冷 提交于 2020-01-30 12:26:09
问题 I'm working on an iOS library as a Cocoa Pod. In this library, I have a custom view: @interface PlayerView : UIView @property (strong, nonatomic) IBOutlet UIView *contentView; @end @implementation PlayerView - (instancetype) initWithCoder:(NSCoder*)coder { self = [super initWithCoder:coder]; [self initialize]; return self; } - (instancetype) initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; [self initialize]; return self; } - (void)initialize { [[NSBundle mainBundle]

Added, then deleted a ~ipad.xib. Now NSInternalInconsistencyException when running on iPad

南楼画角 提交于 2020-01-23 17:19:47
问题 In an attempt to convert an iPhone app to a universal app, I added a MyViewController~ipad.xib to my project. I also set the Targeted Device Family to iPhone/iPad. I then attempted to undo those changes--deleted the MyViewController~ipad.xib and set Targeted Device Family to iPhone only. Now, I can run on iPhone (as always), but not on iPad (which I could do before). I now crash with the following error: "'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed

Added, then deleted a ~ipad.xib. Now NSInternalInconsistencyException when running on iPad

非 Y 不嫁゛ 提交于 2020-01-23 17:19:08
问题 In an attempt to convert an iPhone app to a universal app, I added a MyViewController~ipad.xib to my project. I also set the Targeted Device Family to iPhone/iPad. I then attempted to undo those changes--deleted the MyViewController~ipad.xib and set Targeted Device Family to iPhone only. Now, I can run on iPhone (as always), but not on iPad (which I could do before). I now crash with the following error: "'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed

Xib taking long time (>1s) to load. UIFont cache seems to blame

北战南征 提交于 2020-01-22 13:53:29
问题 I have a UIVC loading from a Storyboard which, in turn, loads a Xib. This inner load is causing the VC to take more than a second to load. There is some fancy footwork going on in the inner xib (it loads another xib which has dynamic drawing) but this doesn't appear to be the bottleneck. According to Instruments, UIFont -initWithCoder is the culprit. (If you drill down further TBaseFont::CopyLocalizedName() is the deepest entry that accounts for the majority of the 1s time) I'm a bit stumped

xcode8.1:invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug

喜夏-厌秋 提交于 2020-01-22 13:04:11
问题 I write the code below: JSImgDeleteCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:displayCellID forIndexPath:indexPath]; and before use it,I registered it: [_displayImgCollectionView registerNib:[UINib nibWithNibName:displayCellID bundle:nil] forCellWithReuseIdentifier:displayCellID]; it is allright in xcode7.3, but when I run this in xcode8.1,there is sth wrong,the msg like this: invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break

xcode8.1:invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug

三世轮回 提交于 2020-01-22 13:03:07
问题 I write the code below: JSImgDeleteCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:displayCellID forIndexPath:indexPath]; and before use it,I registered it: [_displayImgCollectionView registerNib:[UINib nibWithNibName:displayCellID bundle:nil] forCellWithReuseIdentifier:displayCellID]; it is allright in xcode7.3, but when I run this in xcode8.1,there is sth wrong,the msg like this: invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break