]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Library.mm
CYONify NSSet as [NSSet setWithArray:@[...]] call.
[cycript.git] / ObjectiveC / Library.mm
index 3cf9e8a0d5122a60e36a1d89ea8eac50711cad9c..355966fd87cb82b0a975b8e3db4fd9fa3c353277 100644 (file)
@@ -1109,6 +1109,19 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) {
     return [[self description] cy$toCYON:objective];
 }
 
+@end
+/* }}} */
+/* Bridge: NSSet {{{ */
+@implementation NSSet (Cycript)
+
+- (NSString *) cy$toCYON:(bool)objective {
+    NSMutableString *json([[[NSMutableString alloc] init] autorelease]);
+    [json appendString:@"[NSSet setWithArray:"];
+    [json appendString:CYCastNSCYON([self allObjects], true)];
+    [json appendString:@"]]"];
+    return json;
+}
+
 @end
 /* }}} */
 /* Bridge: NSString {{{ */