Unexpected behavior in iOS app
Terry Vogelaar
tvogelaar at de-mare.nl
Thu May 12 00:53:28 EDT 2011
Hi Jacque,
Eureka! That helped. There was indeed a problem with my actual script. When I wrote this question, I made some changes to shorten it somewhat. That actually solved it. So there is nothing wrong with the script I showed...
For the ugly option menus, I found a workaround. I thought I could solve it by using blending inks. I played around with text colors, border colors and blending inks, but unfortunately none of these blending inks seemed to work in iOS either. But fortunately the blendLevel does. So I used 100, which makes it totally transparent. And I put a button behind it to take care of the 'looks'.
And thank you for the lockloc tip. I ignored to set that, so that was the problem.
But actually there is another minor weirdness I ran into. The on-screen keyboard types all caps until I manually hit the caps key.
Terry
Op 11 mei 2011, om 17:05 heeft J. Landman Gay het volgende geschreven:
> On 5/11/11 1:17 AM, Terry Vogelaar wrote:
>> I'm running into a few problems building an iOS app.
>>
>> The most important one is this one. I want it to retrieve data from an 18MB text file, because I want it to work when the device is not connected to the internet. So I tried this:
>> on preopenstack
>> put "file:"& specialFolderPath("documents")& "/Muziek.txt" into docsmap
>> if the environment = "mobile" then
>> answer "Download or use local?" with "Download" or "Local"
>> if it is "Download" then
>> put url "http://dl.dropbox.com/u/10128030/Muziek.txt" into muzieklijst -- not the actual url
>> put muzieklijst into url docsmap
>> else
>> put url docsmap into muzieklijst
>> end if
>> else
>> put url "file:~/Dropbox/Public/Muziek.txt" into muzieklijst
>> end if
>> -- and some additional processing of the muzieklijst data that works fine
>> end preopenstack
>>
>> As you can see, it intends to write the text file I expected the
>> download to be only the first time the app is used, or optionally
>> when I know the file has changed. It takes a few minutes staring at a
>> black screen, but eventually it works.
>>
>> But apparently it doesn't save the file on the iPod Touch. The
>> variable muzieklijst only contains data when it is freshly
>> downloaded. If I tap on the "Local" button, muzieklijst stays empty.
>
> Check to see if the path is really valid in iOS while the app is
> running. Add this to your script temporarily:
>
> put "file:"& specialFolderPath("documents")& "/Muziek.txt" into docsmap
> answer "File exists:" && there is a file docsmap & cr & docsmap
>
> See what it says. SpecialFolderPath should work, so I suspect the path
> isn't resolving correctly.
>
>> I see a beautiful picker on iOS when using a
>> button with the menuMode set to 'option'. But on screen, the button
>> looks 90'ish with an ugly border around it.
>
> I haven't played much with these yet, so can't say. Maybe someone else
> knows.
>
>>
>> Also, I applied a great technique I learned on the Beginners Mobile
>> Course on the Simulcast. I put a bunch of PNGs in a Resouces substack
>> and I copied the scripts from the Ticked Off stack, used in the demo.
>> It worked great; it scaled all the icons on the main stack. But as
>> soon as I switched an icon (using: "set the icon of me to 1023"), it
>> showed (the center portion of) the large version of that icon; not
>> the downscaled one I wanted to see.
>
> All the images in your resources stack need to have their lockloc set to
> true so they won't revert to their original dimensions. You only have to
> do that once, when you set up the images.
>
> --
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list