What's wrong on following URLConnection?

后端 未结 4 1714
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 03:17

See also:

Objective-C Asynchronous Web Request with Cookies

I spent a day writing this code and can anyone tell me what is wro

4条回答
  •  伪装坚强ぢ
    2021-01-15 03:40

    You say that you're using this in a modal dialog? A modal dialog puts the run loop into a different mode. You should be able to get this to work by scheduling it to run in the modal dialog run loop mode, in addition to the normal run loop mode. Try adding this line of code after you allocate connection in loadURL:

    [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSModalPanelRunLoopMode];
    

    Hope that helps.

提交回复
热议问题