I have a data-driven table view. The root view displays a list of entities (1) that when selected displays another list of entities (2).
If an entity in (1) has a series of properties that I'd like the user to have control over, what's the best UI approach to presenting them with a window for editing this data?
For example, if (1) was a list of Continents and (2) was a list of Countries, tapping a Continent will present a list of Countries and so on. If The user wanted to change a property of a Continent (example change "rateThisContinent") what does convention say he/she should tap?
I was originally thinking of a detail disclosure but that's not really in line with Apple's guidelines for what detail disclosure is.
An edit button might be the way to go, but then what would the table view display after the edit button has been pressed?
Thanks,
Glyn
I've decided to answer my own question. I will create an intermediate 'detail view' after the (1) list that presents all the properties with a button to view the (2) list.
I'll then make the detail view editable.
Related
I don’t have any code for this, so I’ll make up a hypothetical situation:
I want to make a grocery list app. I have a tab bar that sends me to a view where I can create categories in a list (fruits, vegetables, dairy etc.) Each category sends the user to a detail view where they can list off certain brands and the amount they need.
(This is where it gets a bit tricky)
In the main view, the categories that the user made are now tabs that are on the bottom and the list they made in detail view appears on the screen. Any changes they make in the list shown (in the main view) will update back into the specific detail view.
Is that possible? And what technique would be used for something like this?
I am new to stack overflow and a student currently learning objective-C at university. I am building an APP for the science museum in London and I'm creating an events planner.
I have two table views set up in two different View Controllers.
The first View controller and table view is called "Events" and it holds all of the current days events. When you click on an event, it goes into a new View Controller, gives more information about the event and has a button to "Add To Events", which pops up an alert saying: "Are you sure you want to add this to your events?" with an add button and dismiss button accordingly.
The information in this table view is populated using three NSMutableArray's. (One for title, subtitle and image).
The second view controller has an empty table view inside it. I am trying to make it so whenever a user finds an event they like, they can click into it, see more info and if they want to add it to their own events page, they can. I have got the "Add" button of the alert responding using an NSLog message, so the code to implement the adding to events would go there.
My question is, if i click on the first event, and then choose to add it to my events, how do i send the information of that specific tableviewcell that i clicked to display in the second view controllers table view ?
I have looked all over the place for information regarding this and have taken an abundance of Lynda courses online about IOS and objective-C, but I haven't been able to figure it all out.
Can anybody help?
First of all you shouldn't use three NSMutableArray's to populate your cells. Create one NSMutableArray and populate it with NSDictionarys with a key for the title, the subtitle and the image. Or even better: create a custom model (subclass of NSObject) for your Events and populate the NSMutableArray with those.
Now just like your NSMutableArray is the data source for your first table view controller you need another NSMutableArray as the data source for the second table view controller. When a user now clicks on "Add To Events" all you have to do is add the Event (Model or Dictionary) to the NSMutableArray of the second table view controller and either call - (void)reloadData on your table view so that it reloads ALL data or use the "Inserting, Deleting, and Moving Rows and Sections" methods from the UITableView Class Reference. This would be the better approach because it does not reload data that does not need to be reloaded.
i have a view which is fetching data from an Array and presenting the data in a tableview. This view has a navigation controller with a button in it. The button is meant to take you to another view for advanced searching. Let's say that in this new view i have a picker, when the user selects a value from the picker and clicks the back button in the navigation bar i want to get the value that the user selected. What is the best practice to do that? How can i send the selected value from one activity to the previous one?
Thanks in advance.
What you need here is reasoning a bit in terms of the Model-View-Controller design pattern.
Views should get their data through the model. So in your advanced search view, when the user selects some value, this value is stored in the model.
When you go back, the first view redraw itself by reading the current search value from the model.
There are other possibilities, like having the search view controller own a pointer to the first view and sending a message to it when the search value changes, but this is not very modular and is pretty fragile.
Use delegation. Write your own protocol like "PickerViewDelegate". then implement this protocol in your "main view" (which has table view). in PickerView just invoke [delegate somethingPicked:something].
I'm not sure, that search value is a model entity.
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.
I am creating a navigation based application and in the root view, it lists an array of choices, which as many you know leads to a more specific choice. My question is the lists that is displayed on the root view is actually not a choices of different functionality like calendar,mail but a choice, which is going to do the same functionality with different values.So I am wondering whether I should create a different view controller for each of the choices or I should just update the existing view. Which one is more efficient. Choice of inputs comes from a dictionary. I really appreciate your inputs. Thanks ;)
I assume that you want to have a screen with a number of "settings". Clicking on one of the settings will slide in a new view where the user can pick between a number of options. So basically you have two views each with a table and a navigation controller on top, right?
If this assumption is right, then I propose the following:
Create one view controller for the "front view".
This view controller will display the different "settings" and know that selecting one of the settings should slide in the next view.
This next view should be handled by a second view controller. It sounds like the different settings can be handled by one view controller.
So basically: Two view controllers, one for the first "level" and a different one for the second "level".