native.showAlert

Hi there,

I am struggling a little bit with using native.showAlert. I can use one quite happily, but sometimes one of my alerts can end up calling another one - at which point my app crashes in the simulator, and I get warnings in the terminal window:
[lua]: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 1212[/lua]

I have simplified my code so that you can see exactly what is happening:

[lua]local alert1, alert2
local fAlertClick1, fCallAlert2

fAlertClick1 = function(event)
fCallAlert2()
end

fCallAlert2 = function()
alert2 = native.showAlert(“Two”, “Hello Alert 2”, {“OK”})
end

alert1 = native.showAlert(“One”, “Hello Alert 1”, {“OK”}, fAlertClick1)[/lua]

I have tried using native.cancelAlert, but this doesn’t help.
Can anyone help me?
Is this possible??

Many thanks

Robin [import]uid: 74250 topic_id: 14906 reply_id: 314906[/import]

Chaining alerts crashes on the simulator but try compiling for the Xcode simulator and you’ll see that it works fine. [import]uid: 22829 topic_id: 14906 reply_id: 55101[/import]

Hoan,

Thats great!!

I hadn’t thought to try it in the Xcode simulator (or on the device) for that matter.

Wonderful news, thank you for letting me know

Robin [import]uid: 74250 topic_id: 14906 reply_id: 55160[/import]