Local Notification Error in Iphone Simulator - error message is: attempt to call a nil value

I am trying to test the local notification functionality in ios simulator. I get this error when app is trying to issue the notification. Have spent countless hours trying to figure this out but to no avail. I checked ios simulator documentation and it confirms that local notification can be tested on the simulator. I am assuming that local notification generated using lua is compatible with simulator. Please correct me if i am wrong on this one.

I can post the code if anyone is interested. But i have followed the same code that is posted on the blog. Below is the error message i am getting.

  
12/13/11 5:24:33.216 PM UIKitApplication:MyApp[0xff99]: Lua Runtime Error: lua\_pcall failed with status: 2, error message is: attempt to call a nil value  
12/13/11 5:24:33.221 PM UIKitApplication:MyApp[0xff99]: Lua Runtime Error: lua\_pcall failed with status: 2, error message is: attempt to call a string value  

thanks for reading.

cheers,
Bejoy [import]uid: 84539 topic_id: 19096 reply_id: 319096[/import]

Tested it in device. It is showing notification but still throws the same error:

Dec 13 17:47:11 unknown UIKitApplication:MyApp[0x5c9d][6150] <notice>: Lua Runtime Error: lua_pcall failed with status: 2, error message is: attempt to call a nil value<br>Dec 13 17:47:41 unknown UIKitApplication:MyApp[0x5c9d][6150] <notice>: Lua Runtime Error: lua_pcall failed with status: 2, error message is: attempt to call a string value<br>Dec 13 17:48:11 unknown UIKitApplication:MyApp[0x5c9d][6150] <notice>: Lua Runtime Error: lua_pcall failed with status: 2, error message is: attempt to call a string value<br>Dec 13 17:48:41 unknown UIKitApplication:MyApp[0x5c9d][6150] <notice>: Lua Runtime Error: lua_pcall failed with status: 2, error message is: attempt to call a string value<br><br>

Has anyone experience this while calling notification.

It also seems like notification does not work in the simulator… Could someone confirm…

cheers,
Bejoy
[import]uid: 84539 topic_id: 19096 reply_id: 73619[/import]

This worked fine on device and didn’t throw an error (although I only tested it once briefly while viewing the logs);

[lua]display.setStatusBar (display.HiddenStatusBar)

– Options for iOS
local options = {
alert = “Wake up!”,
badge = 2,
custom = { foo = “bar” }
}

– schedule using seconds from now
local notification = system.scheduleNotification( 20, options )

– schedule using UTC (Coordinated Universal Time)
local utcTime = os.date( “!*t”, os.time() + 20 )
local notification = system.scheduleNotification( utcTime, options )

local listener = function( event )
print( event.name ) – ==> “notification”
print( event.custom.foo ) – ==> “bar”
end

Runtime:addEventListener( “notification”, listener )[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 19096 reply_id: 73678[/import]

Thx Peach…It works…I was having issue with my logic for UTC time. Somehow the error info coming out of notification code is not very helpful…Took me sometime to figure out that my logic was incorrect…

thx for your response to my post.

Bejoy [import]uid: 84539 topic_id: 19096 reply_id: 74471[/import]