The documentations states registered operation classes are consulted to the reverse order in which they are registered. New registrations are added to the beginning of the array in the register implementation. Fixed using the reverseObjectEnumerator when iterating the array which produced the opposite of documented behaviour. fixes #794

This commit is contained in:
Joel Parsons 2013-03-11 13:15:19 +00:00
Родитель 4732be728e
Коммит 6a46815eaf
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -517,12 +517,12 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
{
AFHTTPRequestOperation *operation = nil;
NSString *className = nil;
NSEnumerator *enumerator = [self.registeredHTTPOperationClassNames reverseObjectEnumerator];
while (!operation && (className = [enumerator nextObject])) {
for (NSString * className in self.registeredHTTPOperationClassNames) {
Class op_class = NSClassFromString(className);
if (op_class && [op_class canProcessRequest:urlRequest]) {
operation = [(AFHTTPRequestOperation *)[op_class alloc] initWithRequest:urlRequest];
break;
}
}