I am fetching JSON data via HTTP and want to display them in a MKMapView with a custom MKAnnotationView. So no problem until here.
Bad thing is the REST service could return types of pins that don't have equivalents in my .xcassets file. Is there any way to check for an entry in the App's Asset Catalog and avoid messages like this:
CUICatalog: Invalid asset name supplied: NonExistingImage, or invalid scale factor: 2.000000
Current code example:
NSString * imageName = @"NonExistingImage";
if (imageName != nil) {
// this line creates the above message
UIImage * image = [UIImage imageNamed:imageName];
// checking for image != nil, otherwise use default image
} else {
// default image
}
My solution: Seems you call imageNamed with an empty NSString (or nil) this info is being logged. If the image passed simply doesn't exist, resulting UIImage is nil and NO message is created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With