From 0cf05c538877762c68710791b1e9f58750e56a2e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 19 Jan 2014 12:15:16 -0800 Subject: [PATCH] CYONify NSSet as [NSSet setWithArray:@[...]] call. --- ObjectiveC/Library.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 3cf9e8a..355966f 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -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 {{{ */ -- 2.49.0