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 > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 02-21-2011, 02:53 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 284
BioBuff is on a distinguished road
Default Need some assistance in saving data from a textview

Thank you in advance for any assistance you can provide.

I have a universal binary that basically brings up a couple textviews in both the iPhone and iPad versions.

Let's say someone writes a 2-page letter in the textview - what is the easiest way to save this text so that it saves automatically?

The user writes the text, they leaves the textview, go elsewhere in the app, and when they return the text they wrote is still there.

Then, if they completely close the app (for example, iPhone gets a phone call) and user comes back a day later, the text is still there. Essentially, the text stays saved until user deletes it.

It needs to do the above for both the iPhone and iPad versions. Newbie to saving data here, so any help is appreciated.

Is there some standard "save" code that I can use for a basic textview?

Thanks.
BioBuff is offline   Reply With Quote
Old 02-22-2011, 06:52 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 284
BioBuff is on a distinguished road
Default

A friendly bump. Thanks.
BioBuff is offline   Reply With Quote
Old 02-22-2011, 12:49 PM   #3 (permalink)
iOS / MacOS Developer
 
bharath2020's Avatar
 
Join Date: Oct 2008
Location: Bengaluru
Posts: 151
bharath2020 is on a distinguished road
Default

1. setup a timer and periodically save the data in a separate thread.
2. whenever user leave the textview and enter other screen, pull the text from the text view and save it in a variable. this prevents you from losing the text in textview when textview id purged out due to memory warnings..
__________________
Bharath
iOS Blog : http://iphone2020.wordpress.com
bharath2020 is offline   Reply With Quote
Old 02-22-2011, 11:28 PM   #4 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 284
BioBuff is on a distinguished road
Default

Quote:
Originally Posted by bharath2020 View Post
1. setup a timer and periodically save the data in a separate thread.
2. whenever user leave the textview and enter other screen, pull the text from the text view and save it in a variable. this prevents you from losing the text in textview when textview id purged out due to memory warnings..
Thank you very much. I am trying to learn as much as I can here.

What would you recommend I use to save the data automatically upon app termination? I need data stored for a possibly a long time and everything needs to be saved.

Thanks again.
BioBuff is offline   Reply With Quote
Old 02-23-2011, 08:18 AM   #5 (permalink)
iOS / MacOS Developer
 
bharath2020's Avatar
 
Join Date: Oct 2008
Location: Bengaluru
Posts: 151
bharath2020 is on a distinguished road
Default

You probably have to do both. The seconds option does not say how/when to save. Rather it helps you in preventing the text being lost due to unloading of TextView on memory warnings.
__________________
Bharath
iOS Blog : http://iphone2020.wordpress.com
bharath2020 is offline   Reply With Quote
Old 02-23-2011, 08:59 AM   #6 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 284
BioBuff is on a distinguished road
Default

Quote:
Originally Posted by bharath2020 View Post
You probably have to do both. The seconds option does not say how/when to save. Rather it helps you in preventing the text being lost due to unloading of TextView on memory warnings.
Thank you.
BioBuff is offline   Reply With Quote
Reply

Bookmarks

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: 399
18 members and 381 guests
Brandt, coolman, Domele, Duncan C, fredidf, Free App Monster, givensur, iAppDeveloper, jbro, locombiano89, Mah6447, Meoz, simplymuzik3, SLIC, stanny, stevenkik, Tomsky, WeaselPig
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,863
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

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