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

iOS Swift Basics (retired) Collections What is a Dictionary?

Maximum number of items in Array/Dictionary?

I'm wondering if an array or dictionary would be the correct way to store data in a 'ticklist' which could contain up to 500 items. Is there a maximum number of items that arrays or dictionaries can efficiently use? Thanks for any advice!

2 Answers

Holger Liesegang
Holger Liesegang
50,595 Points

Welcome to Treehouse, Alastair Downie !

The perfect answer can only be "it depends" but IMHO a max of 500 items should be totally ok in most cases if the size of each item isn't too big :)

...also (as always) you might want to have a close look at memory usage at runtime as different iOS devices are equipped with different amounts of RAM

...and if it's getting bigger you might want to think about the usage of e. g. Core Data --> Build a Diary App Using Core Data

Thank you Holger! That's given me sufficient confidence to go ahead and start experimenting...

Cheers,

Al