Remove NSFastEnumeration for the Tokenizer and subclass the NSEnumerator instead

Memory management tends to be a bit complex in this case, especially under ARC, hence the
change to prevent a headache
This commit is contained in:
iska
2015-03-22 00:12:38 +01:00
parent 785760c625
commit 90cbccbc16
3 changed files with 6 additions and 29 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ static NSString * const TOKENIZER = @"tokenizer";
tokenizer.state = [state integerValue];
NSArray *expectedTokens = test.output;
NSArray *tokens = [tokenizer allTokens];
NSArray *tokens = [tokenizer allObjects];
XCTAssertEqualObjects(tokens, expectedTokens, @"%@", test.title);
}
}
@@ -145,7 +145,7 @@ static NSString * const TOKENIZER = @"tokenizer";
id token = nil;
do {
token = [tokenizer nextToken];
token = [tokenizer nextObject];
} while (token != nil);
}];
}