Question about changing the first view my app loads
Starting from the top, I am making an application that in the new project section of Xcode, is a new view based application, that is using core data for storage. Xcode does an awesome job of populating lots of useful code for me so that when I click build, I have a bar at the top with edit and add buttons, and a plain uitableview that is blank. My question concerns how I might go about making another simple view the first one tha开发者_JAVA技巧t loads. I would like to have the editable uitableview as the second view in my drill down sequence, with a more user friendly welcome tableview that doesn't have the edit and add buttons on the bar, launch first. The user can click on a row in the first view, that will lead them then to the screen that is currently first. I have tried making a new class with a corresponding .xib file, and referencing that in the MainWindow.xib file that was referencing the rootScreen.xib, but that didn't work. Any thoughts or suggestions would be greatly appreciated, thanks!
There are a number of useful tutorials to get you started.
One simple approach is to create your new view using interface builder - the class you have already created.
Now in your first tableview, you need to place code in the
didSelectRowAtIndexPath to call the next tableview. If your class is something like SubView
you would do something along the lines of...
SubView * aview = [[SubView alloc] init];
aview.someproperty=index.path;
[self presentModalViewController:aview animated:YES];
[aview release];
The code you use to do the above will depend on exactly how you want the subviews to load - and how you have written them to display the data you need.
iPhone programming isnot drag and drop. You have a lot to learn. The above should get you started, but I suggest you try some of the sample applications on the apple site and carry on from there.
I would start with the navigation-based application template since you want to do navigation.
Try this and then come back with any specific problems that you come across.
The initial views of your application are created in the -applicationDidFinishLaunching: method of your AppDelegate. That is where you should look if you want to make another view the first to load.
精彩评论