Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

roeik

macrumors member
Original poster
Dec 25, 2008
80
0
Hi All,

My users need to download a data file once a week, so while they are downloading the data file I would like them to also download a new Default.png file I will store on a web server, so that they will see a different image the next time they load the app.

I already wrote the downloading algorithm, and I get the Default.png file to be stored in the "Documents" folder of the local library. How do I now move it (or directly stoer) to the images library, overwriting the existing file?
Any ideas?

I found this article, http://collison.ie/blog/2008/11/dynamic-defaultpng-files-on-the-iphone, but I need to figure out if there is a better way to store the image.

Thanks.
 
Because it takes my software 6-8 seconds to load, and I don't want to display another screen for 6 more seconds after the program loads.

I tried before to take out all the commands from the awakeFromNib function and decompose them in other functions which I call from ApplicationDidFinishLoading in the applicationDelegate, but it completely messes up my program and I get tons of bugs.

If I could just overwrite the Default.png file it would be ideal.
 
I tried before to take out all the commands from the awakeFromNib function and decompose them in other functions which I call from ApplicationDidFinishLoading in the applicationDelegate, but it completely messes up my program and I get tons of bugs.
awakeFromNib is probably not the correct place(s) for you do be doing all your "heavy-lifting". I think it would be much better to figure out how to place the burden of that work in spawned threads, called from applicationDidFinishLaunching:. Seems you are using awakeFromNib for something it's not really intended for, which is more UI setup related.
 
If I could just overwrite the Default.png file it would be ideal.

I don't think Apple makes this available to developers. The code is obviously there -- just look at Mail. This might be in a new SDK version. Who knows?

You might find a hack somewhere on the internet.
 
I think the problem with trying to change Default.png at runtime is that it's part of the app bundle and as such will be signed. If you change something in the bundle that will break the code signing and the app will not run. At least that's my understanding. Obviously some of the Apple apps are doing something like this without breaking but i wouldn't be surprised if apple built in specific exceptions for them.
 
It used to be able to be done by making default.png a symlink to an image in the documents directory as you have full control over them. It was never official though and I'm not too sure if Apple patched it as it was screaming out to be exploited in some way or another by the jailbreakers.

Mail probably does a similar thing by taking a screenshot of the app on exit and setting it up to be used as the apps default.png on the apps next launch.

You are better off taking dejo's advice and making the loading of your app asynchronous by using a seperate thread(s) for doing your heavy loading whilst still allowing your UI to breathe. This way your default.png would hardly show and you could load in a view that can be dynamic.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.