Hi all,

In Xcode 5 and on Mavericks only. I'm only looking forward with this project.

This is fairly simple. I hope it comes across that way.

In the XIB editor, in the bindings editor I'm setting the value binding of a 
text field to a property of my application delegate. This property is mostly 
changed on a queue that is not the main queue (gcd queues, not NSOperation 
queues). Everything works as I would like but I'm concerned that it is only 
working out of luck rather than proper design.

Has something changed in Mavericks so that doing this is no longer a problem, 
or do I need to fix. Because this is a simple case (I know when I'm not on the 
main thread) I can easily fix with just wrapping the modification of the 
property like so:

__weak AppDelegate *weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^
{
  AppDelegate *strongSelf = weakSelf;
  if (strongSelf)
    strongSelf.isAgentRunning = isRunning ? @"Yes" : @"No";
});

But of course this is fine in my simple case, and since this is all I need I'll 
go with this. But for a more robust case where you don't have to worry about on 
what thread/queue the property was modified on I'm assuming the receptionist 
design pattern is the way to go. I've only just been reading about the 
receptionist design for the first time today. I'm amazed I missed it.

But what I suppose I'm asking is, are others using the receptionist design 
pattern, is it the way to go for a robust solution to this problem? What has 
been your experience?

Kevin


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to