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.
views:
325answers:
2
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
2009-07-22 20:42:39
how do I use the saved image in place of default.png? My understanding is that the blackbox app initiation code does this
ennuikiller
2009-07-22 20:55:09
what are u using the image for?
Daniel
2009-07-22 20:57:51
i want to use it as the splashscreen of the next app invocation
ennuikiller
2009-07-22 20:59:22
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
2009-07-22 21:04:56
ok thanks!I'll give that a try
ennuikiller
2009-07-22 21:08:29
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
2009-07-22 21:58:36
+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
2009-07-22 22:00:32
I read your comment, if what you said is true, then i misunderstood the question
Daniel
2009-07-22 22:31:02