Work around for several strange corner cases in Automatic Reference Counting in Apple's runtime

This commit is contained in:
Grant Limberg 2016-06-30 19:42:23 -07:00
commit ba0a45365c
5 changed files with 19 additions and 9 deletions

View file

@ -42,8 +42,13 @@ class NetworkMonitor: NSObject {
let filePath = dataFile()
if NSFileManager.defaultManager().fileExistsAtPath(filePath) {
self.savedNetworks = NSKeyedUnarchiver.unarchiveObjectWithFile(filePath) as! [Network]
let networks = NSKeyedUnarchiver.unarchiveObjectWithFile(filePath) as! [Network]
self.savedNetworks.removeAll()
for n in networks {
self.savedNetworks.append(n)
}
}
ServiceCom.getNetworkList() { (networkList) -> Void in