Question about old hardware

On a complete side note (and not the cause of this issue)… you pass in the two tables as parameters for each insert.  It probably would be better code wise to pass in the actual image and such, perhaps something like:

for i = 1, #butTable, 1 do     local isCategory = false     local rowHeight = 65     local rowColor = { default={ 1, 1, 1 }, over={ 0.15, 0.4, 0.729, 0.2 } }     local lineColor = { 0.15, 0.4, 0.729 }     menuList:insertRow(     {         isCategory = isCategory,         rowHeight = rowHeight,         rowColor = rowColor,         lineColor = lineColor,         params = { button = butTable[i], label = labelTable[i] }     } ) end

then in your onRowRender() function you don’t have to look up the items in the table there.  This is just semantics but each insert inserts one row, that row should have the values for that row be the parameters.  If you just want to use the row’s index to look up the values, you don’t need to pass the values in via parameters at all.  Just define the table values at the top of the scene.

Rob

Hi Rob, thanks for that. I’ll have to look at my code again and see what I can do. I actually use a variation of this code in a ‘light’ version of my app where you can buy each menu item as an IAP, so the values of the table get shifted around based on what has been bought.

I think I’m going to just bite the bullet and find myself a iPhone 3GS to test on. I’ve only had 2 people contact me with this exact problem, 1 had a iPhone 3GS and the other had a iPhone 4. Both had iOS 6.1.x I believe.

One other thing, one of those people just told me the app actually worked for quite a while, then her iPhone 3GS had a software update and it was after that she started having it freeze. I’m trying to get more specifics as to what upgrades worked. But it looks like the version update from 6.1.5 to 6.1.6 might be the issue?

I’ll update my post once I can test my app on that iOS version with debugging.

The 3Gs is the lowest memory device out there.  If it ran for a while, perhaps you have a memory leak or peak memory usage that doesn’t show up except on older, low memory devices. 

Rob

So I was able to get my hands on a iPhone3GS with 6.1.6 and run my app with the console open in xCode. And sure enough there is a runtime error that doesn’t appear when I run my app on iOS 7

Aug 22 11:10:46 Steves-iPhone Machinist’sCalculator[352] <Warning>: Runtime error

?:0: attempt to index field ‘colours’ (a nil value)

stack traceback:

?: in function <?:1667>

(tail call): ?

?: in function <?:122>

(tail call): ?

/Users/Steve/Desktop/Machinist_Calculator/menu.lua:230: in function </Users/Steve/Desktop/Machinist_Calculator/menu.lua:169>

?: in function ‘dispatchEvent’

?: in function ‘gotoScene’

/Users/Steve/Desktop/Machinist_Calculator/main.lua:75: in main chunk

Aug 22 11:10:46 Steves-iPhone Machinist’sCalculator[352] <Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid ‘aps-environment’ entitlement string found for application

The problem is I don’t have “Colours” anywhere in my code?

Hi @spowell83,

Thanks for helping track this down. This is some kind of internal error and I’ll check into it a.s.a.p.

Thanks,

Brent

Just out of curiosity, do you have any widget theme files in your project?  Are you using or have you tried to use the open source widget library?

Rob

@Brent No problem. Can you let me know here what you find or a work around or when it might be fixed?

@Rob I actually do have the iOS theme image file in my project images folder still. I used to use it with my old UI design. But I don’t use it in any of the code currently, I’m not manually using any theme. I’m not sure what you mean about the open widget library, I’m just using what is included with Corona and is detailed in the Corona docs.

Please remove the old theme file.  The current widget library is expecting values in the theme file (one named “colours”) that doesn’t exist in the copy you have.  Since you don’t specify a theme, we are probably trying to default iOS 6 to use the old widget_theme_ios.lua file which when you have a copy of it in your project folder, it picks it up instead of the one from the core.

This would explain the behavior and error you are seeing.

Rob

This fixed it! Thanks Rob!