Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDWebImage in iOS 7.1 crashes

So, i've just updated my xcode and started building my app for iOS 7.1. But now i find out that my SDWebImage is broken. Whenever i try to set an ImageWithUrl for a UIImageView my app crashes with the following exception and stacktrace:

2014-03-11 12:55:36.647 Wiggle[1983:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:options:]: unrecognized selector sent to instance 0x10fa12890'


*** First throw call stack:
(
    0   CoreFoundation                      0x0000000103188795 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000102eeb991 objc_exception_throw + 43
    2   CoreFoundation                      0x0000000103219bad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010317a09d ___forwarding___ + 973
    4   CoreFoundation                      0x0000000103179c48 _CF_forwarding_prep_0 + 120
    5   Wiggle                              0x000000010001fe94 -[MenuTableViewController tableView:viewForHeaderInSection:] + 1316
    6   UIKit                               0x000000010182cdb3 __84-[UITableView _sectionHeaderView:withFrame:forSection:floating:reuseViewIfPossible:]_block_invoke + 112
    7   UIKit                               0x00000001017b60ac +[UIView(Animation) performWithoutAnimation:] + 70
    8   UIKit                               0x000000010182ccc5 -[UITableView _sectionHeaderView:withFrame:forSection:floating:reuseViewIfPossible:] + 223
    9   UIKit                               0x00000001018149cf -[UITableView _updateVisibleHeadersAndFootersNow:] + 2596
    10  UIKit                               0x0000000101815b6f -[UITableView _updateVisibleCellsNow:] + 3122
    11  UIKit                               0x0000000101826381 -[UITableView layoutSubviews] + 207
    12  UIKit                               0x00000001017bdb27 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 354
    13  QuartzCore                          0x0000000100bb7a22 -[CALayer layoutSublayers] + 151
    14  QuartzCore                          0x0000000100bac589 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 363
    15  QuartzCore                          0x0000000100bac40a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
    16  QuartzCore                          0x0000000100b21694 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 252
    17  QuartzCore                          0x0000000100b2270c _ZN2CA11Transaction6commitEv + 394
    18  UIKit                               0x0000000101779444 _afterCACommitHandler + 128
    19  CoreFoundation                      0x0000000103153ff7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    20  CoreFoundation                      0x0000000103153f67 __CFRunLoopDoObservers + 391
    21  CoreFoundation                      0x00000001031336d2 __CFRunLoopRun + 946
    22  CoreFoundation                      0x0000000103132f33 CFRunLoopRunSpecific + 467
    23  GraphicsServices                    0x00000001036a53a0 GSEventRunModal + 161
    24  UIKit                               0x0000000101762043 UIApplicationMain + 1010

I'm not sure what to do, can anybody help?

like image 782
Daan Olislagers Avatar asked Mar 11 '14 12:03

Daan Olislagers


2 Answers

Thanks to Amar I found the answer.

SDWebImage with Base SDK iOS 7.1 requires you to exclude arm64 in

Project > BuildSettings > Architectures> Valid Architectures.

You might also need to set Build Active Architectures Only to NO for it to work.

like image 97
Daan Olislagers Avatar answered Oct 06 '22 01:10

Daan Olislagers


Obviously now that there are lots of 64 bit devices out there you don't want to do this anymore, you instead want to download the latests SDWeb library that is compatible with the new architecture.

like image 28
Ali Avatar answered Oct 06 '22 01:10

Ali