0

I am working on a card game, as part of which I need to update my controller when touchesEnded. I am debating whether NSNotification is a way to go as compared with implementing a callback via Delegates.

The question: In general, using Objective-C, how can one make class A subscribe to events happening in class B?

Specifically I wonder whether how can one formally declare one class as delegate of another?

James Raitsev
  • 92,517
  • 154
  • 335
  • 470

1 Answers1

0

I"m not sure if you came across it but I did a quick google search pertaining to your topic and found a related SO post How do I create delegates in Objective-C? . I hope this helps lead you in the right direction! Also, though I'm sure you've read it already, here is the link to the MSDN page about the Delegate Class: http://msdn.microsoft.com/en-us/library/system.delegate.aspx

Community
  • 1
  • 1
Stephen Tetreault
  • 769
  • 1
  • 8
  • 26