Skip to content

Commit

Permalink
Merge pull request Xcode-Snippets#23 from LouisZhu/master
Browse files Browse the repository at this point in the history
add nscoding snippet, for NSCoding protocol methods
  • Loading branch information
mattt committed Oct 25, 2013
2 parents 0d4e35e + 1e48dfc commit 244934b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions nscoding.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// NSCoding protocol methods
// Placeholders for NSCoding protocol methods
//
// Platform: All
// Language: Objective-C
// Completion Scope: Class Implementation

#pragma mark - NSCoding

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
if (self) {
<#var#> = [aDecoder decodeObjectForKey:<#(NSString *)#>];
}
return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:<#var#> forKey:<#(NSString *)#>]
}

0 comments on commit 244934b

Please sign in to comment.