From: Jay Freeman (saurik) Date: Sun, 19 Jan 2014 20:15:16 +0000 (-0800) Subject: CYONify NSSet as [NSSet setWithArray:@[...]] call. X-Git-Tag: v0.9.500~34 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/0cf05c538877762c68710791b1e9f58750e56a2e CYONify NSSet as [NSSet setWithArray:@[...]] call. --- 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 {{{ */