0

I have implemented the SDWebImage exactly as the description (link) said using xcode 5, and it gives me no errors. This is what the piece of code looks like:

CustomCell *customcell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForItem:(currentIndexPath) inSection:0]];
    Model *model = self.products[currentIndexPath];
    NSString *productImageNumber = model.productImageNumber;
    NSString *imageUrlString = [NSString stringWithFormat:@"http://www.imagine-app.nl/ProductImages/%@%@",productImageNumber,@".jpg"];
    [customcell.imageView setImageWithURL:[NSURL URLWithString:imageUrlString]
                   placeholderImage:[UIImage imageNamed:@"placeholder-square.jpg"]];

But when I run the app, and I press the button that uses the SDWebImage, I get two errors:

!!!!! Error creating directory /var/mobile/Library/Logs/CrashReporter/DiagnosticLogs/Photos/Process: The operation couldn’t be completed. (Cocoa error 513.) !!!!

and

unrecognized selector sent to instance 0x1752ea90

I can't figure out where they come from and neither how to solve them because, as mentioned, Xcode gives me no error or issue when I'm editing my code.

I'm a beginner so I may be missing out something simple, bus as mentioned, It is not the implementation of the SDWebImage that causes this, because I checked it numerous times and everything appeared to be right.

Does anybody have an idea how to solve this? thank you very much in advance!

Tarek Hallak
  • 18,422
  • 7
  • 59
  • 68
Joris416
  • 4,751
  • 5
  • 32
  • 59
  • Try to add exception breakpoint and see on which line the app crashes. – Valent Richie Jun 28 '13 at 09:39
  • I did! everything works just fine. as soon as it gets to the setImageWithUrl:placeHolderImage it crashes. – Joris416 Jun 28 '13 at 09:47
  • Have you imported the UIImageView+WebCache.h header? Also check if the imageView property of the cell is really there and valid. – Valent Richie Jun 28 '13 at 09:50
  • yes I have implemented them. strange thing about that is, the documentation (see link in question) tells me to do it like this: `#import `, but I have to do it like this: `#import "SDWebImage.framework/Headers/UIImageView+WebCache.h"`. that makes sense to me because that is the 'way to come there', but maybe it shouldn't be like this? The image view is also there and valid. it's a UIImageView I placed in a customCell. – Joris416 Jun 28 '13 at 09:55
  • Does your CustomCell have imageView property? – Valent Richie Jun 28 '13 at 10:12
  • yes it does. sorry for the late response. All these little things actually seem to be correct. maybe it is the fact that I can't implement the header as supposed to?? – Joris416 Jun 28 '13 at 11:07
  • @verbumdei sorry forgot to tag – Joris416 Jun 28 '13 at 11:29
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/32563/discussion-between-verbumdei-and-imagine-digital) – Valent Richie Jun 28 '13 at 12:03

1 Answers1

1

The issue is that the SDWebImage .m files are not added in the target membership. Try to add those files under Build Phases > Compile Sources.

If you are also adding the MKAnnotationView+WebCache files, you need to include MapKit.framework under Link Binary With Libraries section.

Valent Richie
  • 5,226
  • 1
  • 20
  • 21