views:

87

answers:

2

Hy Everybody,

I hope enyone cann explain me how I can save an file on the iPhone

I get the file with NSURL so fare no prob. I'd like to donload the file and work with the donloaded file. But I have no Idea how.

A: 

Check this for downloading: Apple docs

After downloading the file, you will probably have the contents of the file on a NSMutableData.

Check the documentation on NSData, you have a method writeToFile:

Adri
that pretty much worked but the written file is empty.I tried NSKeyedArchiver now the file isn't empty anymore but it just contains signs?What's my fault?!?
zim
Ahh sorry my fault I saved the file at the request not when it's Downloaded.but I still got this at the top of the document:< bplist00ÔT$topX$objectsX$versionY$archiverÑTroot€£ U$nullÒWNS.dataV$classO(G >what's that anyway and how can I get rid of itand why does it creates a snapshop too?!?
zim
A: 

Create NSData with contentsOfURL Now use this data to write in a file. You can create file in the NSHomeDirecotry() using NSFileManager.

karim