Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 831 Bytes
#import "ReplaceInputData.h"
static NSDictionary *INTERNAL_REPLACE_DICT = nil;
@implementation ReplaceInputData
+ (void)initialize
{
NSString *a_file = [[NSBundle mainBundle] pathForResource:@"ReplaceDictionary" ofType:@"plist"];
INTERNAL_REPLACE_DICT = [NSDictionary dictionaryWithContentsOfFile:a_file];
}
+ (NSDictionary *)internalReplaceDict {
return INTERNAL_REPLACE_DICT;
}
+ (NSString *)findTextForKey:(NSString *)aKey
{
NSString *a_result = nil;
NSDictionary *user_dict = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"UserReplaceInputDict"];
if (user_dict) {
a_result = user_dict[aKey];
}
if (a_result) {
return a_result;
}
for (NSString *categoly_name in INTERNAL_REPLACE_DICT) {
a_result = INTERNAL_REPLACE_DICT[categoly_name][aKey];
if (a_result) break;
}
return a_result;
}
@end
You can’t perform that action at this time.