开发者

Why doesn't NSOperationQueue execute when declared in a UIView

开发者 https://www.devze.com 2022-12-19 23:16 出处:网络
When I declare a NSOperationQueue member in a UIView subclass, operations send to it won\'t execute.

When I declare a NSOperationQueue member in a UIView subclass, operations send to it won't execute. When the queue is declared in th开发者_C百科e AppDelegate however the same operations are executed. Any ideas?

[EDIT] Ah, fixed it. Problem was my queue initialization was in the initWithFrame, which isn't called when it wakes from a nib. So annoying that these messages to a nil object disappear in void.

Thanks!


There's nothing to prevent an NSOperationQueue from running in a view. As long as you've properly initialized it and added operations to it.

I'd recommend putting a breakpoint on your initialization of the queue, just to make sure that's being execute.

If this doesn't help, add some code to this question and someone will help.

0

精彩评论

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