我正在尝试将 AFNetworking 与 AFPropertyListRequestOperation 一起使用来下载 plist 并使用它。不知何故,这不起作用,因为 AFNetworking 似乎不喜欢 plist 或其他任何格式的格式。该块甚至没有被解雇。相反,错误块被触发。
任何暗示为什么会这样?
NSURL *url = [NSURL URLWithString:@"https://dl.dropboxusercontent.com/u/9358444/iOS/zet.plist"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFPropertyListRequestOperation *operation = [AFPropertyListRequestOperation propertyListRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id propertyList) {
//do something
NSDictionary *myDic = (NSDictionary *)propertyList;
NSLog(@"%@", myDic);
NSLog(@"Fired PLIST");
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id propertyList) {
//error
NSLog(@"Error PLIST");
}];
[operation start];