views:

31

answers:

1

hi all ! 

i create an array using : 

NSURL *url = [NSURL URLWithString:@"http;//www.myadress.myplist.plist"];f

NSArray *tmp = [NSArray arrayWithContentsOfURL:url];

how do i know when the download is complete ? 

thanks to all !

A: 

-[NSArray arrayWithContentsOfURL] is a synchronous method--the thread will block until the download is complete. (For this reason, it's usually a bad idea to use it on the main thread--either use it on a separate thread or use the asynchronous NSURLConnection methods instead).

eman
this want i want because i make download ina alert viewbu what will happen if the user ends the app ??? during download thanks
Floo
If the app is closed, the download is cancelled and the memory is reclaimed. Also, to let you know, if you call this method on the main thread, your app will freeze until the download is finished.
eman