카카오 맵 iOS SDK 사용중
앱을 백그라운드에서 포그라운드로 올렸을 때 크래시가 발생해 문의합니다!
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
MTMapView.clearMapTilePersistentCache() /// 이 라인에서 크래시 발생
}
// 에러 내용
ERROR:CANNOT add a object(-2092597008) to a autorelease pool!!!, Please initialize the autorelease pool before use.
MTMapView는 아래처럼 선언해주고 있습니다.
if let mapView = self.mapView as? MTMapView{
MTMapView.setMapTilePersistentCacheEnabled(true)
mapView.delegate = self
let curMarker = MTMapLocationMarkerItem()
curMarker.customTrackingImageName = “curPin.png”
mapView.updateCurrentLocationMarker(curMarker)
self.view.addSubview(mapView)
mapView.setZoomLevel(2, animated: true)
}