Created
August 29, 2011 14:13
-
-
Save beelsebob/1178475 to your computer and use it in GitHub Desktop.
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
@interface MyClass () | |
@property (readwrite, strong) CFMutableSetRef __attribute__((NSObject)) completeContents; | |
@end | |
Boolean APIObjectEqual (const void *value1, const void *value2); | |
Boolean APIObjectEqual (const void *value1, const void *value2) | |
{ | |
return [(__bridge_transfer OSPAPIObject *)value1 isEqualToAPIObject:(__bridge_transfer OSPAPIObject *)value2]; | |
} | |
@implementation MyClass | |
@synthesize completeContents; | |
- (id)init | |
{ | |
self = [super init]; | |
if (nil != self) | |
{ | |
CFSetCallBacks callbacks = kCFTypeSetCallBacks; | |
callbacks.equal = APIObjectEqual; | |
[self setCompleteContents:CFSetCreateMutable(NULL, 0, &callbacks)]; | |
} | |
return self; | |
} | |
- (void)addObject:(OSPAPIObject *)apiObject | |
{ | |
CFSetAddValue([self completeContents], (__bridge_retained const void *)apiObject); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment