nib

Prototype Cells in a nib instead of a storyboard

試著忘記壹切 提交于 2019-11-27 02:53:53
For better re-usability I want to create a table view outside of my Storyboard. Now when I create a UITableView based ViewController with Nib in Xcode I get the default TableView in the nib file. However, I am not able in Interface Builder to add prototype cells like I am in my Storyboard. Is it currently not possible to add prototype cells in a nib or am I missing something. Thanks very much for any help. iOS 5 includes a new method on UITableView: registerNib:forCellReuseIdentifier: To use it, put a UITableViewCell in a nib. It has to be the only root object in the nib. You can register the

Uncaught exception: This class is not key value coding-compliant [duplicate]

不打扰是莪最后的温柔 提交于 2019-11-27 01:39:19
This question already has an answer here: Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error? 66 answers I'm following a tutorial titled "Swift Tutorial for iOS : NSFileManager Persisting Data" , and I've encountered an error around or after the 29 minute mark. When I try running it on the iOS simulator, I receive the error: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key theLoadMethod.' Obviously based off the

Creating a reusable UIView with xib (and loading from storyboard)

天涯浪子 提交于 2019-11-26 23:37:27
OK, there are dozens of posts on StackOverflow about this, but none are particularly clear on the solution. I'd like to create a custom UIView with an accompanying xib file. The requirements are: No separate UIViewController – a completely self-contained class Outlets in the class to allow me to set/get properties of the view My current approach to doing this is: Override -(id)initWithFrame: -(id)initWithFrame:(CGRect)frame { self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] objectAtIndex:0]; self.frame = frame; return self; } Instantiate

NSInternalInconsistencyException Could not load nib in bundle

随声附和 提交于 2019-11-26 22:58:21
I've created an application for child game. It loads 12 different questions for each round. After the 4th round the app crashes with the following log: ImageIO: CGImageRead_mapData 'open' failed '/var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/test.app/pi_ok.png' error = 24 (Too many open files) 2011-03-24 02:26:34.743 [424:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/4B0202F9-5961-4AC7-A327-604620AF1F94/VisualMath.app> (loaded)' with name 'ThemePickerController''

“First Responder” - Did I get that right?

梦想与她 提交于 2019-11-26 19:12:06
问题 Let me summarize this shortly: A "First Responder" in a nib file is an object, which represents the UI control element that has the user's focus. So if the user clicks on a control, the nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the nib, so that I could for example send a message "make red font color" to whatever the user has activated by clicking. And then, if this First Responder UI control does not understand that

What is the File's Owner (in Interface builder)?

你离开我真会死。 提交于 2019-11-26 18:57:06
问题 I am new to Cocoa and I don't understand the concept of File's Owner of a .nib file. Here is the way I would see things : Consider a file myNibFile.nib file that describes how a window looks. Now, I want to connect an actual window to this .nib file. So, I create a class myWindow , which is a subclass of NSWindowController . And, to do this connection, I change the init method like this: -(id)init { [super initWithWindowNibName:@"myNibFile"]; return self; } So, I understand that when I create

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle

元气小坏坏 提交于 2019-11-26 17:28:29
In my AppDelegate there is a problem I do not understand. RootViewController initially called ViewController and I changed it name. The application is formed by many ViewController then I have introduced a UINavigationController. Why this error comes? NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle /Users/XXXXXXXXXXXX/Library/Application Support/iPhone simulator/6.0/Applications/ B7A7D461-1CFE-4B05-AF32-00B65FCFFF49/XXXXXXXXXX.app> (loaded)'with name 'RootViewController'' *** First throw call stack: (0x1992012 0x1357e7e 0x1991deb 0x4bafac 0x37fe37 0x380418

wrong frame size in viewDidLoad [duplicate]

陌路散爱 提交于 2019-11-26 16:05:22
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Why am I having to manually set my view’s frame in viewDidLoad? I have universal app for iphone and ipad, two storyboards, if I run my app on the iphone simulator in viewDidLoad every frame of each element in nib is correct. But if I do it for ipad (simulator) in frame is nil, but the screen looks correct. Could you please advise me smth? Thanks. 回答1: It's a very similar question to ios setContentOffset not

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

左心房为你撑大大i 提交于 2019-11-26 12:41:23
I have an application in which I would like to support multiple orientations. I have two .xib files that I want to use, myViewController.xib and myViewControllerLandscape.xib. myViewController.xib exists in project/Resources and myViewControllerLandscape.xib exists in the root project directory. What I want to do is use a separate NIB (myViewControllerLandscape.xib) for my rotations. I try detecting rotation in viewDidLoad l ike this: if((self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight)) { NSLog(@"Landscape

How to convert a NIB-based project to a Storyboard-based? [closed]

心不动则不痛 提交于 2019-11-26 11:17:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I\'m using storyboard (this is completely new!). How do I import my existing xib files and integrate them onto a single file, using the storyboard option? 回答1: There is not a 1-click way to do this. According to "Sams Teach Yourself Core Data for Mac and iOS in 24 Hours" by Jesse Feiler, storyboards are different