Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-06-2010, 06:14 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 9
Default Editing, Tables & UITextField

I think that I must be missing something very basic here.
In Apple's sample code TaggedLocations, a UITableView with custom cells is used (both for the locations as well as the tags). The custom cells have a UITextField as part their view. Under normal (non edit) mode, these UITextField cells are non-changable. Once the edit button (self.editButtonItem) is pressed and the table is in edit mode, these UITextField cells become editable.

In my code (based upon this example), my UITextField cells are editable all the time (both in Editing/Done modes). I can turn programmatically off the field editing by using .enabled property, but I can't see any such code in Apple's sample (e.g. in the setEditing: animated: method)

I am going crazy here - what am I missing that allows Apple to control the field level editing of a UITextField via the self.editButtonIem?

Many thanks for any suggestions.
simon88 is offline   Reply With Quote
Old 01-06-2010, 06:27 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,129
Default

Code:
@implementation EditableTableViewCell

@synthesize textField;


- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
   // The user can only edit the text field when in editing mode.
   [super setEditing:editing animated:animated];
   textField.enabled = editing;
}


- (void)dealloc {
   [textField release];
   [super dealloc];
}
__________________
BriTer Ideas LLC - Code review, consulting, development. PM for pricing.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
BrianSlick is offline   Reply With Quote
Old 01-06-2010, 06:35 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 9
Default

Brian
In the UITableViewCell's code!
Sincere thanks
Simon
simon88 is offline   Reply With Quote
Reply

Bookmarks

Tags
self.editbuttonitem, uitableviewcell, uitextfield

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 234
15 members and 219 guests
ADY, Alsahir, cacao, dacapo, Dani77, Desert Diva, djohnson, HemiMG, jansan, M@realobjects, MarkC, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:54 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0