mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
Fix issue with class method and correct test
This commit is contained in:
parent
ac5983cc1f
commit
ee72e4b9c1
2 changed files with 7 additions and 3 deletions
|
@ -43,7 +43,7 @@ extern "C" {
|
||||||
@interface NSUbiquitousKeyValueStore : NSObject
|
@interface NSUbiquitousKeyValueStore : NSObject
|
||||||
|
|
||||||
// Getting the Shared Instance
|
// Getting the Shared Instance
|
||||||
- (NSUbiquitousKeyValueStore *) defaultStore;
|
+ (NSUbiquitousKeyValueStore *) defaultStore;
|
||||||
|
|
||||||
// Getting Values
|
// Getting Values
|
||||||
// Returns the array associated with the specified key.
|
// Returns the array associated with the specified key.
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#import <Foundation/NSData.h>
|
#import <Foundation/NSData.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <Foundation/NSValue.h>
|
#import <Foundation/NSValue.h>
|
||||||
#import <Foundation/NSUserDefaults.h>
|
#import <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
static NSUbiquitousKeyValueStore *_sharedUbiquitousKeyValueStore = nil;
|
static NSUbiquitousKeyValueStore *_sharedUbiquitousKeyValueStore = nil;
|
||||||
|
|
||||||
|
@ -47,13 +47,17 @@ static NSUbiquitousKeyValueStore *_sharedUbiquitousKeyValueStore = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUbiquitousKeyValueStore *) defaultStore
|
+ (NSUbiquitousKeyValueStore *) defaultStore
|
||||||
{
|
{
|
||||||
if(_sharedUbiquitousKeyValueStore == nil)
|
if(_sharedUbiquitousKeyValueStore == nil)
|
||||||
{
|
{
|
||||||
NSString *storeClassName = [[NSUserDefaults standardUserDefaults]
|
NSString *storeClassName = [[NSUserDefaults standardUserDefaults]
|
||||||
stringForKey: @"GSUbiquitousKeyValueStoreClass"];
|
stringForKey: @"GSUbiquitousKeyValueStoreClass"];
|
||||||
Class klass = NSClassFromString(storeClassName);
|
Class klass = NSClassFromString(storeClassName);
|
||||||
|
if(klass == NULL)
|
||||||
|
{
|
||||||
|
klass = NSClassFromString(@"GSSimpleUbiquitousKeyValueStore");
|
||||||
|
}
|
||||||
_sharedUbiquitousKeyValueStore = [[klass alloc] init];
|
_sharedUbiquitousKeyValueStore = [[klass alloc] init];
|
||||||
if(_sharedUbiquitousKeyValueStore == nil)
|
if(_sharedUbiquitousKeyValueStore == nil)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue