// // NSObject+NGAAdditions.m // P4Menu // // Created by Michael Bishop on 10/11/11. // Copyright 2011 Numerical Garden LLC. All rights reserved. // #import "NSObject+NGAAdditions.h" @implementation NSObject (NGAAdditions) -(void)willChangeValuesForKeysInSet:(NSSet*)set { for (NSString * key in set) [self willChangeValueForKey:key]; } -(void)didChangeValuesForKeysInSet:(NSSet*)set { for (NSString * key in set) [self didChangeValueForKey:key]; } -(void)notifyChangesToKeyValues:(NSSet*)keys occuringInBlock:(void(^)(id unretainedSelf))block { [self willChangeValuesForKeysInSet:keys]; block(self); [self didChangeValuesForKeysInSet:keys]; } - (BOOL)NGA_allowsCallStackSymbols { return YES; } - (NSArray*)NGA_callStackSymbols { if (![self NGA_allowsCallStackSymbols]) return nil; @try { [NSException raise:@"NGAStackTraceException" format:@""]; } @catch (NSException *exception) { return [exception callStackSymbols]; } return nil; } @end