나는 메모리 누설 메모리 빠른 3
다음
을 증가 테이블 뷰 didSelectRow 방법에서 식별자 i는 셀을 탭마다 SEGUE 수행 갖는 문제 내 코드가주세요func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// firstly i need to check if edit button is true so i can select cell
if isShowToolBar {
// her for hold selected index
let cell = tableView.cellForRow(at: indexPath) as? MovieDownloadedTableViewCell
if let cell = cell {
cell.movieCheckMarkImageView.isHidden = false
cell.movieEmptyCircleImageView.isHidden = true
operationDocumentDirectoryObject.dictionaryHoldIndexCellForDisplayWhichCellSelected.updateValue(indexPath.row, forKey: indexPath.row)
// start hold URL
operationDocumentDirectoryObject.dictionaryForHoldURLSelected.updateValue(operationDocumentDirectoryObject.arrayOfMovieURL![indexPath.row], forKey: indexPath.row)
}// end the if let cell
}else{
// her for show the content folder
let cell = tableView.cellForRow(at: indexPath) as? MovieDownloadedTableViewCell
if let cell = cell {
if cell.fetchURL!.pathExtension == "" {
performSegue(withIdentifier: "ShowFolder", sender: indexPath.row)
}else{
// playing the video
performSegue(withIdentifier: "PlayingMovie", sender: cell.fetchURL!.lastPathComponent)
}// end the if for check path extenstion
}// end the if let cell
cell = nil
}// end the if for the isShowToolbar
}
상기 방법은 (cell.fetchURL! .pathExtension == ''경우) 또한 메모리
누수 확인 메모리 누수에 SEGUE을 수행하고 와 메모리를 증가시키는 원인이override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "MoveFile" {
if let destination = segue.destination as? MoveMovieViewController {
destination.operationDocumentDirectoryObject.dictionaryForHoldURLSelected = self.operationDocumentDirectoryObject.dictionaryForHoldURLSelected
}
}else if segue.identifier == "ShowFolder" {
if let destination = segue.destination as? ShowContentFolderMovieViewController {
if let fetchIndex = sender as? Int {
destination.operationDocumentDirectory.folderName = self.operationDocumentDirectoryObject.arrayOfMovieURL![fetchIndex].lastPathComponent
}
}
}else if segue.identifier == "PlayingMovie" {
// make an object for the playing video view controller
if let destination = segue.destination as? PlayingMovieViewController {
if let movieName = sender as? String {
destination.operationDocumentDirectory.movieName = movieName
}
}
}// end the condition for the segue
}
deinit 뷰 컨트롤러에서 호출 성공하지만 난 여전히 메모리 누수 및 증가하고 있지만
내 잘못된 코드입니다 무엇을 도와주세요?
는 당신에게 당신이 코드에서 어딘가에 강한 참조주기가 의심
그런 의미에서 내 segue가 옳았는데 다른 메소드를 검색해야합니까? 내가 악기 도구를 사용할 때 그것은 4.45 mib 걸리는 수행 segue를 가리키는 것입니다. 왜 그런지 모를 것입니다. 나는 모든 시각을 deinit에서 해제해야합니까? – Mustafa
뷰 컨트롤러의 모든 deinit 메서드는 성공적으로 호출됩니다.하지만 인스트루먼트 도구에서 확인하면 성능이 나빠집니다 4.45 mb를 사용하는 식별자로 performSegue – Mustafa
인스트루먼트 도구의 스크린 샷을 게시 할 수 있습니까? 너를 보여주는거야? – hvasam