Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kingthong

macrumors member
Original poster
Sep 20, 2010
62
0
Somewhere but not here.
Hey,

I've not been able to find any good info on editable detail views. can someone help me out with either some source code/blog or anything that might be of use to me.

what i'm trying to achieve is similar to this

http://i.imgur.com/wLW0T.jpg
(more specifically the picture on the right)

any help will be appreciated.
Thanks!
 

kingthong

macrumors member
Original poster
Sep 20, 2010
62
0
Somewhere but not here.
It just looks like a view controller with specific views in it suitable for the content being edited with buttons set for the leftBarButtonItem and rightBarButtonItem properties of the navigationItem. Probably presented modally.

Thanks. The buttons on the topbar are left and right bar button item.

I shoulda been a little more clear in the question but i was wondering how you would do the "repeat", "sound" and "snooze" part of the view that i've linked.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Actually this is a grouped table view.
My only questions is how to edit it and display the result of the editing in the cell itself?

Please elaborate on what you mean by "how to edit it". Because for the alarm setting example you're using, you'll see that 3 of the 4 rows actually push a new view controller onto the nav stack (2 of which are also grouped tables).
 

kingthong

macrumors member
Original poster
Sep 20, 2010
62
0
Somewhere but not here.
Hi Dejo.

What i exactly want to do is have a view like the alarm settings page.

When i click on the 'Repeat' cell, a action sheet should pop up with few options
and which ever option i click should be displayed in the same table cell. (like how the word 'Never' appears in the example picture i've linked).

I've basically not figured out the logic on how to do this.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
If that's what u want, shouldn't be so hard. there is a Special build in function for this, well, not function, but new Header files for this.
Go new file, Objective-C class, then select, instead of NSObject, TableViewCell, and tadaa :p
Because, what u sended, is the standard. u can customize it yourself by using NIB/Xib's.

If u want to use the standard build in go to your delegate methods of your UITableView like this

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:[B]UITableViewCellStyleValue2[/B] reuseIdentifier:CellIdentifier] autorelease];
		cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
	
	switch (indexPath.row) {
        case 0: 
			cell.textLabel.text = @"Title";
cell.detailTextLabel.text = @"Test";
			break;
        case 1: 
			cell.textLabel.text = @"Author";
cell.detailTextLabel.text = @"Test2";
			break;
        case 2:
			cell.textLabel.text = @"Copyright";
cell.detailTextLabel.text = @"Test3";
			break;
    }
    return cell;
}

Something like that
The most important is the thing i put in bold. u can edit it to your likings.
have fun
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.