Skip to content

Instantly share code, notes, and snippets.

@rnapier
Created May 30, 2012 17:49
Show Gist options
  • Save rnapier/2837909 to your computer and use it in GitHub Desktop.
Save rnapier/2837909 to your computer and use it in GitHub Desktop.
Trying to ignore a property with SMXObject
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