diff --git a/Framework/Framework.xcodeproj/project.pbxproj b/Framework/Framework.xcodeproj/project.pbxproj index dbde11d..e4f02ae 100644 --- a/Framework/Framework.xcodeproj/project.pbxproj +++ b/Framework/Framework.xcodeproj/project.pbxproj @@ -33,7 +33,6 @@ 37EEF9211D9E85E600AC52B6 /* Array-length.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9201D9E85E600AC52B6 /* Array-length.json */; }; 37EEF9231D9E8E9F00AC52B6 /* Array-uniqueness.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9221D9E8E9F00AC52B6 /* Array-uniqueness.json */; }; 37EEF9251D9EDBC700AC52B6 /* Combination-allOf1.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9241D9EDBC700AC52B6 /* Combination-allOf1.json */; }; - 37EEF9321D9EF35400AC52B6 /* Helpers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37EEF9311D9EF33100AC52B6 /* Helpers.framework */; }; 37EEF9431D9F09F400AC52B6 /* Combination-allOf2.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9421D9F09F400AC52B6 /* Combination-allOf2.json */; }; 37EEF9451D9F0DCC00AC52B6 /* Combination-anyOf.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9441D9F0DCC00AC52B6 /* Combination-anyOf.json */; }; 37EEF9471D9F1CE200AC52B6 /* Combination-oneOf1.json in Resources */ = {isa = PBXBuildFile; fileRef = 37EEF9461D9F1CE200AC52B6 /* Combination-oneOf1.json */; }; @@ -111,7 +110,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 37EEF9321D9EF35400AC52B6 /* Helpers.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Framework/Framework/JSONSchema.m b/Framework/Framework/JSONSchema.m index b4a5a18..017f3e1 100644 --- a/Framework/Framework/JSONSchema.m +++ b/Framework/Framework/JSONSchema.m @@ -7,7 +7,10 @@ // #import "JSONSchema.h" -#import + +#import + +static NSString *const JSONExtension = @"json"; static NSString *const JSONFragment = @"#"; static NSString *const JSONRoot = @"/"; @@ -1082,7 +1085,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionary { isSpec = [identifier isEqualToString:schema]; if (!isSpec) { - NSURL *URL = [self.bundle URLForResource:JSONSchemaDraftV4.stringByDeletingLastPathComponent.lastPathComponent withExtension:ExtensionJSON]; + NSURL *URL = [[NSBundle bundleForClass:self.class] URLForResource:JSONSchemaDraftV4.stringByDeletingLastPathComponent.lastPathComponent withExtension:JSONExtension]; NSData *data = [NSData dataWithContentsOfURL:URL]; if (![schema isEqualToString:JSONSchemaDraftV4]) { @@ -1288,7 +1291,7 @@ + (void)validate:(id)o type:(NSString *)ot withSchema:(id)s schemaType:(NSString + (NSError *)errorWithDescription:(NSString *)description { NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; - userInfo[NSLocalizedDescriptionKey] = [self.bundle localizedStringForKey:description value:description table:JSONErrorsTable]; + userInfo[NSLocalizedDescriptionKey] = [[NSBundle bundleForClass:self.class] localizedStringForKey:description value:description table:JSONErrorsTable]; NSError *error = [NSError errorWithDomain:JSONErrorDomain code:0 userInfo:userInfo]; return error; } @@ -1466,7 +1469,7 @@ - (NSString *)resolvedType { - (NSError *)errorWithDescription:(NSString *)description atPath:(NSString *)path { NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; - userInfo[NSLocalizedDescriptionKey] = [self.bundle localizedStringForKey:description value:description table:JSONErrorsTable]; + userInfo[NSLocalizedDescriptionKey] = [[NSBundle bundleForClass:self.class] localizedStringForKey:description value:description table:JSONErrorsTable]; userInfo[NSFilePathErrorKey] = path; NSError *error = [NSError errorWithDomain:JSONErrorDomain code:0 userInfo:userInfo]; return error; @@ -1486,7 +1489,7 @@ - (NSError *)errorWithDescription:(NSString *)description atPath:(NSString *)pat @implementation NSObject (JSONSchema) + (JSONSchema *)JSONSchemaNamed:(NSString *)name { - NSURL *URL = [self.bundle URLForResource:name withExtension:ExtensionJSON]; + NSURL *URL = [[NSBundle bundleForClass:self.class] URLForResource:name withExtension:JSONExtension]; JSONSchema *schema = [JSONSchema.alloc initWithURL:URL]; NSAssert(schema, name); return schema; diff --git a/JSONSchema.podspec b/JSONSchema.podspec index e9c52db..5e2430e 100644 --- a/JSONSchema.podspec +++ b/JSONSchema.podspec @@ -135,6 +135,5 @@ Pod::Spec.new do |s| # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } # s.dependency "JSONKit", "~> 1.4" - s.dependency "Helpers" - + end