Last active
November 30, 2016 21:12
-
-
Save tgunr/d34344a5f9972674715324d28cd4d0da to your computer and use it in GitHub Desktop.
Fail to parse if saveUserDefaults is not commented out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IncidentList: NSObject, NSCoding { | |
var incidents: [Incident] | |
static let sharedInstance = IncidentList() | |
var stagedIncident: Incident? | |
let ArchiveURL = DocumentsDirectory.appendingPathComponent("incidents").standardizedFileURL.path | |
// private override init() { | |
// } | |
public override init() { | |
incidents = [] | |
super.init() | |
} | |
func encode(with aCoder: NSCoder) { | |
aCoder.encode(incidents, forKey: PropertyKey.incidentsKey) | |
} | |
public required init?(coder aDecoder: NSCoder) { | |
incidents = (aDecoder.decodeObject(forKey: PropertyKey.incidentsKey) as! [Incident]) | |
} | |
class func saveUserDefaults() { | |
let result = NSKeyedArchiver.archiveRootObject(incidents, toFile: IncidentList.sharedInstance.ArchiveURL) | |
if !result { | |
print("Failed to save gIncidents...") | |
} | |
} | |
1. While emitting IR SIL function @_TZFC14NoisyNeighbors12IncidentList16saveUserDefaultsfT_T_ for 'saveUserDefaults' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment