1

i am using couple of html pages which are loaded in UIWebView , there is a add to favorite button when clicked URL of the html page should be stored in SQLite Database.. how to do this ?
thanks in advance

1 Answer 1

1

you can save them in NSUserDefaults as follow:

Saving

 NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

// saving an NSString

[prefs setObject:@"TextToSave" forKey:@"keyToLookupString"];
[prefs synchronize];

Retrieving

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

// getting an NSString

 NSString *myString = [prefs stringForKey:@"keyToLookupString"];

then use it in your code to retrieve the URL of the html page

to link it with your webView :

NSString *myString = [prefs stringForKey:@"keyToLookupString"];
NSURL *url = [NSURL URLWithString:myString];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks lots :) do you know how to use ios facebook comment widget in iPad app?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.