Last active
August 29, 2015 14:17
-
-
Save 98chimp/8082ece9c41c8c70ef27 to your computer and use it in GitHub Desktop.
Revisions
-
98chimp revised this gist
Mar 20, 2015 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ 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]; }]; -
98chimp created this gist
Mar 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ Q1. 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.