iphone dynamicly call same view (using storyboard?) - iphone

I'm new to iphone dev. My app Design has 3 views. One start screen. Then you press a button and you go to a table view. The table view will decide if it goes to another same table view with other data (and how many levels down ) according to an xml file. Then it will go to a view that shows details. For example it might go like:
Main Screen -> table view -> detail view
Main Screen -> Table view -> table view -> table view -> detail view etc.
So I want to be able when a cell is chosen in the table view then (if this is what the xml describes) call a same view (same view Controller and code). And when the xml describes so go to detail view.
Can this be done using storyboards? If I want to use ios 4.3 how can I do it?
I'm using latest (4.3) xCode on Lion. Also note that this xcode does not have a template for a Navigation Based app.

From what I have seen till now, I can't dynamically call the same view from storyboards. So I implemented a navigation controller using the following tutorial and it works like a charm for me!
http://www.techotopia.com/index.php/Creating_a_Navigation_based_iOS_5_iPhone_Application_using_TableViews

Related

UIDesign for SplitViewController in ios

Im my app, i'm using split view controller for the first time. Am converting my iPhone app to universal app. My question is, how should i design the UI for the detail view controller so that it accommodates in the smaller area of the split view controller? That is, my detail view controller .xib file is in normal size landscape mode and when i design UI(insert textfields, labels, etc), they get overlapped. Any hint regarding UI Design for detail view controller?
Traditionally is the splitview master view displayed in a navigation view controller on the iphone. If the user selects any details to diaplay, thé phone display another view. This designpattern is very common and straight foreward.
Create a new project in XCode. Select a master detail template and make sure you use universal for the targets. Explore the new project.

iPhone Cocoa Touch: Adding additional view or sub view to views

From What I understand based on what I read, most of the time we will be dealing with view when creating apps for the iPhone. Adding sub view to table view, adding table view to a UIView....etc
So my question is how do I go about mix and match all the views? Let say I start off by using a template in Xcode (Tab Bar Application) which basically give me 2 "section", a tab bar controller with 2 UIView to began with. I modified the code for the UIView so that I end up with 2 table view. Now I wanted to an add additional view to the table view whenever I tap on a cell on the table view. I create a new view controller call firstDetailView and hook them up but nothing happen. Surprisingly the app doesn't crash.
I might do it wrongly or have missed something. I am a newbies to programming. Any help would be appreciated.
Thanks.
If you want to deal with different views which are handled by a view controller you should read the View Controller Programming Guide
Navigation through views will be done with a Navigation Controller (Guide here)
Tab bar's are explained as well (Guide here)
Try to read the Apple documentation in the first hand, they are pretty good and all basic stuff is explained there.

split UITableView in iPhone

In the amazon iphone app home page there is a grouped table view that has two cells on one row. How can I recreate this?
I would expect, that it is one cell, that shows different information. You can find a lot of informations about customizing UITableViewCells
iPhone Tutorial: Creating a custom Table View Cell
Customize that UIViewCell – Part 1: Using Interface Builder
Go to your interface builder, click on your TableView and press command+1 to bring up the Table View Attributes. There on the first section Table View Style. Change it to "grouped".

How do i add a main menu before accessing a UITableView?

I have built an application that revolves around UITableView, Core Data and XML. Now that the app is almost complete i want to add a main menu before accessing the tableView. The main menu will then allow you to navigate to the table and other functions. What is the easiest way to go about doing this? I'm confused about how to change the inital file that is loaded.
One suggestion would be to add a navigation controller and a new view which will serve as your 'main' view and show your menu. Then in response to the 'menu' choices you could push your existing table view or other views that you might want to show.

Easy custom UITableView drawing

All,
I found the code in Matt Gallagher site ( http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html ) for this really neat design for a Table View... Im very new to Cocoa and Im having a hard time figuring out how to wire the darn thing in IB...
I loved the design and wanted to use something similar in a more complex structure... Nav Bar / Tab Bar with a few other views / TableView for the data in the first view... I found lots of tutorials to do that and got it working... When I tried to use that design in my project, things went crazy... in My MainWindow.xib I cant have a UIView where the arrow is pointing...
the nib looks like this:
Tab Bar Controller
Tab Bar
Nav Controller
Navigation Bar
Table View Controller
Table View
---->>>> (UIView for the backgroundImage )
Navigation Item
Tab Bar Item
UIView Controller
Tab Bar item
Window
can anyone guide me in the right direction??
Thanks !!!
It sounds like you're not having issues with the table view as much as the construction of the hierarchy around the table.
Instructions for creating the hierarchy would be as follows. I think you've diverged at around step 9:
Start with new copy of the default iPhone "View" template
Throw away the view controller class.
Open the MainWindow.xib and delete the view controller there too.
Find the controllers in the
Interface Builder library palette (they're
the yellow spheres at the top of the "Cocoa Touch" library in "Objects" mode whose icons contain
other objects).
Drag the tab view controller into
your MainWindow.xib file at the top
level.
Expand the tab view (triangle next to its name in the list view of the xib)
Drag a navigation controller into your expanded tab view (if this works, it should appear as one of the tabs along with the two view controllers that are there by default)
Expand the navigation controller
Drag a view controller (not a table view controller) into the navigation controller. It should appear as the content of the navigation controller.
Select the view controller (single click).
Press Command-4 (or select "Identity Inspector" from the "Tools" menu).
In the "Class Identity" popup menu, select EasyCustomTableController (this assumes that the current xib file is part of an Xcode project and this Xcode project already has EasyCustomTableController added to it).
Add a UIImageView to the view controller's view (this is your background image)
Add a UITableView to the view controller's view (this is your table). Add this view so it is after (and hence on top of) your image view.
There should be a tableView outlet on the view controller. Connect this to the table view.
Connect the app delegate's viewController to the tab bar controller (back in Xcode you can optionally change the type of this property to UITabViewController)
Should work.
The trick is that UITableViewController can't be used if you want the view to contain more than just a table. For this reason, you must use UIViewController and recreate the functionality that the UITableViewController adds. See here for how this is done:
http://cocoawithlove.com/2009/03/recreating-uitableviewcontroller-to.html
Thank you Matt (kind of cool that you answered)!!
I really appreciate the help... I've been messing around with it and got it to work using a UIViewController in another view (being created from the tableview)... Once I had the UITableViewController in the navigation I dropped the imageview & used a gray color; it looks great!! The initial screen has the rows big enough that scrolling is not an issue... I will go back and try to change that now...
I do have to say that IB is by far the most challenging step in app development for a newbie coming into Cocoa Touch !!! Yikes!