开发者

download in one click issue

i want to download file from web server and for that I need

1. send request for file path to web service method

2. receive this path on iphone side

3. now convert this path into NSURL

4. and finally send the request to web server for file download

right now i am doing all above but user have to

1. GetURL button and then

2. Download button

I want all this in one button click.

I tried for this too but problem is:

DownlloadButtonClick  
{  
   [self getURL];  
   [self DownloadFile];  
} 
getURL{  
    soapmsg  
    NSURL  
    NSURLReuest  
    ...  
    ..  
    ..  
} 

//after this i was expecting that connection should be done and data(filepath)开发者_Python百科 will be received, but this not happen

after getURL() method its back to above and call DownloadFile() and then app will crash...

app is crash this is accepted as i know its depend on getURL() method..

now my problem is where should i place getURL() method and DownloadFile() method so i can execute both on one click

thank you in advance


If I've understood your hard to decipher question correctly...

Your problem seems to be that you want to do an asynchronous action - getURL - and then when that has completed, another action. In your DownlloadButtonClick method, you want to think about only calling getURL (and not DownloadFile yet). In whatever code you have for handling the result of getURL (i.e. the URL has been fetched), you can then kick off your DownloadFile action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜