UPDATE: The window does NOT need to be modal. I have updated app.js to reflect this. I can still reproduce this crash when the window is not modal.
I've been seeing a crash on my device with our project for some time now, but have been unable to determine exactly what's going on. The problem is intermittent, and only affects users occasionally.
I've put together a minimal app which reproduces the problem on my iPhone 3G. You can see the code for app.js (and the associated crashlog) here.
Basically, I'm trying to put up a modal window that contains a NavigationGroup; which in turn contains TableViews; the rows of which contain multiple subviews. You select from an initial list of options, which drills into another list of options. When you select one of these, the modal window is closed.
If you try this code, note that it does not crash on the first open, find, select, close cycle. You must do this a number of times. On my iPhone 3G, it's typically about 10-15 times before you start getting memory warnings, and an eventual crash. There looks to be some infinite recursion going on here, but I'm not able to see exactly where the problem is, or how to fix it. Here's a snippet of the crash (full crashlog at the gist):
Thread 0 Crashed:
0 libobjc.A.dylib 0x000034ec objc_msgSend + 12
1 UIKit 0x000099fc -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 44
2 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
3 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
4 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
5 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
6 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
7 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
8 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
9 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
10 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
11 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
12 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
13 UIKit 0x00009b04 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 308
(~500 more lines of this same stack entry)
Your Answer
Think you can help? Login to answer this question!