summaryrefslogtreecommitdiff
path: root/CyteKit/WebScriptObject-Cyte.mm
diff options
context:
space:
mode:
Diffstat (limited to 'CyteKit/WebScriptObject-Cyte.mm')
-rw-r--r--CyteKit/WebScriptObject-Cyte.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/CyteKit/WebScriptObject-Cyte.mm b/CyteKit/WebScriptObject-Cyte.mm
index 9df6f85..36b02dd 100644
--- a/CyteKit/WebScriptObject-Cyte.mm
+++ b/CyteKit/WebScriptObject-Cyte.mm
@@ -53,4 +53,17 @@
return [self webScriptValueAtIndex:index];
}
+- (NSUInteger) countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)objects count:(NSUInteger)count {
+ size_t length([self count] - state->state);
+ if (length <= 0)
+ return 0;
+ else if (length > count)
+ length = count;
+ for (size_t i(0); i != length; ++i)
+ objects[i] = [self objectAtIndex:state->state++];
+ state->itemsPtr = objects;
+ state->mutationsPtr = (unsigned long *) self;
+ return length;
+}
+
@end