Skip to content

Commit b6fd2dc

Browse files
author
Ian Guedes Maia
committed
Minor updates;
Updated notification with block to remove observer;
1 parent 4458bf9 commit b6fd2dc

3 files changed

+5
-5
lines changed

notificationBlock.codesnippet

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<string>CodeBlock</string>
1010
</array>
1111
<key>IDECodeSnippetContents</key>
12-
<string>__block id notificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName: object:nil queue:nil usingBlock:^(NSNotification *note) {
13-
14-
notificationObserver = nil;
12+
<string>__block id notifObs = [[NSNotificationCenter defaultCenter] addObserverForName:&lt;#name#&gt; object:nil queue:nil usingBlock:^(NSNotification *note) {
13+
[[NSNotificationCenter defaultCenter] removeObserver:notifObs];
14+
notifObs = nil;
1515
}];
1616
</string>
1717
<key>IDECodeSnippetIdentifier</key>

notificationRemove.codesnippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>IDECodeSnippetUserSnippet</key>
2222
<true/>
2323
<key>IDECodeSnippetVersion</key>
24-
<integer>0</integer>
24+
<integer>2</integer>
2525
</dict>
2626
</plist>

sharedInstance.codesnippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
static &lt;#class#&gt; *_sharedInstance = nil;
1414
static dispatch_once_t onceToken;
1515
dispatch_once(&amp;onceToken, ^{
16-
_sharedInstance = [[&lt;#class#&gt; alloc] init];
16+
_sharedInstance = [[self alloc] init];
1717
});
1818

1919
return _sharedInstance;

0 commit comments

Comments
 (0)