I downloaded the Drupal-iOS-SDK from github
and I also downloaded AFNetworking files from here.
Then I added the files to my project, but it shows a strange error
Incompatible block pointer types sending ‘void (^)(NSInteger, NSInteger, NSInteger)’ to parameter of type ‘void (^)(NSInteger, long long, long long)’
for this piece of code:
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setUploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite);
}];
Does anyone have any idea what this means?
You are sending three
NSIntegers as parameters tosetUploadProgressBlockwhen it’s expected oneNSUInteger(unsigned integer) and twolong longparameterstotalBytesWrittenandtotalBytesExpectedToWriteneed to be of typelong longbecause that’s how they are defined, not `NSInteger’s. Your piece of code should look like:You may also want to modify your NSLog accordingly now that it’s set to
long longso the compiler doesn’t complain.