Edit, select value from UITableView on the iPhone - iphone

I have a UITableView with a list of names, representing server configurations. I want the user to be able to select a server configuration, add a server config, edit a server config, or just cancel out of the view and return to the main view. I'm having a hard time trying to figure out how to achieve all of that functionality in this view.
To select, the user should be able to just tap the server config name and a check will appear next to the name then the user is taken back to the main view automatically (or use a save button instead?). To edit the server config, I would also like the user to be able to tap the server config name and be taken to a detail screen where changes can be made. How can I accomplish both since I want both to be done by tapping the server name (row)? Right now the cancel button seems out of place since the screen is accessed via a UINavigationController.
Any suggestions?
alt text http://img94.imageshack.us/img94/6448/screenshot20100325at541.png

Have you considered a detail disclosure button? this effectively gives you two "hot points" on each tableViewCell:
1- The detail disclosure button itself which, according to Apple's HIG, should take you to a detail view.
2- The rest of the cell which you could use to make your selection and pop the view controller.
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

Related

how to transfert informations from one view to another

i have this view in my app
http://hpics.li/ce94f6c
the user should put the fly number and he will get informations taht i got from a web service in the table view .
But this table view is small and i want to make one at the height and width of the vie .
Should i hide the label and button and then show the large table view ?
Or should i make a new xib and load it when the user click the button ?
or should i create a new tableviewcontroller with .xib and send to him the json to parase and put in the table view ?
help please
What you can do is to go with your second option.
You can firstly create a ViewController where you have a label and a button field. (You should also put some image is this case as having only a button and a label on complete screen will seem to be odd).
Once you click the button you can call the web service and then navigate to a new viewController where you can display web results in a tableView.

how create a view when custom button click

new developer on iphone,please any one have an idea about my problem tell me.in my application take two views one login another one is main message view,user enter valid username,password when click login button main message view will display i wrote for this but my problem is in main message view i place tableview to display all messages and rigth side of this tableview place a button type is custom when click this button add a small view(this view add to main message view both view will display at that time)on that new add view we have to add some buttons one by one(world,country,state)when click world button data change on main message tableview.
please elaborate the problem.
Where exactly you are having problem?
In adding view? or buttons?... you are saying you want to add button one by one....... is it side by side? or you want to give some time delay to add these buttons?
Or you are having problem in data updation on main view?
But as your question title suggests you are having problem in creating the view. I think you want know how to add action with that custom button?(not sure)
[yourBtnObject addTarget:self action:#selector(yourBtnAction:) forControlEvents:UIControlEventTouchUpInside];
here in above code you have to define method:
-(void) yourBtnAction:(id)sender{
//you code goes here for creating and adding the view.
}
also, yourBtnObject denotes your customButton reference ..... change the names as suitable.
Thanks,

Add Up/Down buttons to UITableView navigation bar

Many apps, including Apple's own native Mail.app on the iPhone implement an Up/Down button in the detail view which allows for quick and easy browsing. I wish to create such an interface in my own app, but am struggling to do so. So far I've setup a segmented control which links to an action in my navigation bar, but I'm struggling with what to put in the action to make the detail view for the table update when the user presses the "Up" button or "Down" button to navigate to the item before or after the current one.
Any help would be appreciated. Thanks.
It depends on how you have your data set up, but why can't you hook into your existing code? What are you doing in your existing code to refresh the detail view when a user selects a row in master view table? Can't you just call that method directly?
It's hard to give specific advice without more detailed information on your current design.

UINavigationController reloading UITableView

In my application I am parsing XML to create a UITableView. When a user selects a row it changes the file that it is parsing and reloads the UITableView.
I want to create a back button so that the user can go back the the previous XML page they were viewing.
In short how can I tell the navigation controller to create a back arrow for this page when all i am doing is reloading my UITableView?
I'd strongly suggest building another controller (i.e. UITableViewController) and push that instead of just reloading the table. This makes the button automagically, and (major plus here), it animates the whole digging down / stepping back in a way that the user is expecting it.
As a side note, I didn't manage to get a back-style button once I tried it, just a plain normal button (make a new button and set it at the navigation bar).
What you're describing is a navigation. Rather than reloading the table's data, simply push a new view controller onto the navigation stack every time a row is tapped. This is a fundamental pattern in iPhone development. Here is Apple sample code for a multi-level drill down table view.

iphone persistent button on all views

I have a navigation app that has many screens the user navigates to. A handful of views manages these screens dynamically. What I want to try to do is add a button that will always show up on every screen the user views. I need to do this so that the user is always able to preform the action associated with the button regardless of where they are in the app.
Is it possible to achieve this by adding this button only once and having it passed between views like my navigation bar is? Or do I just have to man up and add this button and its functionality to every single view file I have?
Thanks
I would say it probably depends on what the button does. If the button is generic to all views, meaning it affects all views the same exact way so no customization for a given view is needed, then a way to do this would be to include the function in the App Delegate or as a subclass to your Navigation controller.
You can then use the rightBarButtonItem to always show the same button and just access that method. You would just have to add code for the rightBarButtonItem in each viewDidLoad (but they'd all be the same).
I did something similar to this with an "Upgrade" button on one project. Since all the button does is launch the AppStore to the paid version, it's independent of all views and I can place it anywhere.
You can put the button on the navigation bar if you want. Alternately, the more generic way to do this would be to split your single view into two views. One is small and only contains your button but always stays on the screen. The second is your workspace and you swap in and out the views that are displaying the current content. You'll note that this is the way the navigation controls and tab-bar controls work.
The last way to do this would be to put different buttons, in the same place, on each view and have them all trigger the same action. As far as the user is concerned this looks like the same button. Disadvantage here is that you can't alter the button across all views in a simple manner.