0

I am developing an app in Objective-C.

An iPhone apps works fine in both all iPhone models and even in iPad (simulator), but it crashes when I run this app on a iPad devices.

Detail :

I have 3 buttons in my project; when I click button (any button out of 3 buttons) web service gets called, and I get response for Collection view, Mostly times it crashes (ONLY IN IPAD) when I click any button out of theses. But it does not crash on iphone and on iPad (simulator).

Crashes : I receive one crash (crash occur randomly) at one time out of three times:

Error 1:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BestMatchRequester everyBodyResponseData:]: unrecognized selector sent to instance 0x14662aa0'

Error 2:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0x145ecc10> {length = 2, path = 1 - 0}'

Error 3:

demoproject(183,0x3c8c818c) malloc: * error for object 0x156f8ea0: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug (lldb)

Please note that this app works fine on iPhone and even on iPad simulator.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ravi
  • 800
  • 2
  • 12
  • 28
  • 1
    You have diferent iOS versions on iPad and iPhone? – Jens May 04 '15 at 05:44
  • iPhone ios version : 8.1 (12B411) Ipad version : 7.1(11D167) – Ravi May 04 '15 at 05:58
  • add exception breakpoint and trace the line which is causing crash. Like http://stackoverflow.com/questions/17802662/exception-breakpoint-in-xcode – Nirav Gadhiya May 04 '15 at 06:01
  • Is it due to different ios version I am using i.e. iPhone ios version : 8.1 (12B411) Ipad version : 7.1(11D167) ?? – Ravi May 04 '15 at 06:03
  • Well, take the advice you're given and you will be able to answer that question. Right now we have no idea; you've not provided enough information. – Robert J. Clegg May 04 '15 at 06:49
  • 1
    You should show us your code. But it seems to me that you create an object that is released before you use it (so the 'unrecognized selector' error message). Perhaps is it related to your cell creation (hint from error 2). And on error 3, you have an error on freeing (or releasing) an object that does not exist anymore. You can enable Zombie objects in Scheme/Debug/Options and when it crashes again, in the console, you can type 'po
    ' and it will try to put the description of the object that can help you to track the memory leak ('po' is for print object).
    – Nicolas Buquet May 04 '15 at 07:08
  • Try the solution for this, it looks similar: http://stackoverflow.com/questions/18339030/uicollectionview-assertion-error-on-stale-data – Mrunal May 04 '15 at 07:18
  • Error 1 : IT clearly indicates that you have the parameter mismatch. It is programming bug, which you should fix. Pass the expected data type value in arguments `[BestMatchRequester everyBodyResponseData:]` while calling this method. Error 2: In your collection view, you are referring the index element which is beyond the bound of your data source. Its like accessing element beyond the limit of your array capacity. – Balram Tiwari May 04 '15 at 10:54
  • May anyone help me please ?? Why it crashes only ipad, why not in iphone. Because if I know correct bug/crash reason , then it will easy to debug to me that direction . – Ravi May 05 '15 at 13:38
  • I am getting this message many times in debug mode(I am using ARC in my code) : [UICollectionViewLayoutAttributes release]: message sent to deallocated instance 0x18911af0 – Ravi May 05 '15 at 14:05
  • or sometimes I get this message : UIViewAnimationState release]: message sent to deallocated instance 0x196b0820 (I am using ARC in my code, So I think , deallocated instance problem should not come in my code ) – Ravi May 06 '15 at 06:28
  • Pleas let me know how I can insert my code with proper format. I am trying to insert my code, but it display in a very bad format. When I insert My code ,it display as simple text file, which will not easy to analysis to you all. – Ravi May 06 '15 at 08:29

0 Answers0