IOS crash in iphone 6 plus

If you add the following lines to a timer (interval 18) it will work ok in simulator, iphone 4 . If run on a iphone6 plus it crashs out of the app. I think it also screws up memory if you trap any errors.

dim d(768,1280) as integer


that’d be one 60+ mb array in a 64 bit app

What’s the crash log look like?

This is a bug in the compiler with handling of two-dimensional arrays on 64-bit iOS.

64 BITS - 8 bytes per integer

so dim d(768,1280) as integer is 769 x 1281 x 8

my math is probably off by a factor of 10 too though :stuck_out_tongue:
6mb not 60
time for sleep I think :slight_smile:

Well you can alway use a dictionary with a key made up of the row & column like “row | col” (ie 1 | 1)
Basically fake an array and you can make it as many dimensions as you want and if there are “empty cells” they take no space

if you have to find the data without knowing what cell it is in the dictionary will suck
but then so will searching a 2D array

my desktop spreadsheet control (still a work in progress) implements a “2D” array of virtually unlimited size (restricted by memory) by using a dictionary. The nice thing is only populated cells take up any memory space. So a sheet with Cell(1,1) and Cell(1024,1024) takes up the same space as if it were Cell(1,1) and Cell(2,2)

Just use a PAIR datatype (if XOJO iOS has this) to use as the key [row:column]

or a dictionary with keys carefully constructed
I needed a sparse array yeas ago and built one in 2005 using just a dictionary
Look for sparse array on