-1
A
답변
0
이보십시오.
if ([imageUrl isKindOfClass:[NSString class]]) {
[_profileImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"PlaceHoldeImage"]];
}else{
_profileImageView.image=[UIImage imageNamed:@"PlaceHoldeImage"];
}
+0
if ([imageUrl isKindOfClass : [NSNull class]]) { _profileImageView.image = [UIImage imageNamed : @ "PlaceHoldeImage"]; } –
+0
이제 괜찮아요 .. –
+0
@chunchu swamy, 코드가 작동하기 시작 했습니까? –
0
NSString *imageUrl= [ProfileArray valueForKey:@"photo"];
if ([imageUrl isKindOfClass:[NSNull class]])
{
_profileImageView.image=[UIImage imageNamed:@"PlaceHoldeImage"];
}
else
{
[_profileImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"PlaceHoldeImage"]];
}
_profileImageView.image=[UIImage imageNamed:@"PlaceHoldeImage"];
0
사용이 코드. 그것은 확실히 작동해야합니다.
NSString *imageUrl= [ProfileArray valueForKey:@"photo"];
if ([imageUrl isKindOfClass:[NSNull class]]) {
_profileImageView.image=[UIImage imageNamed:@"PlaceHoldeImage"];
} else {
[_profileImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"PlaceHoldeImage"]];
}
0
이 코드를 사용해보십시오.
NSString *imageUrlString= [photoDict valueForKey:@"photo"];
if (imageUrl.length == 0)
{
_profileImageView.image=[UIImage imageNamed:@"PlaceHoldeImage"];
}
else
{
_profileImageView.image=[UIImage imageNamed:imageUrlString];
}
이 iOS 7은 특정 제품입니까? – Raptor
신속한 응답이 없습니다. –
JSON 문제입니까? – Larme