<memory> 不是 BOMStorage 文件
<memory> is not a BOMStorage file
当使用 UICollectionView
时,其中有很多包含图像的单元格,每当屏幕外的单元格滚动到屏幕上时,我都会在日志中收到这个奇怪的警告:
2015-11-06 15:50:20.777 MyApp[49415:13109991] [/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI_Sim/CoreUI-370.8/Bom/Storage/BOMStorage.c:517] <memory> is not a BOMStorage file
这是单元设置:
import UIKit
class FeaturedCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
private var xml: XMLIndexer? = nil
override func awakeFromNib() {
super.awakeFromNib()
// this enables the parallax type look
self.imageView.adjustsImageWhenAncestorFocused = true
self.imageView.clipsToBounds = false
}
func loadImageFromUrlString(str: String) {
if let url = NSURL(string: str) {
if let data = NSData(contentsOfURL: url){
let image = UIImage(data: data)
self.imageView.image = image
self.activityIndicator.stopAnimating();
}
}
}
func setXml(xml: XMLIndexer) {
self.xml = xml;
if let imageUrl: String = (xml["FullAd"].element?.text)! {
self.loadImageFromUrlString(imageUrl)
}
}
}
根据this thread,这条消息是无害的。
当使用 UICollectionView
时,其中有很多包含图像的单元格,每当屏幕外的单元格滚动到屏幕上时,我都会在日志中收到这个奇怪的警告:
2015-11-06 15:50:20.777 MyApp[49415:13109991] [/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI_Sim/CoreUI-370.8/Bom/Storage/BOMStorage.c:517] <memory> is not a BOMStorage file
这是单元设置:
import UIKit
class FeaturedCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
private var xml: XMLIndexer? = nil
override func awakeFromNib() {
super.awakeFromNib()
// this enables the parallax type look
self.imageView.adjustsImageWhenAncestorFocused = true
self.imageView.clipsToBounds = false
}
func loadImageFromUrlString(str: String) {
if let url = NSURL(string: str) {
if let data = NSData(contentsOfURL: url){
let image = UIImage(data: data)
self.imageView.image = image
self.activityIndicator.stopAnimating();
}
}
}
func setXml(xml: XMLIndexer) {
self.xml = xml;
if let imageUrl: String = (xml["FullAd"].element?.text)! {
self.loadImageFromUrlString(imageUrl)
}
}
}
根据this thread,这条消息是无害的。