Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
A repeating element in an Objective C array
What is the reason/usage for having the same element (i.e
@"Bear") appear more than once in an
An array can often hold multiple items of the same value. For instance you may want to store the results of coin flips in an array. This would mean that the same to values of would be repeated over and over again in the array. You could then iterate over the array to count the number of each result.
If you are looking for a data type that would only hold one copy of any given value you should instead look at using a set.
Hope that helps and let me know if I can explain anything further.