这是我的代码
+(NSArray)getItem:(NSString)searchString {
NSArray *testArray = [[NSArray alloc] init];
NSString *searchURL = [NSString stringWithFormat:@"http://server.com/item/autocomplete_item.php?term=%@", searchString];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:searchURL parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
// NSLog(@"item response object : %@", responseObject);
testArray = (NSArray*)responseObject;
//[self getItemArray:(NSArray*)responseObject];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error : %@", error);
}];
return testArray;
}
但我得到一个错误说:
variable is not asssignable(missing_block type specifier)
请有人帮助我。提前谢谢。