Skip to content

Commit 992bfb9

Browse files
committed
Reworked table controller state into a bit mask to coalesce state change into a single observation. fixes RestKit#753
* Added RKLogIntegerAsBinary() helper for logging bit masks * Implemented RKTableControllerDidLoadObjectsNotification for static and fetched results table controllers * Cleaned up state definitions within table controller * Documentation cleanups
1 parent 98c8780 commit 992bfb9

11 files changed

+995
-456
lines changed

Code/Support/RKLog.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,9 @@ void RKLogConfigureFromEnvironment(void);
205205
of a failed key-value validation error.
206206
*/
207207
void RKLogValidationError(NSError *);
208+
209+
/**
210+
Logs the value of an NSUInteger as a binary string. Useful when
211+
examining integers containing bitmasked values.
212+
*/
213+
void RKLogIntegerAsBinary(NSUInteger);

Code/Support/RKLog.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,13 @@ void RKLogValidationError(NSError *validationError) {
159159
}
160160
}
161161
}
162+
163+
void RKLogIntegerAsBinary(NSUInteger bitMask) {
164+
NSUInteger bit = ~(NSUIntegerMax >> 1);
165+
NSMutableString *string = [NSMutableString string];
166+
do {
167+
[string appendString:(((NSUInteger)bitMask & bit) ? @"1" : @"0")];
168+
} while ( bit >>= 1 );
169+
170+
NSLog(@"Value of %ld in binary: %@", (long) bitMask, string);
171+
}

0 commit comments

Comments
 (0)