Last active
December 17, 2015 04:59
-
-
Save gin0606/5554288 to your computer and use it in GitHub Desktop.
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
// | |
// Created by gin0606 on 2013/05/10. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSMutableArray (NonRetainedObject) | |
- (void)addNonretainedObject:(id)anObject; | |
- (id)nonretainedObjectAtIndex:(NSUInteger)index; | |
@end |
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
// | |
// Created by gin0606 on 2013/05/10. | |
// | |
#import "NSMutableArray+NonRetainedObject.h" | |
@implementation NSMutableArray (NonRetainedObject) | |
- (void)addNonretainedObject:(id)anObject { | |
NSValue *v = [NSValue valueWithNonretainedObject:anObject]; | |
[self addObject:v]; | |
} | |
- (id)nonretainedObjectAtIndex:(NSUInteger)index { | |
NSValue *v = [self objectAtIndex:index]; | |
return [v nonretainedObjectValue]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment