Re: Iphone Grouped Table View for Settings
Re: Iphone Grouped Table View for Settings
- Subject: Re: Iphone Grouped Table View for Settings
- From: Brian Slick <email@hidden>
- Date: Fri, 17 Jul 2009 00:49:13 -0400
I haven't played with sliders, but here is an example for a switch:
UITableViewCell *yourCell = [tableView
dequeueReusableCellWithIdentifier:YourCellIdentifier];
if (yourCell == nil)
{
yourCell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:YourCellIdentifier] autorelease];
UISwitch *switchView = [[UISwitch alloc] init];
[switchView setOn: <your boolean criteria>];
[switchView addTarget:self action:@selector(yourMethod:)
forControlEvents:UIControlEventValueChanged];
[yourCell setAccessoryView: switchView];
[switchView release], switchView = nil;
}
There are probably several ways of getting there.
Hope this helps.
Brian
On Jul 17, 2009, at 12:34 AM, Trygve Inda wrote:
I don't want to use the Settings app as I need a clean way for the
user to
get to the settings from within my app and then return to my app. So
I need
to build a grouped table view, with each cell containing a single
control
(and a label) like the settings app does.
For example, I need a table with two rows, each row needs a label,
slider
and text (numeric value of slider).
How can I do this? There seems to be no way to build it in IB
directly. I
need a way to make the two sliders IBOutlets so that I can
manipulate them.
As my cells will be static (just the label, slider, text), it seems
simple,
but I have found no examples of this.
I also need another group - same as above but with switches.
Thanks for any leads to examples or the best way to achieve this.
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden