xib

How to Empty Caches and Clean All Targets Xcode 4 and later

此生再无相见时 提交于 2019-12-16 18:49:29
问题 Jonathan suggest here: Xcode Includes .xib files that have been deleted! that cleaning all targets and empty the caches will fix the problem with Xcode including deleted .xib files but I cannot find a way to empty the cache in Xcode 4. How to do that in Xcode 4? 回答1: Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually. Remove all its contents because there's a bug where Xcode will run an old version of your

Error on Dead Outlets / Actions in Interface Builder

微笑、不失礼 提交于 2019-12-14 04:21:10
问题 Is there a way to have Xcode refuse to build an app due to there being a dead outlet or action in my Xib, Nib or Storyboards ? I quite often build an app only to find it crashes due to a interface builder file is pointing to a key on my class which no longer exists. I am slowly coming to the conclusion it is better to construct these pieces of UI programatically but I was wondering if there is a way at least for my older projects of Xcode warning me against these things ? 回答1: Well, it can't.

How to assign an identifier to a UIViewController from the MainStoryboard?

…衆ロ難τιáo~ 提交于 2019-12-14 03:58:46
问题 Before I used to allocate and initialize a view controller using initWithNibName, where the parameter for the Nib name is simply the name of the xib/nib file. However, with the way Xcode/IB works with Storyboards now, I'm not sure what I need to do to initialize a view controller class with it's respective xib/nib. In my storyboard i have created the view controller and referenced it (from another view controller) and specified it as a Popover type. Any ideas how this is accomplished? Thanks.

Using a XIB file for custom Tableview Section Header

亡梦爱人 提交于 2019-12-14 03:39:41
问题 I wanted to use a xib file to customise a tableview section in xcode (objective C), and here ar my files: SectionHeaderView.xib is a UIView with a UILabel SectionHeaderView.m #import "SectionHeaderView.h" @implementation SectionHeaderView @synthesize sectionHeader; @end SectionHeaderView.h #import <UIKit/UIKit.h> @interface SectionHeaderView : UIView { IBOutlet UILabel *sectionHeader; } @property (nonatomic, strong) IBOutlet UILabel *sectionHeader; @end and in my MasterViewController.m

how to make the view controller compatible with iphone 5 if xib not taken

爷,独闯天下 提交于 2019-12-13 23:25:59
问题 How can a view controller be make compatible with iphone 5 if it's xib file not taken. Is it possible to make that change programmatically. Thanks in advance. 回答1: Yes defiantly you can do this. XIB are just files too just open one in a texteditor - you'll see that it consists of readable xml code. now for making viewController compatible with Iphone 5 just put if else condition and make thing separately for different devices by checking height of particular device but defiantly its going to

Trying to display a UIImage captured from one viewController, and display it in another in iOS

戏子无情 提交于 2019-12-13 22:21:15
问题 I have an iPad application that I am working on where, from my main viewController (call it mainViewController), I call and display another viewController (call it nextViewController) that is created from an .xib file. This second viewController allows the user to capture an image like so: - (IBAction)imageCapture:(id)sender { _myImage = [_nextView captureImage]; UIImageWriteToSavedPhotosAlbum(_myImage, nil, nil, nil); [self dismissViewControllerAnimated:YES completion:nil]; } Once this image

Updating app on device with .xib removed crashes app

爷,独闯天下 提交于 2019-12-13 16:12:57
问题 I have an older version of an app installed on a device. In my new version I no longer had use of a .xib file as it changed from something complex to just a table view and I can instantiate it in code. However, when I build and run on the device it crashes as it still tries to load the controller from the .xib file contained in the older app, and complains about a key/value pair missing for a UILabel. For example: SomeViewController.h (UITableViewController) SomeViewController.m

Saving and Restoring Application State on iOS 6 without Storyboards

旧城冷巷雨未停 提交于 2019-12-13 13:39:10
问题 I have done test app following this tutorial I try to do the same without using Storyboards and it isn't work. I have enabled state preservation and restoration in AppDelegate. I have assigned restorationIdentifier to all my controllers and their views. I think i have to implement some additional code in AppDelegate to restore rootviewcontroller, but i cannot find the right way to do this. -(BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder { return

How to change dynamically the xib of a UIVIewController

别来无恙 提交于 2019-12-13 12:33:48
问题 I have an UIVIewController "controller1" for instance. This controller is instanciated with initWithNibName... with "file1.xib". I want to dynamically change the xib file of my "controller1" to "file2.xib" To resume : "controller1" <-> "file1.xib" and I want to dynamically have : "controler1" <-> "file2.xib" How can I do this ? Hope I was clear. 回答1: When you want to change views in a UIViewController just just use this code: NSArray *nibObjs = [[NSBundle mainBundle] loadNibNamed:@"file2"

iOS: add constraints between a xib view and its superview

僤鯓⒐⒋嵵緔 提交于 2019-12-13 07:51:17
问题 I'm adding a view from a xib file to a table view controller and then placing this out of view so that when the user taps a button the view scrolls down from under the navigation bar to be visible. Here's the view that drops down: This works fine on iPhone 6 but anything smaller and the drop down view loses its constraints and looks all jumbled up like below: I believe this is the case because there are no constraints being set between the drop down view and the table view (the superview). I