mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

A case of crash #15

Closed milkliker closed 10 years ago

milkliker commented 10 years ago

There is a possible of causing crash: A tableview of list, every cell has a subview of MRCircularProgressView to show the image download progress.

if I use [progressView setProgress:progress animated:YES]; to update the progress with animation, when the tableview scrolls with loading cells, it will crash with message

2013-11-24 14:00:08.296 test[63667:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSProxy methodSignatureForSelector:] called!'
*** First throw call stack:
(
    0   CoreFoundation                      0x01e445e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x018988b6 objc_exception_throw + 44
    2   CoreFoundation                      0x01e443bb +[NSException raise:format:] + 139
    3   Foundation                          0x01575dee -[NSProxy methodSignatureForSelector:] + 59
    4   CoreFoundation                      0x01e345e9 ___forwarding___ + 217
    5   CoreFoundation                      0x01e344ee _CF_forwarding_prep_0 + 14
    6   QuartzCore                          0x021d9b8a _ZN2CA7Display15DisplayLinkItem8dispatchEv + 48
    7   QuartzCore                          0x021d9a46 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 310
    8   QuartzCore                          0x021d9f6b _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
    9   CoreFoundation                      0x01e02bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    10  CoreFoundation                      0x01e025bd __CFRunLoopDoTimer + 1181
    11  CoreFoundation                      0x01dea628 __CFRunLoopRun + 1816
    12  CoreFoundation                      0x01de9ac3 CFRunLoopRunSpecific + 467
    13  CoreFoundation                      0x01de98db CFRunLoopRunInMode + 123
    14  GraphicsServices                    0x049c99e2 GSEventRunModal + 192
    15  GraphicsServices                    0x049c9809 GSEventRun + 104
    16  UIKit                               0x00606d3b UIApplicationMain + 1225
    17  test                                0x0004efbd main + 141
    18  libdyld.dylib                       0x0355f70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

if disable the animation, it will be ok. [progressView setProgress:progress animated:NO]; works well.

mrackwitz commented 10 years ago

Thank you for your report! Could you please try if ef7a685e411298e9c38684f46538da0af6d4d0d2 helps?

milkliker commented 10 years ago

Hi Marius, Thank you for the fixing! I found another crash reason raised when I update these.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSProxy doesNotRecognizeSelector:animateFrame:] called!'

And I found out the when the methodSignatureForSelector has called for animateFrame:, the _target is nil. Is this cause by the UITableViewCell has already released when scrolling?

mrackwitz commented 10 years ago

@milkliker Could you try to reproduce the crash in a minimal sample application and show me the code needed for the UITableViewController / UITableViewDataSource ?