mirror of
https://github.com/zhigang1992/GVUserDefaults.git
synced 2026-01-12 09:04:17 +08:00
Use proper type instead of id
This commit is contained in:
@@ -43,13 +43,13 @@
|
||||
return key;
|
||||
}
|
||||
|
||||
id accessorGetter(id self, SEL _cmd) {
|
||||
id accessorGetter(GVUserDefaults *self, SEL _cmd) {
|
||||
NSString *key = NSStringFromSelector(_cmd);
|
||||
key = [self _transformKey:key];
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:key];
|
||||
}
|
||||
|
||||
void accessorSetter(id self, SEL _cmd, id newValue) {
|
||||
void accessorSetter(GVUserDefaults *self, SEL _cmd, id newValue) {
|
||||
NSString *method = NSStringFromSelector(_cmd);
|
||||
NSString *key = [[method stringByReplacingCharactersInRange:NSMakeRange(0, 3) withString:@""] stringByReplacingOccurrencesOfString:@":" withString:@""];
|
||||
key = [key stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[key substringToIndex:1] lowercaseString]];
|
||||
|
||||
@@ -62,7 +62,7 @@ Have a bug? Please [create an issue on GitHub](https://github.com/gangverk/GVUse
|
||||
GVUserDefaults is an open source project and your contribution is very much appreciated.
|
||||
|
||||
1. Check for [open issues](https://github.com/gangverk/GVUserDefaults/issues) or [open a fresh issue](https://github.com/gangverk/GVUserDefaults/issues/new) to start a discussion around a feature idea or a bug.
|
||||
2. Fork the [repository on Github](https://github.com/gangverk/GVUserDefaults) and make your changes on the **develop** branch (or branch off of it).
|
||||
2. Fork the [repository on Github](https://github.com/gangverk/GVUserDefaults) and make your changes on the **develop** branch (or branch off of it). Please retain the code style that is used in the project.
|
||||
3. Write tests, make sure everything passes.
|
||||
4. Make sure to add yourself to AUTHORS and send a pull request.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user