Three20 TTTableViewController with a TTThumbsTableViewCell - iphone

It seems that you must use the TTThumbsViewController to accomplish this. However, in the example code, TTThumbsViewController is only ever used to manage a scrollview of thumbs. How do you configure it to display cells instead?
_________Original Question_________
Has anyone used the Three20 source and made a tableview (not Fields)?
I am trying to figure out how to insert the TTThumbTableViewCell in a table and it none of the examples even address the tableviewcell classes (just the tablefields).
If you know how to setup a table to use these cell classes, can you post how you accomplished it?
Thanks

I haven't really used Three20 myself, but took a quick look on the source code.
It seems that Three20 have abstracted a creation of table view cells in generic TTTableViewDataSource. It queries class of a table view cell to be created via tableView:cellClassForObject:. TTThumbsDataSource in TTThumbsViewController.m then overrides that to return TTThumbTableViewCell class for TTPhoto objects.
So, if you are not using TTThumbsViewController, you should use TTThumbsDataSource as a dataSource for your table view or create your own similar class.

I was mistaken in how Three20 was setup.
A TTThumbsViewController is a Table view of TTThumbTableViewCells already. You just can't see the lines between the cells.
You can change the way the cells behave by subclassing TTThumbTableViewCells.

Related

UITableView Margined/In Header

I'm looking to create the TableView section contained in the header of this tableview (the "margined" area with Eric Mulder typed in). Does anybody have any insight on this matter? Thanks!
You can't do it easily with a delegate method of UITableView. I got it to work by creating an image which contains a the style of the default cells of a table view. Then I simply load it as an UIImageView in my header view of the table view.
For example, you can take a look at my app iCookit (App Store). You can see the work on the 3rd picture. That's the result. It was very easy to do. Just a little bit with Photoshop or Gimp.
Have you tried setting a UIView that contains both the photo well and a UITableView for the name fields as the main UITableView's headerView?

Is "setting" UI implemented by table view in iphone/touch/ipad?

I want my app's setting UI feel consistent with iphone's internal setting UI. It looks like it's implemented by a table view with sections to group the setting items together. Am I correct?
refer to: http://i.stack.imgur.com/XNVyO.png
Is it implemented by a table view with hard coded cells and sections or is it build by interface builder? If it is built by IB, how to design the sections?
thanks
-Leo
you might want to look at something like InAppSettingsKit, an open source framework that duplicates the settings app feel in your application.
if you want to create it yourself you'd just set the ui table view style to UITableViewStyleGrouped
Read up about how UITableView Work, You will need a UITableViewDataSource.
The datasource tells the table how many sections and cells there are in the table view.
Then the UITableViewDelegate will handle any selecte rows:
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TableView/TableView.html

Form design in IPhone - What control(s) to use?

I am interested in creating a form in an iphone application similar to this one. Mine would probably have a textbox as well but I was wondering what kind of control(s) should I use? Is this a grouped UITableView where the cells are hardcoded? If that's the case what about events on the textboxes? will they still fire on the tableview level.
Thanks a lot.
Yes, you should use a grouped UITableView. From there you need to create UITextFields and add them to your table view cells. You can either create your own cell, by subclassing UITableViewCell, or you can simply add text fields in cellForRowAtIndexPath.
Then, to receive events from the text fields you need to set the delegate and use the UITableViewDelegate methods mentioned here.
https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html
There is an UICatalog sample code in apple develop site, you can check that out.

UITableView and UITableCellView, how does this work with core plot?

I'm very new to iPhone programming, and I'm currently following tutos to understand the whole thing. I've been able to do what I needed (retrive data from a JSON http server, parse them with YAJL and plot the data in core plot). I have done this in a "simple" view where I have added a UILayerHostingView as requested by core-plot.
I am now trying to follow this tuto: http://blogs.remobjects.com/blogs/mh/2010/01/26/p973 but I am missing the first part regarding the views...
My understanding is that I need to create a view with a UITableView first. Then add a UITableCellView to make the first cell be able to contain the graph ? Is this right ? Where does the method "(id)initWithStyle:(UITableViewCellStyle)style" come from ?
For my needs, only the first cell needs to contain a graph, I will put some other info in the other cells.
As for now, I have created a new GraphListViewController, in the corresponding view I have added a listview but I do not see any auto generated methods regading cell customisation ? Do I need to implements DataSource in this controller and manually add some customisation methods ? Do I need to add a UITagbleViewCell to this UITableViewTable within IB ?
Hope I am not getting to confusing...
Thanks a lot for your help,
Best Regards,
Luc
To start with, create a new file ...
Cocoa Touch Class -> UIViewController subclass
and click the UITableViewController subclass checkbox. This will do all the tableview work for you. You can now open the xib file and change all the properties that you want for this.
Once this is done you need to populate the cells within the table. The first thing you need to do is to tell the controller how many cells to display. For this update the numberOfRowsInSection: method to return how many you want.
The next part is where you want to create the cell and is done mainly in the cellForRowAtIndexPath and for this I'm gonna redirect you to the following good tutorial on adding custom cells.
http://iphonedevelopment.blogspot.com/2009/09/table-view-cells-in-interface-builder.html
This explains a bit of the 'magic' that happens
Hope this helps
Liam

iPhone app - some custom UITableViewCell questions

At the moment, I have a settings view in my iPhone app built with Interface builder, it consists of a background image, some text fields, labels and buttons. Because this looks bad, I want to convert the settings view to an UITableView with custom UITableViewCells.
I already tried adding some cells into my settings view's XIB and returning them in the cellForRowAtIndexPath method (with [return myCell];), as written in Apple's tutorial, but this was not working for me - my whole TableView looked strange and it only showed the first cell correctly.
Is it possible to design these custom cells in Interface Builder? Do I have to create an empty XIB for them or can I put them in my view's XIB? And how do I insert them into my TableView?
Thanks in advance,
Yassin
You can absolutely add custom table cells that you built in interface builder. This includes both static cells and Dynamic cells. However without you providing more information the best I can say is "double check the docs and try again." I can only say that it works and it's rather straightforward so it's hard to say what you may have missed. It might be more helpful if you post what you have for the tableView:cellForRowAtIndexPath method.
Since you say you just have some text fields, I would recommend looking at the technique for static row content section of the Table View Programming guide. You probably would want to have each field of your form correspond to a row in a Segmented Table View, it'll make everything look nicer.