Commits

dcutting  committed ecaadf3

Fixes for old Xcode compilers.

  • Participants
  • Parent commits 30c5863

Comments (0)

Files changed (1)

File VeriJSON/VeriJSON/VeriJSON.m

 - (BOOL)verifyObject:(NSDictionary *)object attributeName:(NSString *)attributeName attributePattern:(id)attributePattern patternStack:(NSMutableArray *)patternStack {
     BOOL isOptional = [self isOptionalAttribute:attributeName];
     NSString *strippedAttributeName = [self strippedAttributeName:attributeName];
-    id value = object[strippedAttributeName];
+    id value = [object objectForKey:strippedAttributeName];
     if (value) {
         return [self verifyValue:value pattern:attributePattern permitNull:isOptional patternStack:patternStack];
     }
     if ([arrayPattern count] == 0) {
         return [array count] == 0;
     }
-    id valuePattern = arrayPattern[0];
+    id valuePattern = [arrayPattern objectAtIndex:0];
     [array enumerateObjectsUsingBlock:^(id value, NSUInteger idx, BOOL *stop) {
         if (![self verifyValue:value pattern:valuePattern permitNull:NO patternStack:patternStack]) {
             valid = NO;
     if (![value isKindOfClass:[NSString class]]) return NO;
     NSArray *components = [pattern componentsSeparatedByString:@":"];
     if ([components count] > 1) {
-        NSString *regexPattern = components[1];
+        NSString *regexPattern = [components objectAtIndex:1];
         NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexPattern options:0 error:NULL];
         NSUInteger numMatches = [regex numberOfMatchesInString:value options:NSMatchingReportCompletion range:NSMakeRange(0, [value length])];
         return numMatches > 0;