This file contains hidden or 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
- (BOOL)atomicCopyItemAtURL:(NSURL *)sourceURL | |
toURL:(NSURL *)destinationURL | |
error:(NSError **)outError | |
{ | |
NSFileManager *manager = [NSFileManager defaultManager]; | |
// First copy into a temporary location where failure doesn't matter | |
NSURL *tempDir = [manager URLForDirectory:NSItemReplacementDirectory | |
inDomain:NSUserDomainMask | |
appropriateForURL:destinationURL |
This file contains hidden or 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
@implementation UIControl (RepresentedObject) | |
static char kRepresentedObjectKey; | |
- (void)setRepresentedObject:(id<NSObject>)object{ | |
id assocObject = [self representedObject]; | |
if(assocObject != object){ | |
[assocObject release]; | |
objc_setAssociatedObject(self, &kRepresentedObjectKey, object, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} |