Just thought I'd share some discoveries I recently made in iOS programming in LiveCode. I've been setting up a UITextField in my application but, much to my chagrin, when I run it in the simulator it would crash on a regular basis. I finally figured out what the problem is. When using the iPhoneControlGet() function, if you are attempting to get a property that has not been set (for example, "text" if the user hasn't typed anything in the field yet) it will crash the app immediately. At least, it did in my experience. The way to fix it? When you're initializing your control, call iPhoneControlSet on your property and set it to a default value, like this
Code: Select all
iPhoneControlSet vControlId, "text", empty
Hope that saves someone an hour or so. I hope I'm mistaken, but I couldn't find any reference to this problem in the iOS release notes. I've filed a bug, and if you'd like to see a stack that demos how to crash or protect your UITextFields, see the bug report at http://quality.runrev.com/show_bug.cgi?id=9564 and the attached stack http://quality.runrev.com/attachment.cg ... ction=edit