Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)dealloc {
- // Generic dealloc method for all subclasses
- unsigned int c;
- objc_property_t *properties = class_copyPropertyList([self class], &c);
- for(int i = 0; i < c; i++){
- objc_property_t property = properties[i];
- NSString *propertyAttributes = [NSString stringWithUTF8String: property_getAttributes(property)];
- NSRange range = NSMakeRange(1, [propertyAttributes rangeOfString:@","].location - 1);
- NSLog(@"Range: %@", NSStringFromRange(range));
- NSString *encodeString = [propertyAttributes substringWithRange:range];
- NSLog(@"Encode string: %@", encodeString);
- if ([encodeString hasPrefix:@"@"]) {
- [self setValue:nil forKey:[NSString stringWithUTF8String:property_getName(property)]];
- }
- }
- free(properties);
- [super dealloc];
- }
Add Comment
Please, Sign In to add comment