Build failed: Semantic Issue #39

Closed
ghost opened this Issue May 21, 2012 · 11 comments

Projects

None yet

3 participants

@ghost
ghost commented May 21, 2012

Hi,

I've set up a new xcode project and added the AFNetworking library as described and build the project, no issues.

Then I added the drupal-ios-sdk and tried to build the project again. Unfortunately now I get a "Semantic Issue" in DIOSNode.m within the nodeAttachFile in Line 114

"Incompatible block pointer types sending 'void (^)(NSInteger, NSInteger, NSInteger)' to parameter of type 'void (^)(NSInteger, long long, long long)'"

What did I do wrong?

Thanks in advance,
anni

@kylebrowning
Collaborator

This should be fixed thanks!

@shiny13
shiny13 commented Sep 10, 2012

Hello, I have the same problems. Can anyone please help?

@kylebrowning
Collaborator

Why would you doubt that someone will help, I literally just received a text message over your issue. Ive fixed this issue in a previous commit, can you please confirm with a screenshot and what SDk you are using that this is still an issue?

@kylebrowning kylebrowning reopened this Sep 10, 2012
@shiny13
shiny13 commented Sep 10, 2012

@karimo Can you please tell me the link where you downloaded it from? I just downloaded it again and it shows the same error. This is the screenshot of the page I got it from: http://i84.photobucket.com/albums/k39/shiny13/ScreenShot2012-09-10at31948PM.png

It says DIOSNode.m was edited 5 days ago.

@shiny13
shiny13 commented Sep 10, 2012

@karimo Its still showing me that same error even after downloading form your link. Here is the screenshot of the error: http://i84.photobucket.com/albums/k39/shiny13/ScreenShot2012-09-10at33238PM.png

And also, I use XCode 4.3.2 and iOS 5.1 as base SDK.

@shiny13
shiny13 commented Sep 10, 2012

@kylebrowning @karimo Does it have anything to do with configuring the AFNetworking files? Because I went to 'Build Phases' and then 'Compile Sources' and then I pasted: -fno-objc-arc on the AFNetworking files. But please suggest a way for this error to be solved.

@shiny13
shiny13 commented Sep 12, 2012

@karimo @kylebrowning Hey guys I found a solution to the error I was having. Maybe someone in the future can read this and get help.

You are sending three NSIntegers as parameters to setUploadProgressBlock when it's expected one NSUInteger (unsigned integer) and two long long parameters

totalBytesWritten and totalBytesExpectedToWrite need to be of type long long because that's how they are defined, not `NSInteger's. Your piece of code should look like:

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
}];

Notice that in NSLog its best to send %lld parameters instead of %d because its expecting a long long type.

@kylebrowning
Collaborator

Fixed.

@markdorison

I am still seeing the issue even with e154dd4 applied.

@kylebrowning
Collaborator

Hrmm. Ive change this line like 50 times I think im just going to remove the actual nslog statement and give everyone the ability to add the upload progress block themselves.

@kylebrowning kylebrowning reopened this Sep 26, 2012
@kylebrowning
Collaborator

Its commented out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment