ios - Swift Memory Leak on NSArray -
i'm developing app using singleton pattern , swift programming language. when profile app instruments, noticed there's memory leak pointing nsarray. instruments pointing following line of code (please check screenshot). can find why leak happening? tried initialize array workout as:
workout = []
checkout answer here: swift decode array custom class memory leak seems bug. had same problem too. instead of directly assign value workout
, can do:
if let wo = nskeyedunarchiver.unarchiveobjectwithfile(utilities.getfileurl("workout")) as? [exceciseobject] { workout = wo.map { $0 } }
Comments
Post a Comment