answer dialog box failure in iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rcmills
Posts: 72
Joined: Wed Nov 21, 2018 8:27 pm

answer dialog box failure in iOS

Post by rcmills » Fri Aug 22, 2025 9:41 pm

I have run up against (created?) a catastrophic bug in my iOS build, which I cannot understand.

The answer dialog function has begun stopping the running of my code cold, after one execution. It begins doing this after running my initialization section (which does use the answer dialog command several times), and then is "idling" - waiting for execution of a variety of options via button clicks. At that point, the answer dialog queries the user regarding further options, and stops cold. The "it" variable is does not even populate with the response to the click in the dialog box. I get no error message trapped by any "on errorDialog" or "try/catch" method. I only tracked the point of failure down by inserting code sections before and after various "answer" commands to log messages into error log fields.

The error is not occurring when running the code in the IDE, only in the iOS build.

Has anyone ever run up against something like this? I have beat my head against this wall for a week or more, now. I can't fathom what weird code I could have placed in my app to create this behavior. It occurs with builds from LC 9.6.10 as well as LC 10.0.2.

stam
Posts: 3089
Joined: Sun Jun 04, 2006 9:39 pm

Re: answer dialog box failure in iOS

Post by stam » Sat Aug 23, 2025 10:01 am

You probably need to post some code. This sounds like it may be an inadvertent effect of your handler code and it may be easier to debug sharing it here...

rcmills
Posts: 72
Joined: Wed Nov 21, 2018 8:27 pm

Re: answer dialog box failure in iOS

Post by rcmills » Sat Aug 23, 2025 4:16 pm

I'm afraid the code around the answer dialog is quite mundane. I think the problem is somewhere else in the code (total code around 2000 or so lines), as the area where the problem is now occurring was not modified for weeks, while I worked on other sections. Here is the code where the problem occurs, however.

Code: Select all

   go cd 1
   
   show img "imgPhoto"
   --hide widget "spinner" of cd 1
   put empty into pieceID
   hide graphic "picture frame"
   
   
   --answer "Use this pic?" & cr & "Click OK to start." with "Cancel" or "OK" --as sheet
   get "OK"
   
   if it = "Cancel"
   then
      put false into sDragging
      hide image "imgPhoto"
      
      answer "Do you want to choose another picture?" with "No" or "Yes" --as sheet
      if it = "No"
      then
         exit to top
      else
         go cd "picture card"
         exit to top
      end if
   end if
You see my temporary workaround, getting the OK without asking. I guess I may have to "roll my own" answer dialog, and move on.

Post Reply