Question

I have a weird problem that hopefully someone could shed some light on.

I have an ipad app in the AppStore that was released when 3.2 was the only available iOS for ipad. App ran fine on this iOS but as soon as 4.2.1 came out for ipad and some of my users therefore updated to the new iOS the app now crashes when a certain UIBarButtonItem is pressed. In the interim from iOS 3.2 to when iOS 4.2.1 came out i submitted no updates so it was the exact same app running on each iOS yet i had this problem only on 4.2

After symbolicating in Organizer and viewing the Distribution build crash report I am able to at least see the line of code that is causing this...

while(i < [filteredData count]) {

thats it!!...just a simple check during a while loop. The last thing in the crash log points to the above line of code....

filteredData is a NSMutableArray that is definitely allocated/initialized at this point. It is actually used in another piece of code before this with no problems. Again, this line of code gave my app no problems on iOS 3.2 but on iOS 4.2.1 it causes EXC_BAD_ACCESS (SIGSEGV)

When i install the app on my device via xcode with a debug or release config it works perfect but when installing from AppStore (distribution build) it crashes and only on 4.2!

Just to clarify.....

app works perfect on debug AND distribution modes on 3.2

app works perfect on debug mode on 4.2 BUT app crashes on distribution mode on 4.2

Any thoughts? .....cuz i'm confused/lost Thanks for taking the time

Was it helpful?

Solution

Possibly an optimisation made by the compiler in Release builds causes this, especially as you dont get the issue in Debug

Can you refactor to...

NSUInteger count = [filteredData count];
while(i < count) {

Or is filteredData mutating in the loop?

NSUInteger count = [filteredData count];
while(i < count) {
   blah;
   blah;
   count = [filteredData count];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top