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 01-31-2012, 12:28 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 45
Jakexx360 is on a distinguished road
Default Store Current URL With NSDefaults

My goal is to allow the user to set a new home page, and it does so by changing the default URL (Google) and replacing it using webView.request.URL.absoluteString

The problem is that it doesn't stay there when you boot up the app again after closing it.

So, how am I able to take that string and write it so that it is still there when you start the app, and if it isn't there and hasn't been set, use the default Google URL?

Thanks
Jakexx360 is offline   Reply With Quote
Old 01-31-2012, 01:29 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Seattle, WA
Posts: 408
RickSDK is on a distinguished road
Default

The answer is in the subject line of your own post. Use NSUserDefaults
__________________
Check out my apps

RickSDK is offline   Reply With Quote
Old 01-31-2012, 02:36 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 45
Jakexx360 is on a distinguished road
Default

Good job, I know that. The problem was that I don't know how to use them.

However, I was able to make a somewhat stable version using a mediocre tutorial I found on some website. All is well for now at least.
Jakexx360 is offline   Reply With Quote
Old 01-31-2012, 02:46 PM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Jakexx360 View Post
Good job, I know that. The problem was that I don't know how to use them.

However, I was able to make a somewhat stable version using a mediocre tutorial I found on some website. All is well for now at least.
In general, people on these boards take a dim view of "How do I do <some task which is well-documented and for which there are lots of examples available>?" type questions.

If you read the NSUserDefaults class reference, and read it again, and still can't understand what it's telling you, then post specific questions. "The docs say to do X, but when I try that, I get error Y" or even "Yhe docs say X, but I just don't understand what they are describing. What does X mean, and how do I use it?"

Those questions indicate that you're trying, and have specific things you need help with. Your question comes off as a "please spoon-feed me the answers because I am too lazy to do the work" request, which is irritating. That might not be your intent, but it IS the way it appears.

You'll get a whole lot more help if you try on your own first, and then ask for help if you have problems.
__________________
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
Old 01-31-2012, 05:30 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 45
Jakexx360 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
In general, people on these boards take a dim view of "How do I do <some task which is well-documented and for which there are lots of examples available>?" type questions.

If you read the NSUserDefaults class reference, and read it again, and still can't understand what it's telling you, then post specific questions. "The docs say to do X, but when I try that, I get error Y" or even "Yhe docs say X, but I just don't understand what they are describing. What does X mean, and how do I use it?"

Those questions indicate that you're trying, and have specific things you need help with. Your question comes off as a "please spoon-feed me the answers because I am too lazy to do the work" request, which is irritating. That might not be your intent, but it IS the way it appears.

You'll get a whole lot more help if you try on your own first, and then ask for help if you have problems.
Believe me, I had been trying for hours. The specifics part, however, I probably could have been more intuitive about. I was able to figure it out by myself though, but thanks =)
Jakexx360 is offline   Reply With Quote
Reply

Bookmarks

Tags
nsdefaults, nsstring, webview, xcode4.2

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: 421
16 members and 405 guests
Atatator, chiataytuday, condor304, dre, FrankWeller, imac74, ipodphone, jeroenkeij, kukat, LunarMoon, n00b, PowerGoofy, QuantumDoja, Retouchable, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,675
Threads: 94,124
Posts: 402,909
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Retouchable
Powered by vBadvanced CMPS v3.1.0

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