Does iOS support something like
s = { x:3,y:5 , o:{x:0,y:1}}
like in Javascript?
Or what is the best way to use something like this in iOS?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A literal translation would be :
But literal translations, even in programming languages, are not best. It all depends on the context and what you need to accomplish. There’s probably less code required depending on what you need.
EDIT: There’s now a new literal syntax allowing to shrink this code further:
This syntax implicitely creates the NSDictionary & NSNumber objects.