I have problem is using the API media.selecPhoto
Here is my codes. these are the sample code from corona
[lua]local function onComplete(event)
local photo = event.target
print( "photo w,h = " … photo.width … “,” … photo.height )
end
if media.hasSource( media.PhotoLibrary ) then
media.selectPhoto( { mediaSource = media.PhotoLibrary, listener = onComplete } )
else
native.showAlert( “Corona”, “This device does not have a photo library.”, { “OK” } )
end[/lua]
when I run in the simulator
it shows
Attempt to call field ‘selectPhoto’ (a nil value)
I dun know how to solve, please help