Cocoa-Touch: performSelectorOnMainThread: weird behavior + crash

前端 未结 1 1199
说谎
说谎 2021-02-09 23:42

I have a situation where I\'m lazy loading images from the www.
It\'s a list of items, when one item is tapped, a detail view is pushed to a nav controller.

In that

相关标签:
1条回答
  • 2021-02-10 00:10

    You have:

    [requester performSelectorOnMainThread:@selector(dataReady) withObject:data waitUntilDone:YES;
    

    should be:

    [requester performSelectorOnMainThread:@selector(dataReady:) withObject:data waitUntilDone:YES;
    

    notice: @selector(dataReady:) (with colon) Since you're passing an argument to the method, it's presumed data ready is defined something like:

    - (void) dataReady:(NSData *)theData ...
    
    0 讨论(0)
提交回复
热议问题