Created
February 9, 2009 21:47
-
-
Save farcaller/61031 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (id)dictionaryWithObjectsAndKeys:(id)firstObject, ... | |
{ | |
// XXX: duplicate implementation is bad, but so it's done in CPArray | |
// The arguments array contains self and _cmd, so the first object is at position 2. | |
debugger; | |
var d = [self alloc]; | |
var arglist = [d, "initWithObjectsAndKeys:"]; | |
for(var i = 2; i<arguments.length; ++i) | |
arglist[i] = arguments[i]; | |
var methodImpl = class_getInstanceMethod(self, "initWithObjectsAndKeys:").method_imp; | |
return methodImpl.apply(d, arglist); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment