Hi everyone!
I need some help with wax. I cant seem to find out how to remove a UIView object such as a datPicker for example from the screen. I've tried removeChild, removeFromParent. But I can't seem to figure out how to take it off the screen.
Help would be appreciated.
Thanks!
-Landon
JLS
Lead Coder and Designer
Comments
You need to remove the object from the superview.
If you want to learn about pure Lua for iOS, there is also my book ( http://www.apress.com/9781430246626 )
A little reading will definitely help.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
I tried what you just showed me, but it didn't work it keeps giving me an error.
SCREENS/Party.lua:12: attempt to index global 'datePicker' (a nil value)
stack traceback:
SCREENS/Party.lua:12: in function
Here is my code:
Thanks.
-Landon
Lead Coder and Designer
In all of your previous dicussion you have called it datPicker and now you are calling it datePicker.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
I ment to say datePicker if I spelt it wrong. And what do you mean by being available?
Does it have to be in it's own lua file?
Thanks
Lead Coder and Designer
-- file1.lua
local myvar
myvar = "show me"
-- file2.lua
print(myvar)
it will print nil as myvar is not accessable from file2, so either make it global by removing the local before the myvar or pass it as a parameter to file2 and save it somewhere in that scope.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Thanks for telling me that. I removed local in front of it, and it worked. Thanks.
Also, you may have answered this before for me, but I want to close the keyboard by clicking done on the keyboard when a UITextField is invoked. I found this code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}
But when I try to convert it into LUA, it gives me all sorts of errors. How would I convert this type of code?
Thanks.
Lead Coder and Designer