Class: NSUserDefaults
- Inherits:
-
Object
- Object
- NSUserDefaults
- Defined in:
- motion/core/ns_user_defaults.rb
Overview
Reopens the NSUserDefaults class to add Array like accessors
Instance Method Summary (collapse)
-
- (Object) [](key)
Retrieves the object for the passed key.
-
- (Object) []=(key, val)
Sets the value for a given key and save it right away.
Instance Method Details
- (Object) [](key)
Retrieves the object for the passed key
6 7 8 |
# File 'motion/core/ns_user_defaults.rb', line 6 def [](key) self.objectForKey(key.to_s) end |
- (Object) []=(key, val)
Sets the value for a given key and save it right away.
11 12 13 14 |
# File 'motion/core/ns_user_defaults.rb', line 11 def []=(key, val) self.setObject(val, forKey: key.to_s) self.synchronize end |