Coronal Terminal working fine but not Xcode

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.

[code]
–[[
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

[/code] [import]uid: 10373 topic_id: 17104 reply_id: 317104[/import]

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,

?:slight_smile: [import]uid: 3826 topic_id: 17104 reply_id: 64305[/import]

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

  
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()  

sce_flashcard.lua

  
module(..., package.seeall)  
new = function ( params )  
  
 ------------------  
 -- Imports  
 ------------------  
  
 local ui = require ( "ui" )  
  
 ------------------  
 -- Groups  
 ------------------  
  
 local localGroup = display.newGroup()  
  
 ------------------  
 -- Display Objects  
 ------------------  
 local flshcFruit = display.newImage('img/flshc\_fruit.png')  
 flshcFruit.x, flshcFruit.y = 100, 100  
 flshcFruit.type = 'fruit'  
 localGroup:insert(flshcFruit)  
 local onFlshcIndexBtnTap = function(e)  
 if e.phase == 'ended' then  
 print('tap me type =' .. e.target.type)  
 -- goto flashcard thumbnail listing page  
 director:changeScene({type = e.target.type }, 'sce\_flashcard\_ls', 'fade')  
 end  
 end  
 flshcFruit:addEventListener('touch', onFlshcIndexBtnTap)  
  
 return localGroup  
  
end  
  

sce_flashcard_ls.lua

--[[  
 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  
  
 -- BELOW ARE LOGIC TO LOOP OUT MY IMAGES…  
 -- CODES….  
  
 return localGroup  
  
end  
  

so, it’s quite a simple code, what i am worrying is the file directory cause the problem? plz correct me if i am wrong. [import]uid: 10373 topic_id: 17104 reply_id: 64380[/import]