how do I display a list of items on the screen, like how email is displayed on the screen?
What is this controller called?
It is a UITableView. Check the Table View Programming Guide and Table View Suite code sample by apple.
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 have a list view of all my Facebook friend lists. I want clicking on an item from the list view to display a detailed view of the friend. Now I want to slide this detail view of the items to show the detail view of next item in the list. Similarly previous item for left to right.
I have tried using information from this question, but I want to use view pager and page adapter.
you should look at the sample that comes with the sdk which uses a pager adapter and a dummy fragment for data...
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.
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".
I'm not able to find any specific examples in apple's documentation on this. I want to add two to three buttons to a table view programmatically, much like the contacts app does with the send text message/ add to favorites buttons on a contacts's info. does anyone know how to configure this?
What I've done in my apps is create a view with the buttons on it and return that view in the tableView:viewForHeaderInSection: and/or tableView:viewForFooterInSection: methods of the UITableView delegate.