I have some NSDictionarys full of data and I have a method which utilizes the data. Which NSDictionary is used depends on some input from the user, so I was wondering how I could create a pointer to the NSDictionary with the data.
For example
The user chooses “option foo”, so the method will need to use the “foo dictionary”. Instead of copying the “foo dictionary” into a temporary dictionary, how can I reference it so that “tempdictionary” has the contents of “foo dictionary” for example.
That probably made no sense, but thanks in advance.
Copying doesn’t happen by default. Just grab the
NSDictionaryyou want and assign it to a new pointer:That will give you a pointer to the dictionary stored within
dataDictionary. It doesn’t make a copy unless you ask it to.