ios - Do multi-dimensional arrays eat memory and how do I free up their memory -
i have complex tableview. objective c
to populate number of labels in each cell had multi-dimension table composed of 2 nsmutablearrays (1 embedded inside other). result array had 3 columns per row.
to free memory used [arrayname removeallobjects];
well can did absolutely nothing.
this array (which per row holding 130 chars of data , in sample data had 30 rows) virus that's favourite food memory. ate chunks of 50mg there no tomorrow.
the removeallobjects did nothing recover memory.
i have searched high , low , find no clear way free memory when working nsmutablearrays , seems multi-dimensional ones cookie monsters.
in end removed multi-dimensional array , built single nsmutablearray of data concatenated string, substringed out 3 pieces of data when needed them.
memory returned normal.
this may not have been ideal solution. has found clear way of releasing memory of nsmutablearrays ?
it if knew language using. if you're writing in c, call
free(<array pointer>);
Comments
Post a Comment