Invoking protocol method on the main thread

2012-11-15 Thread Graham Cox
Hi all, I have a formal protocol for a notification callback I want to make. The protocol inherits the NSObject protocol. The caller accepts only objects conforming to this protocol as its delegate. When it's time to invoke the callback, I'd like to do so on the main thread, since the caller

Re: Invoking protocol method on the main thread

2012-11-15 Thread Greg Parker
On Nov 15, 2012, at 3:17 PM, Graham Cox graham@bigpond.com wrote: I have a formal protocol for a notification callback I want to make. The protocol inherits the NSObject protocol. The caller accepts only objects conforming to this protocol as its delegate. When it's time to invoke the

Re: Invoking protocol method on the main thread

2012-11-15 Thread Graham Cox
On 16/11/2012, at 10:23 AM, Greg Parker gpar...@apple.com wrote: The simple solution is to declare your property as NSObjectMyProtocol* . D'oh!! Thanks - that was simple. I thought I'd tried it, but my syntax was wrong: I had NSObject*MyProtocol --Graham

Re: Invoking protocol method on the main thread

2012-11-15 Thread Seth Willits
On Nov 15, 2012, at 3:17 PM, Graham Cox wrote: How can I invoke a method of my protocol on the main thread? Aside from Greg's simple suggestion, GCD is your friend. Then you're not beholden to a single method call, or the interface requirements of the performSelector methods.