views:

325

answers:

2

I writing an app for the iphone and I would like to save an image from it as the default.png for the next invocation. Is this possible? It seems as if the sandbox doesn't allow you to overwrite anything in its local filesystem.

A: 

No you cant, what you can do is save the image data to a file or using core data and then retrieve it for use.

So you can do something like if(dataIsThere) //use that data for image

else

use the default

Daniel
how do I use the saved image in place of default.png? My understanding is that the blackbox app initiation code does this
ennuikiller
what are u using the image for?
Daniel
i want to use it as the splashscreen of the next app invocation
ennuikiller
Right, so assuming u are using a uiimageview for ur splash screen u can retrieve the data from the file if it's null u just initialize the uiimageview with th default image, if it's not empty u can use [UIImage imageWithData:data] to make the new image to put on ur imageview
Daniel
ok thanks!I'll give that a try
ennuikiller
This is completely incorrect. Daniel, Default.png is not being displayed in a UIImageView by his app, it is a special image stored in an app bundle that the system displays BEFORE it starts your apps run loop, you can't manipulate it in anyway, and by the time any of your app code runs the image is gone.
Louis Gerbarg
+4  A: 

No, you can't. It used to be possible to make Default.png a symbolic link into your Documents folder, then to rewrite the location it pointed to, but functionality was removed in 3.0. You should file a bug with Apple explaining your needs.

Louis Gerbarg
I read your comment, if what you said is true, then i misunderstood the question
Daniel