Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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
Add Comment
Please, Sign In to add comment