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 08-23-2011, 03:06 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 6
ncotter is on a distinguished road
Exclamation Save data to a textfield & tabel view

Hello everyone

I really need some help in saving data for my app i really don't care how it is saved but just saved i have searched forever and cant find anything that works if you can help wih either please make a project and upload it to mediafire or somthing simillar and in the project with lots of //comments to explain//

I am sorry for comming across needy i am aproching a deadline

thank you so much for helping in advance
ncotter is offline   Reply With Quote
Old 08-23-2011, 05:43 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

the next time don't post a newbie request to advanced discussions.

However if you want to save something locally, look at NSUserDefaults Class Reference
__________________
dany_dev is offline   Reply With Quote
Old 08-28-2011, 02:15 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,002
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by ncotter View Post
Hello everyone

I really need some help in saving data for my app i really don't care how it is saved but just saved i have searched forever and cant find anything that works if you can help wih either please make a project and upload it to mediafire or somthing simillar and in the project with lots of //comments to explain//

I am sorry for comming across needy i am aproching a deadline

thank you so much for helping in advance
You want to save the contents of a text field so it's still there when you relaunch your app?



Use code like this:


Code:
NSString* fieldText = myTextField.text;
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: fieldText forKey: @"fieldTextKey"];

Then, in your view controller's viewDidLoad method, read back the value:

Code:
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString* fieldText = [defaults stringForKey: @"fieldTextKey"];
myTextField.text = fieldText;
You would need to replace "myTextField" with the name of your text field.

No, I'm not going to create a full project for you that does this. Unless, of course, you'd like to hire my company to do this for you...
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
data

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: 394
15 members and 379 guests
Absentia, bignoggins, Diligent, dre, epaga, hussain1982, LunarMoon, momolgtm, Newbie123, omagod, Paul10, pinacate, revg, skog, taylor202
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,643
Threads: 94,110
Posts: 402,860
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Diligent
Powered by vBadvanced CMPS v3.1.0

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