You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, this is more of a question than an issue, but didn't know where else to ask:
In Objective-C, the names of methods are part of the arguments that you pass
along:
[array insertObject:obj atIndex:5];
The equivalent of the above message invocation in NodObjC syntax would be:
array('insertObject',obj,'atIndex',5)
So the even numbered arguments are the parts of the method name that will be
invoked, and the odd numbered arguments are the Obj-C arguments themselves. In
the above example, the insertObject:atIndex: function will be invoked.
How come these arguments aren't just passed as a dictionary instead?
array({insertObject: obj,atIndex: 5,});
I'm an Obj-C noob, so apologies if there's an obvious answer and I'm missing it. =)
Great stuff again!
The text was updated successfully, but these errors were encountered:
Actually, both of these syntaxes are supported, just the varargs format is "preferred" because of consistency. Consider a method that does not accept any arguments, you could not represent that using an Object, so a String is the only thing we can do:
Very cool stuff!
Sorry, this is more of a question than an issue, but didn't know where else to ask:
How come these arguments aren't just passed as a dictionary instead?
I'm an Obj-C noob, so apologies if there's an obvious answer and I'm missing it. =)
Great stuff again!
The text was updated successfully, but these errors were encountered: