iPhonePick
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 58
- Joined: Mon Dec 05, 2011 5:35 pm
iPhonePick
I am trying to put in a pick list in my (first) iOS app. I would like to use iPhonePick but I can't seem to get it work. Some very basic questions (sorry):
1. Do I put the iPhonePick statement in my button script? I tried that but it yakked at me.
2. How do I detect what has been selected?
Any help is greatly appreciated.
1. Do I put the iPhonePick statement in my button script? I tried that but it yakked at me.
2. How do I detect what has been selected?
Any help is greatly appreciated.
Re: iPhonePick
Hi...
an example that will work...
Page 42 of the iOS release notes 'modal pick wheel support' will guide you through...
be well
Dixie
an example that will work...
Code: Select all
on mouseUp
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end mouseUp

be well
Dixie
-
- Posts: 58
- Joined: Mon Dec 05, 2011 5:35 pm
Re: iPhonePick
Thanks so much. I read through the release notes. I copied and pasted your script into a button. Does it have to be a particular type of button? When I click on it, I get:
button "Option Menu": execution error at line 11 (Handler: can't find handler) near "iphonePick", char 1
I'm not normally this dense.
Any help is appreciated.
button "Option Menu": execution error at line 11 (Handler: can't find handler) near "iphonePick", char 1
I'm not normally this dense.

Re: iPhonePick
put the script in just an ordinary button... say, 'push button'...
be well
Dixie
be well
Dixie
-
- Posts: 58
- Joined: Mon Dec 05, 2011 5:35 pm
Re: iPhonePick
I opened a brand new 'push button'. When I tried to compile the code, i got:
button "Button": compilation error at line 2 (Chunk: can't create a variable with that name (explicitVariables?)) near "optionList", char 42
I declared optionList as a local variable. (Is that OK?) It compiled.
When I clicked on the button, I got:
utton "Button": execution error at line 5 (Handler: can't find handler) near "iphonePick", char 1
on mouseUp
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end mouseUp
local optionlist
on mouseUp
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end mouseUp
button "Button": compilation error at line 2 (Chunk: can't create a variable with that name (explicitVariables?)) near "optionList", char 42
I declared optionList as a local variable. (Is that OK?) It compiled.
When I clicked on the button, I got:
utton "Button": execution error at line 5 (Handler: can't find handler) near "iphonePick", char 1
on mouseUp
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end mouseUp
local optionlist
on mouseUp
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end mouseUp
Re: iPhonePick
Hi jn,
the mobile syntax will only work on mobile devices. In the IDE it will throw the error you describe.
try:
and see if that works for you. Now if you push the button in the IDE it will not throw an error and it will run on the mobile device. No need to declare the variable unless you turned "explicit variables" on.
Kind regards
Bernd
the mobile syntax will only work on mobile devices. In the IDE it will throw the error you describe.
try:
Code: Select all
on mouseUp
if the environment is "mobile" then
put "one" & cr & "two" & cr & "three" into optionList
iphonePick optionlist, 2
answer the result
end if
end mouseUp
Kind regards
Bernd
-
- Posts: 58
- Joined: Mon Dec 05, 2011 5:35 pm
Re: iPhonePick
This is great! Thanks so much for your help. I appreciate it.