Created
May 30, 2012 17:49
-
-
Save rnapier/2837909 to your computer and use it in GitHub Desktop.
Trying to ignore a property with SMXObject
This file contains 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 characters
MyObject *one = [[MyObject alloc] init]; | |
one.message = @"Hello World!"; | |
one.intValue = 1; | |
MyObject *two = [MyObject objectFromArchive:[one archivedObject]]; | |
NSLog(@"Retrieved Message: %@", two.message); | |
NSLog(@"Should be 0, but is 1: %d", two.intValue); | |
@interface MyObject : SMXObject | |
@property (nonatomic, strong) NSString *message; | |
@property (nonatomic, assign) NSUInteger intValue; | |
@end | |
@implementation MyObject | |
@synthesize message; | |
@synthesize intValue=_intValue; | |
- (id) encodeValue:(id)value forProperty:(NSString *)property | |
{ | |
if ([property isEqualToString:@"intValue"]) { | |
return nil; | |
} | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment