0

Howto build an array of array of objects in swift ? The corresponding Java code looks like this :

ArrayList<ArrayList<Object>> arrayof_array_of_Objects=new ArrayList<ArrayList<Object>>();

2 Answers 2

1
var arrayOf_array_of_Objects: [[NSObject]] = [[NSObject]]()
Sign up to request clarification or add additional context in comments.

Comments

0

You can embedded array inside another array like that:

var arr: [[String]] = [["1", "2", "3"], ["A", "B", "C"]]

or empty array:

var arr: [[String]] = [[String]]()

This is array of String objects but you can replace String with any object you like. You can also embed more array inside, just follow the logic.

1 Comment

ok I see, thanks. In my case it would be : var arrayof_array_of_Objects = [[NSObject]]();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.