Can't use sdwebimage category (machine linker errors)

I want to use SDWebImage

for my images so that I can receive images from the internet. I downloaded the zip from github, unzipped it. I have dragged files from SDWebImage folder to xcode, checked copy items and also checked my target. Then I did an import with #import "UIImageView+WebCache.h"

. I did two UIImageViews

and I am using the method

[self.sdFeedImageView setImageWithURL:[NSURL URLWithString:feed.pictureURL]placeholderImage:[UIImage imageNamed:@"placeholder.png"]];

But when I tried to run my project, the build failed with 8 Apple Mach-O Linker errors. What is Apple Mach-O Linker Error? Selecting the error in the left pane of xcode I see the following:

Undefined symbols for architecture i386:
  "_CGImageSourceCopyPropertiesAtIndex", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
  "_CGImageSourceCreateImageAtIndex", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
  "_CGImageSourceCreateIncremental", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
  "_CGImageSourceUpdateData", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
  "_OBJC_CLASS_$_MKAnnotationView", referenced from:
      l_OBJC_$_CATEGORY_MKAnnotationView_$_WebCache in MKAnnotationView+WebCache.o
  "_kCGImagePropertyPixelHeight", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
  "_kCGImagePropertyPixelWidth", referenced from:
      ___59-[SDWebImageDownloaderOperation connection:didReceiveData:]_block_invoke_0 in SDWebImageDownloaderOperation.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

      

Edit: Here is the code:

self.sdUserImageView=[[UIImageView alloc]initWithFrame:CGRectMake(18, 26, 51, 51)]; [self.contentView addSubview:self.sdUserImageView];
self.sdFeedImageView=[[UIImageView alloc]initWithFrame:CGRectMake(18, 110, 284, 174)]; [self.contentView addSubview:self.sdFeedImageView];

      

then

[self.sdUserImageView setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"graph.facebook.com/%@/… imageNamed:@"placeholder.png"]];

      

+3
ios linker-errors sdwebimage


source to share


No one has answered this question yet

Check out similar questions:

1399
What is undefined link / unresolved external symbol error and how to fix it?
65
the file was created for a non-architecture archive (i386)
4
Can't use SDWebImage
2
Apple Mach-O Linker error with analysis
1
Dink Linker XCode 4.3 errors - how to solve them?
0
HTTP call is made the first time, but then waits forever
0
iOS: SocketRocket Mach-o Linker Error
0
Apple Mach-o Linker error
0
Swift Xcode error: Apple Mach-O linker error
0
Apple Mach-O Linker error: Using Xcode 4.6 to compile VLC for IOS on a simulator



All Articles
Loading...
X
Show
Funny
Dev
Pics