This code works in the Simulator just fine, but crashes the iPad as soon as media.show is called-- I never get to see the photo chooser. Am I doing something wrong, or is it a bug? I’m running Beta 5 on a stock iPad.
Thanks,
~ K
local holder = display.newGroup()
local onComplete = function(event)
if event.target ~= nil then
holder:insert(event.target)
end
end
holder:addEventListener("onComplete", onComplete)
media.show(media.PhotoLibrary, onComplete )
And here’s a partial crash log:
Hardware Model: iPad1,1
Process: CoffeeTable [710]
Path: /var/mobile/Applications/BEC5D8C7-363A-43B8-8D6B-51CB6EA57B64/CoffeeTable.app/CoffeeTable
Identifier: CoffeeTable
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-06-28 22:16:40.481 -0400
OS Version: iPhone OS 3.2 (7B367)
Report Version: 104
Exception Type: EXC\_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x000790a0 \_\_kill + 8
1 libSystem.B.dylib 0x00079090 kill + 4
2 libSystem.B.dylib 0x00079082 raise + 10
3 libSystem.B.dylib 0x0008d20a abort + 50
4 libstdc++.6.dylib 0x00044a1c \_\_gnu\_cxx::\_\_verbose\_terminate\_handler() + 376
5 libobjc.A.dylib 0x000057c4 \_objc\_terminate + 104
6 libstdc++.6.dylib 0x00042dee \_\_cxxabiv1::\_\_terminate(void (\*)()) + 46
7 libstdc++.6.dylib 0x00042e42 std::terminate() + 10
8 libstdc++.6.dylib 0x00042f12 \_\_cxa\_throw + 78
9 libobjc.A.dylib 0x000046a4 objc\_exception\_throw + 64
10 UIKit 0x001faea0 UIImagePickerEnsureViewIsInsidePopover + 252
11 PhotoLibrary 0x00003bb2 -[PLLibraryView didMoveToWindow] + 82
12 UIKit 0x00009c4c -[UIView(Internal) \_didMoveFromWindow:toWindow:] + 524
13 UIKit 0x00009b08 -[UIView(Internal) \_didMoveFromWindow:toWindow:] + 200
14 UIKit 0x00006440 -[UIView(Hierarchy) \_postMovedFromSuperview:] + 100
15 UIKit 0x000060ba -[UIView(Internal) \_addSubview:positioned:relativeTo:] + 658
16 UIKit 0x00005e18 -[UIView(Hierarchy) addSubview:] + 16
17 UIKit 0x00070626 -[UINavigationTransitionView transition:fromView:toView:] + 410
18 UIKit 0x0007047a -[UINavigationTransitionView transition:toView:] + 14
19 UIKit 0x0006f79e -[UINavigationController \_startTransition:fromViewController:toViewController:] + 1522
20 UIKit 0x0006f130 -[UINavigationController \_startDeferredTransitionIfNeeded] + 176
21 UIKit 0x0006f074 -[UINavigationController viewWillLayoutSubviews] + 8
22 UIKit 0x0006f010 -[UILayoutContainerView layoutSubviews] + 132
23 UIKit 0x00043f2c -[UIView(CALayerDelegate) \_layoutSublayersOfLayer:] + 20
24 CoreFoundation 0x00028ff4 -[NSObject performSelector:withObject:] + 16
25 QuartzCore 0x00013792 -[CALayer layoutSublayers] + 114
26 QuartzCore 0x00013562 CALayerLayoutIfNeeded + 178
27 QuartzCore 0x00008b5c CA::Context::commit\_transaction(CA::Transaction\*) + 204
28 QuartzCore 0x00008974 CA::Transaction::commit() + 180
29 QuartzCore 0x0002e15e CA::Transaction::observer\_callback(\_\_CFRunLoopObserver\*, unsigned long, void\*) + 46
[import]uid: 2857 topic_id: 1307 reply_id: 301307[/import]
[import]uid: 2857 topic_id: 1307 reply_id: 3611[/import]