• <legend id='VaqNu'><style id='VaqNu'><dir id='VaqNu'><q id='VaqNu'></q></dir></style></legend>
        <bdo id='VaqNu'></bdo><ul id='VaqNu'></ul>

    1. <tfoot id='VaqNu'></tfoot>

      1. <i id='VaqNu'><tr id='VaqNu'><dt id='VaqNu'><q id='VaqNu'><span id='VaqNu'><b id='VaqNu'><form id='VaqNu'><ins id='VaqNu'></ins><ul id='VaqNu'></ul><sub id='VaqNu'></sub></form><legend id='VaqNu'></legend><bdo id='VaqNu'><pre id='VaqNu'><center id='VaqNu'></center></pre></bdo></b><th id='VaqNu'></th></span></q></dt></tr></i><div id='VaqNu'><tfoot id='VaqNu'></tfoot><dl id='VaqNu'><fieldset id='VaqNu'></fieldset></dl></div>
      2. <small id='VaqNu'></small><noframes id='VaqNu'>

        NSURLConnection 不调用委托方法

        时间:2023-07-28

              <tbody id='5aJ3l'></tbody>
            <legend id='5aJ3l'><style id='5aJ3l'><dir id='5aJ3l'><q id='5aJ3l'></q></dir></style></legend>

              <i id='5aJ3l'><tr id='5aJ3l'><dt id='5aJ3l'><q id='5aJ3l'><span id='5aJ3l'><b id='5aJ3l'><form id='5aJ3l'><ins id='5aJ3l'></ins><ul id='5aJ3l'></ul><sub id='5aJ3l'></sub></form><legend id='5aJ3l'></legend><bdo id='5aJ3l'><pre id='5aJ3l'><center id='5aJ3l'></center></pre></bdo></b><th id='5aJ3l'></th></span></q></dt></tr></i><div id='5aJ3l'><tfoot id='5aJ3l'></tfoot><dl id='5aJ3l'><fieldset id='5aJ3l'></fieldset></dl></div>
              <tfoot id='5aJ3l'></tfoot>

              <small id='5aJ3l'></small><noframes id='5aJ3l'>

                  <bdo id='5aJ3l'></bdo><ul id='5aJ3l'></ul>

                  本文介绍了NSURLConnection 不调用委托方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在这里看到了类似的问题,但我找不到解决问题的方法.我在主线程中有一个简单的 NSURLConnection(至少我没有创建任何其他线程),但是我的委托方法没有被调用

                  I saw similar questions here, but I couldn't find solution to my problem. I have a simple NSURLConnection in main thread (At least I didn't create any other threads), but my delegate methods aren't get called

                  [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];
                  

                  并且没有调用任何方法,例如

                  and no methods called, e.g.

                  - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
                  {
                  NSLog(@"didReceiveResponse");
                  }
                  

                  self 也是 NSXMLParser 的委托,但我认为这应该不是问题,因为我在同一个项目的其他类中也有这个工作.我已经检查了 10 次,但没有发现任何问题.

                  self is also a delegate for NSXMLParser, but I think it should not be a problem, as I have this working in my other class in the same project. I checked everything 10 times already, but can't find any problem.

                  我在这里看到了一些解决方法:http://www.depl0y.com/?p=345 但我不喜欢它,可能有人知道更好的解决方案吗?谢谢

                  I've seen some hack to solve it here: http://www.depl0y.com/?p=345 but I don't like it, May be someone knows better solution? thanks

                  推荐答案

                  我知道的唯一原因是一个单独的线程(在调用委托方法时已经终止).

                  The only reason I know is a separate thread (that is already terminated when the delegate methods are called).

                  尝试 NSLog(@"Is%@ main thread", ([NSThread isMainThread] ?@"" : @" NOT"));就在 url 连接创建之前

                  Try to NSLog(@"Is%@ main thread", ([NSThread isMainThread] ? @"" : @" NOT"));right before the url connection creation

                  这篇关于NSURLConnection 不调用委托方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:试图理解 Swift 中的协议/委托 下一篇:NSNotificationCenter 与委托 - 哪个更快?

                  相关文章

                  1. <legend id='EanWx'><style id='EanWx'><dir id='EanWx'><q id='EanWx'></q></dir></style></legend>

                    <tfoot id='EanWx'></tfoot>

                      <bdo id='EanWx'></bdo><ul id='EanWx'></ul>

                    <small id='EanWx'></small><noframes id='EanWx'>

                      <i id='EanWx'><tr id='EanWx'><dt id='EanWx'><q id='EanWx'><span id='EanWx'><b id='EanWx'><form id='EanWx'><ins id='EanWx'></ins><ul id='EanWx'></ul><sub id='EanWx'></sub></form><legend id='EanWx'></legend><bdo id='EanWx'><pre id='EanWx'><center id='EanWx'></center></pre></bdo></b><th id='EanWx'></th></span></q></dt></tr></i><div id='EanWx'><tfoot id='EanWx'></tfoot><dl id='EanWx'><fieldset id='EanWx'></fieldset></dl></div>