Native text field inhibits IDE

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Native text field inhibits IDE

Post by grovecat » Thu Mar 29, 2012 7:44 am

I create a native text input on my opening card inside the on OpenCard script, and I delete it via the on CloseCard script. The deletion is necessary to stop the field contents showing on other cards.

When the card opens, the IDE generates an error, which I can ignore. However, when I go to move to another card, the IDE won't let me because of the delete control error. So I have to comment out the iPhoneControlDelete command until I have finished editing, then remember to activate it again to give the correct performance on the iPad when I generate the Standalone app.

I thought that checking the Hide Errors box in Preferences may stop the behaviour but it does not. So the question is -- How can I stop the IDE from choking on the iPhoneControlDelete command?

TIA
Don

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4178
Joined: Sun Jan 07, 2007 9:12 pm

Re: Native text field inhibits IDE

Post by bn » Thu Mar 29, 2012 8:14 am

Hi Don,

enclose your code in a conditional "if the environment is "mobile" then"

example

Code: Select all

on opencard
   if the environment is "mobile" then
      -- do your mobile specific initializations
   end if
   -- more code if needed
end opencard
likewise in all other handlers that address mobile specific stuff, in your case on closeCard

Kind regards

Bernd

grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Re: Native text field inhibits IDE

Post by grovecat » Thu Mar 29, 2012 8:27 am

Thanks Bernd

Works perfectly (of course).

Cheers
Don

Post Reply