views:

35

answers:

2

Hey guys, I have some questions would like to ask:

  • I wanna ask how can I store the image so that next time when the user open the app and the app will show the image which previously he just choose it?

  • The image will be taken from either Photo Library or Camera Photo so I don't think I can get the path for the photo and store only the path right?

Anyway I can do that ?

A: 

probably cache the image in your app's documents folder(or nsuserdefaults), store the path in nsuserdefaults and load it up in applicationDidFinishLaunching.

nickthedude
but what is the path for image? because that path is in photo library or camera library?
Birdkingz
if you can get the image you want into a uiview then just render the context and save it as nsdata, dont worry about the path. basically you're making a new image so you'll be breaking any link to the original if you need it then you'll probably have to think of something else.
nickthedude
+1  A: 

you convert that image into NSData And store that NSData in plist file at applicationDidFinishLaunching.

NSData *Data = UIImageJPEGRepresentation(your image, 1);

priyanka