Could not load NIB in bundle in ios5 pagebased application - ios5

I m calling rootviewcontroller from another view using below code
rootviewpage = [[RootViewController alloc]initWithNibName:#"RootViewController" bundle:nil];
[self.view addSubview:rootviewpage.view];
but the application terminate..pls check below error message .Tanks
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'RootViewController''
* First throw call stack:

you don't have a nib (a .xib file that is used for interfaces) that has the name RootViewController in your project..

Related

IPhone app use core-plot (What to fix)?

i'm making iphone app that use Core-Plot chart. The app have "SavolaViewController as a main class that include a button and when button clicked it's GoTo to another class named "ChartViewController" by this code
ChartViewControllerVar = [[ChartViewController alloc]initWithNibName:#"ChartViewController" bundle:nil];
[self presentModalViewController:ChartViewControllerVar animated:YES];
I have read about core-plot for 4-6 hours and i have not understand any of the tutorials(it's not understandable) [({"Please dont answer with tutorial link"})]
I have coped the Core-Plot code from the example in Core-Plot .zip file(you'll find the code in the link bellow).
and i have this msg in the console
2012-07-15 16:38:31.325 Savola[13105:f803] * Terminating app due to
uncaught exception 'NSInternalInconsistencyException', reason:
'-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"ChartViewController" nib but the view outlet was not set.'
* First throw call stack: (0x140a022 0x19c2cd6 0x13b2a48 0x13b29b9 0x4102dd 0x410779 0x41099b 0x4199bc 0x414818 0x630565 0x417857
0x4179bc 0xca94792 0x4179fc 0x9a4f 0x3da5c5 0x3da7fa 0xc6f85d
0x13de936 0x13de3d7 0x1341790 0x1340d84 0x1340c9b 0x228f7d8 0x228f88a
0x349626 0x8c0a 0x2c55) terminate called throwing an exception(lldb)
What i want(If you can)
Fix the code to run in my app.
What does i need to but in the .xib file.
delete the codes unneeded.
The code
This has nothing to do with Core Plot. You have an IBOutlet in your .xib that's not connected properly.

can't load nib error message

I am getting a very annoying error message:
'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'SingleStoryViewController''
Any idea why? That SingleStoryViewController nib is there available in the project.
I am not sure which code to post, but here's what I have:
if ([viewType isEqualToString:kSingleStoryView]){
viewController = [[SingleStoryViewController alloc] initWithNibName:#"SingleStoryViewController" bundle:nil];
}
Please check the following points:
1) You have spelled the nib filename correctly.
2) You have specified "SingleStoryViewController" as the Parent class for the file's owner object in nib file.
3) You have connected the view outlet in the nib file to the UIView.
Please let us know if any query.
Is the name of the NIB exactly SingleStoryViewController.xib
Is it marked to be copied to the bundle
Is it in the Resources folder
Open the .app bundle -- is it there? In the Resources folder?

Error while calling another view

I'm Calling MainMenu View as:
MainMenu *obj=[[MenuViewController alloc] init];
[self presentModalViewController:obj animated:NO];
But it shows following error..
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MenuViewController" nib but the view outlet was not set.'
* Call stack at first throw:
Please Fix it.. thank you..
You need to open your nib in interface builder and connect your view with the view in File's Owner
i think your problem clearly in the error try to catch that error
loadViewFromNibNamed:bundle:] loaded the "MenuViewController" nib.....>>> but the view outlet was not set
Open your nib file and set your view outlet.

Getting error in console for iPad application

I am getting an error while I tried to push ViewController in table's didSelectRow in iPad app.
Error which I get is:
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle /Users/abc/Library/Application Support/iPhone Simulator/4.2/Applications/CFC7803E-4E44-45BF-9F47-``E24DDB44F286/SampleIpad.app> (loaded)' with name 'DetailView''
Code in table's didSelectRow method :
DetailView *detailViewController = [[DetailView alloc] initWithNibName:#"DetailView" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
What can be done?
To do so, Right click the viewController .m file in Xcode
Click GetInfo
Go to Targets tab and check if the checkbox next to your target project is checked? If not, do check that checkbox.
Clean and Rebuild your code.
This would work for you.
This error is due to the missing nib file.Check whether your application folder on the disk contains the DetailView.xib file. If it is present you may try using [NSBundle mainBundle] instead of nil in the bundle parameter.
Try this
[NSBundle mainBundle];

How do I use InterfaceBuilder files in Xcode subprojects?

I'm developing an iPhone app that is a "module" of another launcher (it doesn't launch from the iPhone home screen). To add this module to the launcher, I have to drop in the xcode file into the parent xcode project (creating a subproject). The subproject uses a NIB file as its view controller and the subproject loads the file using initWithNib:
root_view_controller = [[UINavigationController alloc] initWithRootViewController:[[LMU_IP_RootView alloc] initWithNibName:#"LMU_IP_RootView" bundle:nil]];
When I try to run the parent project, it crashes with:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle [...] (loaded)' with name 'LMU_IP_RootView''
I'm guessing its because it can't find the NIB file because the root bundle is now the parent project instead of the subproject. I could include the NIB in the parent project and that fixes the error, but doesn't solve my problem.
So my question: How do I use InterfaceBuilder files in a subproject? Do I have to specify a bundle? How do I specify a bundle that refers to this subproject?
Thanks!
When bundle is nil, the search is performed in the main bundle, not in your subproject bundle. I'm not entirely clear on your app architecture, but try specifying the bundle containing the class as the bundle to search:
NSBundle *classBundle = [NSBundle bundleForClass:[LMU_IP_RootView class]];
id vc = [[LMU_IP_RootView alloc] initWithNibName:nil bundle:classBundle]
root_view_controller = [[UINavigationController alloc]
initWithRootViewController:vc];
[vc release];
Note that a nil nib name defaults to "ClassName.nib", so LMU_IP_RootView.nib will be searched for in this case.
It's generally better to override -init in your view controller class so it performs the correct lookup. Then client code doesn't have to worry about what nibs the class needs.