I have noticed that after removing a webview and setting it to nil and then leave the app and resume it, it will cause the app to crash while it tries to resume. I’ve only tried this on iOS. [import]uid: 17482 topic_id: 20839 reply_id: 320839[/import]
Could you file a bug with sample code to reproduce, please?
Peach [import]uid: 52491 topic_id: 20839 reply_id: 82139[/import]
if you run this in the iphone simulator or on the iphone and then go to the home screen then restart the app it will crash.
[lua]local object = native.newWebView(0,0,200,200)
object:setReferencePoint(display.CenterReferencePoint)
object.x=display.contentCenterX
object.y=display.contentCenterY
object:request(“http://www.google.com”)
local function removeWebView()
object:removeSelf()
object=nil
end
timer.performWithDelay(300,removeWebView,1)
[import]uid: 17482 topic_id: 20839 reply_id: 82356[/import]
Does the crash still occur if you remove the timer? [import]uid: 52430 topic_id: 20839 reply_id: 82392[/import]
removing the timer seems to cause it to crash immediately. [import]uid: 17482 topic_id: 20839 reply_id: 82393[/import]
i have the same problem, plus more!
you remove and nil it, it crashes the app.(that’s posted on a few threads)
so now i’m not removing it. but i am moving it then resizing it.
no problem there but once resized, if i change axis of the device (ipad2-from vertical facing to lying down or the other from lying down to vertical) it doubles it size, only once, it doesn’t keep resizing on every subsequent axis change.
local pdfview = native.newWebView( 0,0, 250, 150 )
pdfview:request( "test.pdf",system.DocumentsDirectory )
pdfview.x = 1024+(pdfview.width/2)
pdfview.y = 600+(pdfview.height/2)
function showwv()
if pdfview then
pdfview.alpha = 1
local function resize()
--transition.to(pdfview,{time = 1000,width = 768,height = 800})
pdfview.width = 768
pdfview.height = 800
timer.performWithDelay(1000,pdfview:request( "test.pdf",system.DocumentsDirectory ))
end
transition.to(pdfview,{time = 1000,x=384,y = 400,onComplete=resize})
--pdfview:request( "test.pdf",system.DocumentsDirectory )
--pdfview:removeSelf()
--pdfview = nil
end
end
showwvbut = widget.newButton{
left = 675,
top = 300,
label = "Showwv",
width = 75,
height = 38,
cornerRadius = 8,
onRelease = showwv
}
any ideas?
also is there anyway to set the reference to top left, i couldn’t seem to get that working it’s always centre centre [import]uid: 100222 topic_id: 20839 reply_id: 84221[/import]
I overcome the crashes by forward reference the init() function of my webView and pass it into scene:enterScene( event ) when I use storyboard.
webView = native.newWebView( 0,0, 250, 150 )
webView:setReferencePoint(TopLeftReferencePoint)
webView.x = 0
webView.y = 64
should fix your positioning. [import]uid: 13560 topic_id: 20839 reply_id: 84247[/import]