BMI Calculator Example in iOS simulator

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 63
Joined: Thu Jun 07, 2007 1:30 am

BMI Calculator Example in iOS simulator

Post by tetsuo29 » Sat Jul 30, 2016 3:08 pm

I worked through the interactive welcome that shows how to build the BMI Calculator app.

When I try running this in the iOS simulator, I figured out that I have to include the headerBar widget on the Copy Files of the Standalone Application Settings in order for the the title and the clear button to appear at the top of the window.

Similarly, I have to include navbar widget for the navigation bar to appear at the bottom of the screen.

If I enter amounts in the height and weight boxes and then click Calculate BMI, nothing happens even though it works great in LC and in a standalone Mac app.

Also, even though I've included the browser widget in Copy Files, the browser loads nothing in the iOS simulator (works in the Mac standalone) and I verified that Safari works just fine in the simulator.

Any one know why the calculate bmi button doesn't seem to do anything in the iOS simulator? And, why the browser never loads the web page in the simulator?

I'm using LC 8.0.1 Indy and I have XCode 7.3.1 w/ iOS SDK 9.3 installed.

EDIT: The clear button does work, just not the calculate bmi button. I changed this post to reflect this.

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 63
Joined: Thu Jun 07, 2007 1:30 am

Re: BMI Calculator Example in iOS simulator

Post by tetsuo29 » Sat Jul 30, 2016 7:05 pm

A little more investigation on my part has figured out that events are firing but that any communication with the outside world isn't working. This seems to prevent the browser object from loading a web page and also doesn't allow the getBMI function to get results back via HTTP. Is there some setting I'm missing that will allow and app to communicate via http in the iOS simulator?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5775
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: BMI Calculator Example in iOS simulator

Post by jacque » Sun Jul 31, 2016 4:18 pm

Did you add libURL to the inclusions in standalone settings?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 63
Joined: Thu Jun 07, 2007 1:30 am

Re: BMI Calculator Example in iOS simulator

Post by tetsuo29 » Sun Jul 31, 2016 5:11 pm

Did you add libURL to the inclusions in standalone settings?
No, and I'm not 100% sure how to do this when building for iOS. Is it as simple as choosing "Internet" in the "Script Libraries" on the General page?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5775
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: BMI Calculator Example in iOS simulator

Post by jacque » Sun Jul 31, 2016 7:21 pm

It sounds like you're still using LC 7 or less. If I remember right, simple http calls should work on their own but it can't hurt to turn on Internet in inclusions. I can't recall now if that is necessary; in LC 8.1 it is turned on in the Inclusions pane by default but if it isn't, do that. You might also try moving to LC 8.x and see if that works out better.

Another thing to test is whether the app works on a real device rather than the simulator. The simulator has its own set of quirks.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: BMI Calculator Example in iOS simulator

Post by joel.epsteinBUS31vi » Mon Aug 08, 2016 10:24 pm

You might also want to check the "Settings" app while running the simulator. There's an option (sorry, I don't remember where just now) that asks whether or not you want the simulator to have network connectivity (or something like that). In the past, checking that option has been a big help.

Peace.

Joel

Post Reply

Return to “iOS Deployment”