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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 05-21-2010, 10:31 PM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 4
jigzat is on a distinguished road
Default Saving UITextField content when scrolling

Hello everyone, this has become a cliche comment. I have been reading posts on this forum for some time and I have to tell you this is a great knowledge center and all the people who help newbies like me should be canonized. it is a very unrewarding activity. I just join because I am totally stuck at my work and I need some help.

I have a custom UITableViewController with some custom cells that hold some UITextFields so the user should enter some values on them and then tap on the done button up in the navigation bar to save all the information. The problem is, if the user scrolls down and then tap on the done button the information on the text fields that is out of sight doesn't get saved. I understand the why, the UITableViewCell's that are out of sight get unallocated, so when the user saves there is basically nothing on them although if the user scroll back the information remains on the fields.

So my question is how can I retrieve the content of the text fields for saving it?

I already tried with the UITextFieldDelegate protocol but the problem is that if the text field shows a correction and the user accept the correction it doesn't get saved it only saves the badly spelled word.
jigzat is offline   Reply With Quote
Old 05-22-2010, 12:30 AM   #2 (permalink)
Elegance is Infinite
iPhone Dev SDK Supporter
 
TapTouchClick's Avatar
 
Join Date: Jan 2010
Location: Bay Area, CA
Posts: 677
TapTouchClick is on a distinguished road
Send a message via AIM to TapTouchClick Send a message via Skype™ to TapTouchClick
Default

Maybe try using an array and store/save the values of the cells in the didEndOnExit method under the textField. Basically you would be saving it every time they finish typing in one. That way, you can pass the final values (stored in the array) to the next viewController on the stack, and it still has the values of the unallocated fields. Just one way.

HTH
__________________
Our website
TapTouchClick is offline   Reply With Quote
Old 05-22-2010, 10:48 AM   #3 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 4
jigzat is on a distinguished road
Default

Quote:
Originally Posted by TapTouchClick View Post
Maybe try using an array and store/save the values of the cells in the didEndOnExit method under the textField. Basically you would be saving it every time they finish typing in one. That way, you can pass the final values (stored in the array) to the next viewController on the stack, and it still has the values of the unallocated fields. Just one way.

HTH
Dude THANKKS A LOT. You pointed me to the right direction but it wasn't UIControlEventEditingDidEndOnExit it was something like these:

Code:
[campoTexto addTarget:self action:@selector(saveFieldContentForTextField:) forControlEvents:UIControlEventEditingChanged];
jigzat is offline   Reply With Quote
Old 05-16-2011, 12:19 PM   #4 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 84
vikinara is on a distinguished road
Default

Quote:
Originally Posted by jigzat View Post
Dude THANKKS A LOT. You pointed me to the right direction but it wasn't UIControlEventEditingDidEndOnExit it was something like these:

Code:
[campoTexto addTarget:self action:@selector(saveFieldContentForTextField:) forControlEvents:UIControlEventEditingChanged];
[quote] I have the same issue. Could you please let me know how you solved this. Thanks. Any help is appreciated.
vikinara is offline   Reply With Quote
Reply

Bookmarks

Tags
scrolling, uitableviewcell, uitexfield

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: 306
10 members and 296 guests
ajay123123, ashaman64, baja_yu, ChrisYates, guusleijsten, HemiMG, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,878
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

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