xib

Changing view from xib to storyboard

孤街醉人 提交于 2019-12-06 16:53:05
I have a Storyboard project witch i need to have an xib file loading on startup, to show a login screen. Its based on a UIWindow and a view controller so i dont get it to work in storyboard. Anyways is there anyway that after this xib is loaded at start to push the view in to story board? the storyboard is Tabbarbased if i does any difference. Thanks. FaddishWorm I think this would solve your problem : How can I load storyboard programmatically from class? It is definitely possible. 来源: https://stackoverflow.com/questions/12025822/changing-view-from-xib-to-storyboard

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

若如初见. 提交于 2019-12-06 16:49:26
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:bundle:] loaded the "MyViewController" nib but the view outlet was not set.'" The view outlet in

Build xib Interface Builder and load them as subview in iphone

孤者浪人 提交于 2019-12-06 16:17:56
问题 what I would like to know if it's possible to build a view and its correspondent xib file. Then, in a generic controller, load this view programmatically and add as a subview to the current view. This subview should act as a generic info box which can be loaded by many controller. thanks Leonardo 回答1: I found solution myself, after looking at some stackoverflow thread. So I would like to share what I found and see if it's an acceptable solution. Basically this is what I did: create a MyView.m

Custom UIView from Xib - requirements, good practices

徘徊边缘 提交于 2019-12-06 16:09:11
问题 I'm trying to wrap my head around the topic of creating custom UIView using Xib files. I've done it many times, but I've never thought about why this process is so complicated , and which parts are necessary, which are good to have etc. And right now, because Xibs are the main component of the project I'm working on, I started questioning everything - I need to be sure what is happening 😉 Assume we've just created a simple UIView subclass - let's call it CustomView , and basic requirements of

Xcode: Copy files from one Project to another in same workspace

你。 提交于 2019-12-06 15:31:18
I am currently working on legacy code for an iPhone application. Someone has implemented a feature in the iPhone and now I am trying to implement it into iPad. To start with I have decided to drag the files from the iPhone project into the iPad and get it working. Then I am going to find a solution where by both projects can share the same code. However I have copied the files from the iPhone project into the ipad project and have a problem with the xib. The outlets are still referencing the iPhone version. So when I remove the IBOutlets from the iPad version the connections still remain

Xcode 7 - Cannot open document (storyboard file)

南楼画角 提交于 2019-12-06 14:19:21
I recently updated to Xcode 7 and as usual something has to go wrong. Its really a shame because I was looking forward to the new features in Xcode 7. I am faced with a an error which I cannot seem to fix. Every time I try and build the project I get the following error: I thought there was something wrong with my project, so I made a new Single View application and I still get the same error. I have tried the following things but none of them has worked for me: Restart Xcode (Didn't work). Clean and rebuild project (Didn't work). Restart Mac (Didn't work). Reinstall Xcode 7 from the Mac App

XIB文件上UIScrollView的约束

感情迁移 提交于 2019-12-06 13:47:26
昨天开始做公司项目APP的多屏幕适配,之前都是按照iPhone5的大小强行拉伸的.很不美观. 适配过程中发现好多页面用的都是滚动视图,加约束过程中出现了问题.经过搜索才发现UIScrollView因为ContentSize的原因,并不能很方便的给其上的控件添加约束.经过查阅资料和实践,选择了一个方便的处理方法: 给UIScrollView添加一个唯一的view,控件全部放在view上. 开始添加约束: UIScrollView上下左右都是0; 给其上的view也是上下左右都是0; 如果滚动视图是上下滑动,给view添加 Horizontal Center in Container约束; 给view添加高度(height)约束,该数值就是 UIScrollView 的contentSize; 至此约束已经没有红线.将控件放在view上正常添加约束且仍可滚动. view的高度约束height也可以拖拽出来设置成属性, 重写 -(void)updateViewConstraints 方法并调用该方法的super.就可以动态的设置height这个约束的constant属性。 (给self.height.constant动态赋值即可实现动态修改其滚动高度) 来源: oschina 链接: https://my.oschina.net/u/2526171/blog/646361

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

筅森魡賤 提交于 2019-12-06 13:24:08
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), which itself contains a textfield and an NSImageView. This 'image holder' as i called it, is in a

Changing xib name [duplicate]

北慕城南 提交于 2019-12-06 12:03:29
This question already has answers here : rename xib file (3 answers) Closed 5 years ago . I have changed the xib name but the change done is not reflected in the xml file of the xib. I just changed the name by renaming the file in project navigator. am i missing something? Edit: The project is under version control. and I have tried refactoring. Edit 2: The issue was i was not changing the owner name referenced from xib and that was the problem in the xml of xib Did you try opening the corresponding .m or .h file, selecting the class name, right clicking and choosing Refactor -> Rename... ?

Xcode Storyboard and xib connection

此生再无相见时 提交于 2019-12-06 11:59:26
问题 I have one story board project with many view controllers and i created one class named "connecter.h,connector.m " now can i connect this class to one .xib file ? Please help me. 回答1: You can create XIB when you create connector.h and connector.m by selecting it subclass of UIViewController and click on the checkbox for: "With XIB for User Interface". If you have created already .m & .h files then you can just add a new GUI file by selecting View from the window & finally setting its