You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectForKey is standard method of NSUserDefaults class, work without using Prephirences framework
Did you use cocoapod? and import the framework in your file?
import Prephirences
For information subscript for NSUserDefaults is defined in NSUserDefaults+Prephirences.swift
The import was the solution! Thought it was a Swift extension of NSUserDefaults, so I could use it without importing anything. Now I can successfully use return self.userDefaults[key] and return self.userDefaults[key]?[preference]. Thanks!
Don't know if I'm doing something wrong here, but just tried the example and it throws an error.
If I use
objectForKey
, it works.Same situation when trying to modify it.
userDefaults["mykey"] = "myvalue"
does not work.The text was updated successfully, but these errors were encountered: