Files
core-data-ensembles-mirror/Examples/Idiomatic/Shared/IDMMediaFile.m
Drew McCormack 6e46329d2b Added checks in awakeFromInsert: to make sure attributes (e.g. unique ids) are only initialized once.
awakeFromInsert: can be invoked multiple times when using child contexts.
2014-03-10 09:16:34 +01:00

24 lines
425 B
Objective-C

//
// IDMMediaFile.m
// Idiomatic
//
// Created by Drew McCormack on 21/02/14.
// Copyright (c) 2014 The Mental Faculty B.V. All rights reserved.
//
#import "IDMMediaFile.h"
@implementation IDMMediaFile
@dynamic data;
@dynamic uniqueIdentifier;
- (void)awakeFromInsert
{
[super awakeFromInsert];
if (!self.uniqueIdentifier) self.uniqueIdentifier = [[NSProcessInfo processInfo] globallyUniqueString];
}
@end