Skip to content

Instantly share code, notes, and snippets.

@98chimp
Last active August 29, 2015 14:17
Show Gist options
  • Save 98chimp/8082ece9c41c8c70ef27 to your computer and use it in GitHub Desktop.
Save 98chimp/8082ece9c41c8c70ef27 to your computer and use it in GitHub Desktop.
Week02 - D04 Questions
Q1.A.
Q1.B. i) Any number of objects may receive the notification, not just the delegate object. This precludes returning a value.
ii) An object may receive any message you like from the notification center, not just the predefined delegate methods.
iii) The object posting the notification does not even have to know the observer exists.
Q1.C.
Q2. This code will maintain a strong reference to self which leads to a strong reference cycle and poor memory management. To avoid this problem, the code can be modified as follows:
[self setMySexyBlock:^{ [__weak self mySexyMethod]; }];
Q3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment