I have a class method that gets called by a view controller. I want the view controller to be aware of when the class method has finished its tasks (it has threads on it).
I think I should use delegation, but I need an id delegate
, and I can't call it by self.delegate
, because there is no self in a class method.
How should I do this?
Thanks!
You can store a delegate at class-level (even separate from an object-level delegate), but it sounds a bit fishy to me. Here's how you'd do it:
In your header file:
In your implementation file:
To actually use this code, you simply set the class-level delegate like an object-level delegate and wait for it to be called (you need to decide when
myCleanupClassMethod
is invoked):