美文网首页
UIImage 的 Equal

UIImage 的 Equal

作者: kyson老师 | 来源:发表于2021-07-28 18:18 被阅读0次
// Load the same image twice.
UIImage* image1 = [UIImage imageNamed:@"MyImage"];
UIImage* image2 = [UIImage imageNamed:@"MyImage"];
 
// The image objects may be different, but the contents are still equal
if ([image1 isEqual:image2]) {
   // Correct. This technique compares the image data correctly.
}
 
if (image1 == image2) {
   // Incorrect! Direct object comparisons may not work.
}

来自:https://developer.apple.com/documentation/uikit/uiimage?language=objc

相关文章

网友评论

      本文标题:UIImage 的 Equal

      本文链接:https://www.haomeiwen.com/subject/nuazmltx.html