Lost In Space
Journal
My revenge will be artistic, not personal
I’ll go anywhere with you
Discovery
“I can’t begin to tell you the things I discovered while I was looking for something else.”
Discovery
“I can’t begin to tell you the things I discovered while I was looking for something else.”
#deletegoogle
I’m turning my focus on Google. Awhile back I had mentioned the inevitability of deleting Facebook and now I am taking the steps to migrate everything off the multiple accounts and services I have for the same reasons.
Warrior Mode
So we signed up for another Warrior Dash. We’re in training mode because the race is in two weeks(!)
Warrior Mode
So we signed up for another Warrior Dash. We’re in training mode because the race is in two weeks(!)
#deletegoogle
I’m turning my focus on Google. Awhile back I had mentioned the inevitability of deleting Facebook and now I am taking the steps to migrate everything off the multiple accounts and services I have for the same reasons.
Riverside misadventures
NSCoding
.
@interface MyObject : NSObject <NSCoding>
@property (strong, nonatomic) NSString *firstValue;
@property (strong, nonatomic) NSString *secondValue;
@end
Your implementation must include encodeWithCoder
and initWithCoder
- (void)encodeWithCoder:(NSCoder*)encoder {
[encoder encodeObject:self.firstValue forKey:@"first_value"];
[encoder encodeObject:self.secondValue forKey:@"second_value"];
}
- (id)initWithCoder:(NSCoder*)decoder {
self = [MyObject new];
self.firstValue = [decoder decodeObjectForKey:@"first_value"];
self.secondValue = [decoder decodeObjectForKey:@"second_value"];
return self;
}
You can then store MyObject
in NSUserDefaults
like this.
MyObject *myObj = [MyObject new];
myObj.firstValue = @"This is the first value";
myObj.secondValue = @"This is another value";
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myObj];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"my_object"];
[[NSUserDefaults standardUserDefaults] synchronize];