My favorites | Sign in
Project Logo
                
Search
for
Updated Jan 18, 2009 by parmanoir
Splitcall  

A split call is a jQuery-like call, replicating ObjC's calling syntax where the method name is interwoven with its arguments.

ObjC call

The method name is setValue:forKey:, the call weaves method name and arguments.

[obj setValue:@"hello" forKey:@"key"];

Default JSCocoa call

The ObjC method name is translated to setValue_forKey_.

obj.setValue_forKey_('hello', 'key')

Can omit trailing underscore :

obj.setValue_forKey('hello', 'key')

Split call

The method name is extracted from the function (set) and its hash keys (value, forKey).

obj.set({ value : 'hello', forKey : 'key' })


Sign in to add a comment
Hosted by Google Code