![]() It doesn't overwrite the whole application package when you rebuild / rerun your application. Therefore, you cannot have a nib called MainView.xib if you also have a nib called MainViewController and want MainViewController.xib to be the primary nib for MainViewController.Ģ.) Even if you delete MainView.xib or rename it to something else (MainInternalView.xib in this case), you MUST delete / clean your iOS simulator as the old nib file (MainView.xib) will still remain in the application. It looks for a MyViewController.nib file." For example, if the class name is MyViewController, ![]() It looks for a nib file whose name matches the name of the viewĬontroller class. In MyViewController, it looks for a nib file whose name matches theĬlass name without the word “Controller”, as in MyView.nib. "If the view controller class name ends with the word “Controller”, as So basically, I wanted MainViewController.xib to load as the nib for the MainViewController object, and inside MainViewController, at some later point, I would add the internal view specified by MainView.xib.ġ.) I found in the Apple docs that when loading a view controller via storyboard or nib: It basically encapsulated an internal view that would be in the MainViewController.xib's view, and also had it's File Owner set to MainViewController. I also made a MainView.xib that contained a view that was going to be programmatically added to the view defined in MainViewController.xib and it's view. This nib has it's view property set to the File Owner which was MainViewController. Basically, I have a view controller name MainViewController, which has a xib named MainViewController.xib. I had this issue as well, but had to solve it a different way. I might have had a file with that name before and renamed/deleted it, but it's not being referenced to from anywhere that I can see in IB. file://localhost/Users/bemmu/Dropbox/b2/iphone/ValleyStory/ValleyStory/GameView.xib If I grep my project directory, I do see it referenced from "UserInterfaceState.xcuserstate". Shouldn't it use "GameViewController.xib" instead? Using that GameViewController is what brings up this error, but I don't understand where it gets the idea to try and load "GameView.xib". I do have a "GameViewController.m" and matching "GameViewController.xib" in my project. But the thing is, I don't even HAVE a GameView.xib in my project or even in the project directory. You might be thinking "do as it says, connect the File's Owner to the View in IB!". * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '- loaded the GameView nib but the view outlet was not set.' rw-r-r- 1 aad staff 2.6K Oct 29 20:40 /Users/aad/Library/Developer/Xcode/DerivedData/MTLite-fzfjswokuxdnzucfawrmvgtbhuep/Build/Products/Debug-iphonesimulator/MTL_amework/SCIUIProgressMonitorViewController.This is not the same situation as the multitude of other similar questions here. rw-r-r- 1 aad staff 7.3K Oct 29 20:40 /Users/aad/Library/Developer/Xcode/DerivedData/MTLite-fzfjswokuxdnzucfawrmvgtbhuep/Build/Products/Debug-iphonesimulator/MTL_amework/MainViewController.nib $ d=' /Users/aad/Library/Developer/Xcode/DerivedData/MTLite-fzfjswokuxdnzucfawrmvgtbhuep/Build/Products/Debug-iphonesimulator/MTL_amework/ In the debugger I printed the Bundle and used ls to make sure the nib was present ![]() NSString *bundleIdentifier = MTL_COMMON_FRAMEWORK_BUNDLE_ID_STR If this is not set My common framework resources are not copied to DerivedData/MTLite-fzfjswokuxdnzucfawrmvgtbhuep/Build In the IB identity inspector I am setting the custom class and the model is the name of my framework. The MainViewController.xib make use of SCIUIProgressMonitorViewController class/xib This code is in the common framework, along with the xib and class code for SCIUIProgressMonitorViewController. Here is the code I use to load my first, main, VC. 20:45:46.187105-0700 MTLite *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'SCIUIProgressMonitorViewController'' When my app tries to create my main/home VC from a xib I get the following error I set up a workspace with my app project, and the common framework Most of the common code is comprised of ViewControllers and xib files. 'I am using xcode 9 to refactor some common code in my iOS apps into a framework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |