What does people mean when they say don't make your NSArray's so long? Just wondering because I thought it was unlimited. Just say maybe I was using it for a UITableView.
Do you have an example of someone saying that? I can't imagine what they were thinking. Yes, you can store as much as you'd like until you run out of memory.
If you are *searching* a large amount of data then querying a database would be faster and more efficient than loading all of the data at once and looping through it; maybe that's what they meant?
Do you have an example of someone saying that? I can't imagine what they were thinking. Yes, you can store as much as you'd like until you run out of memory.
If you are *searching* a large amount of data then querying a database would be faster and more efficient than loading all of the data at once and looping through it; maybe that's what they meant?
What they say is
"If you keep adding objects on the main thread" then it will be all messed up.
"If you keep adding objects on the main thread" then it will be all messed up.
Were they talking about multi-threaded development? If so, it's true that NSMutableArray is not thread safe, so you better (1) lock it before adding/removing, and while getting an object from an index. (2) retain objects that you get from the array/dict in case another thread removes them from the array. Apple has a tech note with more info. Technical Note TN2059: Using collection classes safely with multithreaded applications
However, if you are not launching your own separate threads then there is nothing to worry about.
Hi all !! I have search a lot on the net and i am wondering :
- In a tab bar based app i'm creating an array from severals plist files, i create tempArray, i fill the array with my tempArray, and release the temp.
At the end my fullArray has 1101 objects, only string.
Is it too long, will it be a problem for iPhone memory ? Or maybe Apple does not like this way of using amount of data when i ll take my app to iTunes connect.
- In a tab bar based app i'm creating an array from severals plist files, i create tempArray, i fill the array with my tempArray, and release the temp.
At the end my fullArray has 1101 objects, only string.
Is it too long, will it be a problem for iPhone memory ? Or maybe Apple does not like this way of using amount of data when i ll take my app to iTunes connect.
I can't answer- you need to test on the phone to see how much memory it uses, and how fast it is. If it is too slow you'll have to switch to using core data (or SQLite) and ONLY loading the records you need, instead of loading all records at once.