hi there,
i wonder anyone here ever test an app where it work correctly in corona terminator but not iOS simulator?
i have my app tested (using corona)
but when i exported to iOS simulator to run, i hit following error
http://img225.imageshack.us/img225/941/screenshot20111030atam0.png
below is my code, i suspect due to i am reading file from either resource folder or document folder.
Can anyone tell me where to dig the log file as well.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | --[[ Game Mode : ABC ALPHABET ======================================================================== ]] module(..., package.seeall) new = function ( params ) ------------------ -- Imports ------------------ local ui = require ( "ui" ) local spriteGrabber = require ( "spritegrabber" ) require('str') ------------------ -- Groups ------------------ local localGroup = display.newGroup() ------------------ -- Display Objects ------------------ print('enter thumbnial listing with type = ' .. params.type) -- TODO: RETRIEVE THIS FROM DB local filePath = system.pathForFile( "fl_cards.csv", system.DocumentsDirectory ) -- io.open opens a file at filePath. returns nil if no file found local file = io.open( filePath, "r" ) local contents = file:read( "*a" ) local cardPerCol = 3 -- THUMBNAIL local thumb = {} local thumbSprite=spriteGrabber.grabSheet("sprite/flshc_tbn") local startX, startY = 50, 100 local spacingX, spacingY = 100, 100 local h, i = 1, 1 for line in io.lines(filePath) do if h >1 then local linev = line.split(line,",") -- print('animalThumbv[i] = ' .. animalThumbv[i]) --thumb[i] = thumbSprite:grabSprite(animalThumbv[i],true) thumb[i] = thumbSprite:grabSprite(linev[1],true) print('linev[1] = ' .. linev[1]) -- print('loop me out') thumb[i].x = startX + ((i - 1) % cardPerCol) * spacingX thumb[i].y = startY + math.floor(((i - 1) / cardPerCol)) * spacingY thumb[i].card = linev[2] thumb[i].vLink = linev[3] thumb[i].vImg = linev[4] thumb[i].audio = nil thumb[i].oxDefn = linev[8] localGroup:insert(thumb[i]) local onTouchFlashcard = function(e) if e.phase == 'ended' then print('showing') -- CREATE A SUB DISPLAY GROUP AND INCLUDE FOLLOWING OBJECTS THAT NEED TO SLIDE IN local slideinGroup = display.newGroup() -- PREPARE A TRANSPARENT GREEN BACKGROUND local rect = display.newRect( 0, 0, display.contentWidth, display.contentHeight) rect:setFillColor(0,0,255) rect.alpha = 0.0 transition.to(rect, {time=200, alpha=0.5, }) localGroup:insert(rect) -- BUILD FLASHCARD DETAIL SCREEN local fCardImg = display.newImage(e.target.card) fCardImg:setReferencePoint(display.CenterReferencePoint) fCardImg.x, fCardImg.y = 0, 200 fCardImg:rotate(-20) slideinGroup:insert(fCardImg) -- VIDEO IMAGE, CLICK AND LEAD TO YOUTUBE VIDEO local fCardvImg = display.newImage(e.target.vImg) fCardvImg:setReferencePoint(display.CenterReferencePoint) fCardvImg.x, fCardvImg.y = 300, 200 fCardvImg.vLink = e.target.vLink slideinGroup:insert(fCardvImg) -- OXFORD EXPLAINATION local fCardoxDefn = display.newText(e.target.oxDefn, 250, 250, native.systemFont, 15) slideinGroup:insert(fCardoxDefn) --fCardoxDefn:setReferencePoint(display.CenterReferencePoint) --fCardoxDefn.x, fCardoxDefn.y = 300, 200 --fCardoxDefn.vLink = e.target.vLink localGroup:insert(slideinGroup) local onFCardvImgTouch = function(e) if e.phase == 'ended' then print('go youtube') system.openURL( e.target.vLink ) end end fCardvImg:addEventListener('touch', onFCardvImgTouch) -- SLIDE IN FLASHCARD slideinGroup:setReferencePoint(display.CenterReferencePoint) --slideinGroup.x = display.contentWidth slideinGroup.x, slideinGroup.y = display.contentWidth * 1.5, display.contentHeight / 2 transition.to(slideinGroup, {time=3000, x = display.contentWidth / 2, transition = easing.inOutExpo}) end end thumb[i]:addEventListener('touch', onTouchFlashcard) i = i + 1 end h = h + 1 end return localGroup end |
It is clearly a Director related issue...
you are trying to load a new scene called "sce_flashcard_ls" and that is missing a new() function or the global/local thingie is causing that confusion...
cheers,
?:)
sorry, i dont understand,
but why corona simulator never complain? (which mean iOS simulator and corona simulator work differently?)
also, i am following the guide closely
main.lua
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | display.setStatusBar( display.HiddenStatusBar ) local director = require("director") require("g") local mainGroup = display.newGroup() local main = function () ------------------ -- Add the group from director class ------------------ mainGroup:insert(director.directorView) ------------------ -- Change scene without effects ------------------ director:changeScene("sce_flashcard") ------------------ -- Return ------------------ return true end main() |