Hi Ryley,
Can you e-mail me the latest version of “level1.lua”? Just want to see what changes you made…
Brent [import]uid: 200026 topic_id: 35463 reply_id: 141354[/import]
Hi Ryley,
Can you e-mail me the latest version of “level1.lua”? Just want to see what changes you made…
Brent [import]uid: 200026 topic_id: 35463 reply_id: 141354[/import]
In application loader you need to build the app using distribution for apple , u need to add it in you apple developer account in provisioning go distribution and add new distribution for apple store make.
after that in your corona sdk in build should be the distribution apple and buil your app , if u are using Mac automatic after build you should get the option to open loader program [import]uid: 180288 topic_id: 35463 reply_id: 140926[/import]
Yeah I got that, but when I build using distribution it doesn’t work on device, throws the error posted above. But only throws it with distribution, works fine with development
[import]uid: 28237 topic_id: 35463 reply_id: 140927[/import]
Hi @rf928,
Out of curiosity, is there a reason you’re executing these functions on all phases of your touch (i.e. not filtering it to one of them)? I assume you must have a specific reason for this?
Brent [import]uid: 200026 topic_id: 35463 reply_id: 140939[/import]
Hey,
I executed them all because it worked, and my coding skills are not the greatest. If there is a better way to do this, let me know as I am always ready to learn a new method.
In regards to the problem, I moved the pause button around in the storyboard files, and no success. I also tried re downloading the provisioning profiles and neither worked, same result. I am really really puzzled here, one of the few times I have tried all of my ideas for a solution and no success.
I appreciate your help,
Ryley [import]uid: 28237 topic_id: 35463 reply_id: 140952[/import]
Hi Ryley,
First, let’s fix the touch thing and see what happens. 
The easiest method would be to change the “touch” to a “tap”, which doesn’t need phases. So in Line 30 of your example code, change it to:
pauseBtn:addEventListener("tap", onPauseBtnRelease)
Do the same thing for your restart button.
What was happening in your current code was that the touch listener was reading in every phase of the touch including every tiny movement of it, i.e. if you did a slight drag across the screen. So, you were likely triggering every command in the “onPauseBtnRelease” and “onResetBtnRelease” functions about 10-20 times in a tiny amount of time, including pausing physics and audio (or resuming them). In effect, it’s like a burst of commands to those libraries.
That being said, it might be something else causing the core error that you report, but let’s start there and see what happens.
Best regards,
Brent [import]uid: 200026 topic_id: 35463 reply_id: 140962[/import]
Hello,
I switched them to a tap as mentioned. I have done that before as I did find it caused a few issues, but no change. Still getting the error from the Xcode organizer console with my iPad plugged in:
[text]
: Lua Runtime Error: lua_pcall failed with status: 2, error message is: ?:0: attempt to index global ‘pauseBtn’ (a nil value)
[/text]
The screen goes black on my iPad when I go to the scene, and nothing happens.
And to add to the question, it still doesn’t add up as to why it works under development profile and not distribution. I had this issue from the start, and thought I could upload under development… Guess not!
Ryley [import]uid: 28237 topic_id: 35463 reply_id: 140966[/import]
Hi Ryley,
I’m investigating this further. What version of Corona are you using to build with? And have you updated to the latest version of XCode and all of that nitty-gritty stuff? [import]uid: 200026 topic_id: 35463 reply_id: 140968[/import]
Yes the latest in the daily build section, as well as an Xcode update last night. I don’t have the numbers off hand, I’m not at my computer but it is all the latest, might I mention running on OSX 10.7 [import]uid: 28237 topic_id: 35463 reply_id: 140971[/import]
Hi Ryley,
Rob just addressed this in your related post. Distribution profiles (non-Ad-Hoc) are only for the App store and can’t be run on your device without going through the iTunes signing process (which associates the app with a specific device).
http://developer.coronalabs.com/forum/2013/01/30/build-itunes-connect
Hope this helps,
Brent [import]uid: 200026 topic_id: 35463 reply_id: 140991[/import]
Hey,
Nope. That doesn’t work, I am installing it all correctly from iTunes, I even tried Xcode and that just didn’t work.
It all installs fine, I can open it, my images and everything are there, but when I go to level1.lua which contains the code in question then I am met with the error!
In the end this better pay!! Haha
Ryley [import]uid: 28237 topic_id: 35463 reply_id: 140998[/import]
Very odd. So now this seems like an error in the code, regarding “pauseBtn”. To clarify, this is like “2 issues” now (the builds and the error report), so I’m not sure where we are… can you clarify exactly the behavior at this point in time?
Thanks,
Brent [import]uid: 200026 topic_id: 35463 reply_id: 141001[/import]
Right now I have my app. I build it using the Development profile on the build menu (CMD-B)
Installed to iPad using iTunes, works great. No errors, nothing. The pauseBtn works, no console errors and it works flawless in the simulator as well.
Build using Distribution profile (Ad Hoc OR App Store) and it looks good, install using iTunes, and onto iPad. Looks good, then go into the app, still looks good, the first menu works, then to the gameplay screen that contains the pauseBtn, and a black screen.
Look at the Xcode organizer console and it prints that error.
Very strange, I can’t figure it out [import]uid: 28237 topic_id: 35463 reply_id: 141002[/import]
Update (gerrrr)
I removed the pauseBtn from the level1.lua. Works fine now, but the same thing through all of the levels that are using the same method.
I can upload it like this, but it still doesn’t make sense and I would love to have a pause button in the game [import]uid: 28237 topic_id: 35463 reply_id: 141007[/import]
This is quite baffling… can you e-mail me a copy of “level1.lua” before you removed the pause button? I’d like to see all of the code. E-mail is brentATcoronalabsDOTcom.
Thanks! [import]uid: 200026 topic_id: 35463 reply_id: 141008[/import]
You’re telling me…
Email sent [import]uid: 28237 topic_id: 35463 reply_id: 141012[/import]
I just read this thread and thought I would ask. Could the underscore in the image folder name be an issue? I am not familiar with using them but I know I have read about issues in the past. If the pause button image isn’t loaded then “pauseBtn” will be nil and would error when you try access it. [import]uid: 56820 topic_id: 35463 reply_id: 141091[/import]
Hi @rf928,
I just glanced at your “level1.lua” code, and noticed some oddities. I think this is a scoping error, since you declare “pauseBtn” globally, but then you reference it above, outside the Storyboard “enterScene” function. My suggestion would be to create a local reference to this object near the top, so Lua recognizes it from the start. I haven’t followed through every aspect of the code, but I sense this is a scoping issue above all else.
I also see you’re using LevelHelper… didn’t know that. Honestly, I can’t vouch for what that product does, and what issues it might present.
Brent [import]uid: 200026 topic_id: 35463 reply_id: 141146[/import]
Sorry for late reply, we have baby calves popping out the wazoo here in AB. And semester start!
Anyways, Brent, I emailed it to you. Hope you can still see the differences
@cyberparkstudios: I do understand what you mean, I ran into this issue with naming conventions through storyboard. I learned there, and have triple checked everything I can. The spelling and capitalization is all correct. Then I renamed it, changed path, and no difference. It is so strange! Like you say it isn’t being called, which doesn’t make sense!
Is there a variable limit to global/local variable? [import]uid: 28237 topic_id: 35463 reply_id: 141798[/import]
I sent it to Apple without the pause button, I would rather have had it but wanted it out sooner than later.
I tried what both of you have suggested, I moved the images to the root folder and had the same issue. Then I moved the image calls all over the code, from every storyboard function I could. Nothing worked.
It really puzzles me as to how this is happening, and why? The development works, but it has to be a bug with Corona or something! It’s not LevelHelper either, I removed the reference to it and it still didn’t work.
Ryley [import]uid: 28237 topic_id: 35463 reply_id: 141343[/import]