So, I’m using the function below to return some tilt info. I am also removing the listener when I exit the scene using this - Runtime:removeEventListener( "accelerometer", onTilt ).
However I notice that while viewing the Xcode console, the accelerometer events keep firing after I change scenes. Apparently NOT unloading the event listener. Any thoughts as to how I can remove that so as to not eat up memory and battery? What am I doing wrong? Thanks.
Brian
local function onTilt( event )
motionx = (30 \* event.yGravity)
print(motionx)
if motionx \> 0 then
transition.to( homeSign, { time=300, rotation=3 })
else
transition.to( homeSign, { time=300, rotation=-3 })
end
end
Runtime:addEventListener( "accelerometer", onTilt )
[import]uid: 141982 topic_id: 37285 reply_id: 67285[/import]
Open Xcode and plug your iPad in to your computer. When you do that, your iPad will appear on the left side of the Organizer window (click on Window/Organizer in Xcode to view that window).
Once in the Organizer, find your iPad and then click on “console” in the left hand pane.
While viewing the console, you can see all kinds of cool stuff…your print output and lots of other goodies.
Hope that helps.
Brian [import]uid: 141982 topic_id: 37285 reply_id: 145588[/import]
Open Xcode and plug your iPad in to your computer. When you do that, your iPad will appear on the left side of the Organizer window (click on Window/Organizer in Xcode to view that window).
Once in the Organizer, find your iPad and then click on “console” in the left hand pane.
While viewing the console, you can see all kinds of cool stuff…your print output and lots of other goodies.
Hope that helps.
Brian [import]uid: 141982 topic_id: 37285 reply_id: 145588[/import]