0

I'm looking to create a grouped style UITableView that allows a user to select different options (like shown below). I'm already able to setup the UITableView in a grouped style; my question is based on how I can add buttons, toggles and list options like shown below? Is it possible to make use of plist's to simplify the process somewhat?

enter image description here

Note: I'm not trying to create a 'settings' view, I want to allow users to create lots of different NSDictionaries and set values on each of them using the table setup described.

4 Answers4

2

You should create your own UITableViewCell. This way you could add the desired UI items of your choice. You could use the Interface builder to create your custom cell. There are many good tutorials on the subject.

I do not see the need to use a property list for this, since it is rather simple to implement this.

This is a good example:

http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

Johan Karlsson
  • 1,136
  • 1
  • 14
  • 37
0

You should look a this library : http://www.inappsettingskit.com/

Other exist but I don't remember the name. Or you can define your own data structure in plist, and associate with UITableViewCell type. But this will require a lot more coding.

arnaud del.
  • 904
  • 12
  • 27
  • Thanks for your comment, however I have used the InAppSettingsKit before. In this situation I'm not looking to implement settings, so I can't really make use of it. –  Jan 12 '12 at 14:28
0

your answere lies in the delegate method didselectrowatindexpath. if you want to add options to the individual cells, you'll need either a custom uitableviewcell or set things in generic uitableviewcell accordingly. also, a notable mention would be to look into tableView:accessoryButtonTappedForRowWithIndexPath:

next you should use the plist as follows to read it:

NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"league" ofType:@"plist"];
contentArray = [NSArray arrayWithContentsOfFile:plistPath];

This could be called in your [uitableview cellForRowAtIndexpath:] delegate method and parse it accordingly

cheers~ fy

0

For adding a UISwitch to a UITableViewCell, you may want to have a look at the answer to this question on SO.

Community
  • 1
  • 1
tilo
  • 14,009
  • 6
  • 68
  • 85