var驱动程序:NSArray?
datatype: "xml",
url : "../../../../api/",
loadonce: true,
mtype: "POST",
postData: searchRequest,
ajaxGridOptions: {
contentType: "text/xml",
headers: {
UserSessionID: userSessionID,
include_extended_attributes: false,
ClientVersion: "3.0",
ClientApplication : "SomeApp"
}
}
func getDriverFromId(id:Int?) - >字符串{
func loadDriversREST() {
RestApiManager.sharedInstance.getDriverList{ json in
var drivers = json
println(drivers.description)
}
答案 0 :(得分:0)
我不知道你究竟想做什么,但有很多选择。 您可以使用NSUserDefaults()。在我的情况下,我使用用户的域名
private let DOMAIN_PREFIX = "DOMAINS_"
private let DOMAIN_DELIMITER = "|"
private let defaults: NSUserDefaults
init() {
defaults = NSUserDefaults.standardUserDefaults()
}
func getDomains(user: String) -> [String] {
if let domains = defaults.valueForKey("\(DOMAIN_PREFIX)\(user)") as? String {
return domains.componentsSeparatedByString(DOMAIN_DELIMITER)
}
return [String]()
}
func saveDomains(domains : [String], user: String) {
defaults.setValue(DOMAIN_DELIMITER.join(domains), forKey: "\(DOMAIN_PREFIX)\(user)")
defaults.synchronize()
}
您可以保存方式保存您的驱动程序。