There is one serious bug while using “network.request”
when u’r using serval network.request in a very very short time.
U will find it fail fetching datas.
It happens only in iOS6.
So if u r using network.request in your app.
Be careful, if u wanna know how it happened?
Try code below in iOS5 and iOS6, u will find the difference very obviously.
widget = require "widget"
function updateOfficialLottery(callbackListener)
local function networkListener( event )
if ( event.isError ) then
native.showAlert("error", "request error", {"OK"})
else
end
native.setActivityIndicator(false)
end
network.request( "http://thedoubleyoungs.appspot.com/json/lottery.do?method=get&date=101/09/28", "GET")
network.request( "http://thedoubleyoungs.appspot.com/json/lottery.do?method=get&date=101/09/27", "GET")
network.request( "http://thedoubleyoungs.appspot.com/json/lottery.do?method=get&date=101/09/26", "GET", networkListener)
-- network.request( "http://developer.coronalabs.com/forum/2012/08/09/searchable-list-view", "GET", networkListener ,params)
end
local onButtonEvent = function (event )
native.setActivityIndicator(true)
updateOfficialLottery()
end
local myButton = widget.newButton{
id = "btn001",
left = 100,
top = 200,
label = "Request Button",
width = 150, height = 28,
cornerRadius = 8,
onRelease = onButtonEvent
}
put them in main.lua
and run in device
both iOS5 and iOS6.
and u will know what i said.
Be careful while u r using request in a very short time.
Plz fix it very soon.
Thanks
Owen [import]uid: 25057 topic_id: 31679 reply_id: 331679[/import]