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 08-17-2009, 03:49 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 10
faacs is on a distinguished road
Question Block user from saving images.

Hi all,

My app download images from internet and display to the users. I dont want to use caching and I also dont want user to save images on iphone anyway. So I need to know

1) what extra things I need to take care off to achieve this.

2_ Following is the code used to disable caching. Please correct me if I m wrong somewhere. I have written this code in ViewDidload method.

Code:
NSURLCache * cache=[NSURLCache sharedURLCache];
	[cache setMemoryCapacity:0];
	[cache setDiskCapacity:0];
	[cache removeAllCachedResponses];
My NSURLRequest is like following line.

Code:
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:ImageUrl] 
											   cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
Regards,

Ali.
faacs is offline   Reply With Quote
Old 08-17-2009, 06:23 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
NewiPhoneDeveloper is on a distinguished road
Default

Quote:
Originally Posted by faacs View Post
Hi all,

My app download images from internet and display to the users. I dont want to use caching and I also dont want user to save images on iphone anyway. So I need to know

1) what extra things I need to take care off to achieve this.

2_ Following is the code used to disable caching. Please correct me if I m wrong somewhere. I have written this code in ViewDidload method.

Code:
NSURLCache * cache=[NSURLCache sharedURLCache];
	[cache setMemoryCapacity:0];
	[cache setDiskCapacity:0];
	[cache removeAllCachedResponses];
My NSURLRequest is like following line.

Code:
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:ImageUrl] 
											   cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
Regards,

Ali.
Users can always grab the screen by pushing home & on/off button. I'm affraid you can not avoid that.
__________________
Websites:
Friendlydeveloper - Coding Blog
Codingsessions - Live iOS Training

iPhone Apps:
TextPal - Powerful group messaging,
icePhone

Find me on LinkedIn
NewiPhoneDeveloper is offline   Reply With Quote
Reply

Bookmarks

Tags
application data, cache

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: 313
12 members and 301 guests
chiataytuday, coolman, givensur, glenn_sayers, guusleijsten, jbro, mediaspree, mottdog, mtl_tech_guy, Punkjumper, vilisei, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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