Compile errors in Xcode 4 with default Cocoa application template

341 views
Skip to first unread message

Jackpod

unread,
May 10, 2011, 5:47:52 PM5/10/11
to Google Data APIs Objective-C Client Library Discussion
hello

i just created a brand new project in Xcode 4.0.2 using the default
Cocoa application template

then added gdata-objectivec-client-1.12.0

only included the contacts files and some of the common files (i.e.
base, elements and networking)

followed the setup instructions for compiling the source files
directly into a mac application

and when building, i get the following errors

please advise

thx!


conversion specifies type 'unsigned long' but the argument has type
'unichar' (aka 'unsigned short')

conflicting parameter types in implementation of
'fetchFeedWithURL:completionHandler:': 'void (^)(GDataServiceTicket *,
GDataFeedBase *, NSError *)' vs
'GDataServiceFeedBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataFeedBase *, NSError *)')

conflicting parameter types in implementation of
'fetchEntryWithURL:completionHandler:': 'void (^)(GDataServiceTicket
*, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)')

conflicting parameter types in implementation of
'fetchEntryByInsertingEntry:forFeedURL:completionHandler:': 'void (^)
(GDataServiceTicket *, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)')

conflicting parameter types in implementation of
'fetchEntryByUpdatingEntry:completionHandler:': 'void (^)
(GDataServiceTicket *, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)')

conflicting parameter types in implementation of
'deleteResourceURL:ETag:completionHandler:': 'void (^)
(GDataServiceTicket *, id, NSError *)' vs
'GDataServiceCompletionHandler' (aka 'void (^)(GDataServiceTicketBase
*, id, NSError *)')




full error messages:

MAL-Contacts Sync
/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
GDataUtilities.m
/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
GDataUtilities.m:68:46:{68:44-68:47}{69:13-69:57}: error: conversion
specifies type 'unsigned long' but the argument has type
'unichar' (aka 'unsigned short') [-Wformat,7]

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m
/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m:930:81:{930:43-930:80}: error:
conflicting parameter types in implementation of
'fetchFeedWithURL:completionHandler:': 'void (^)(GDataServiceTicket *,
GDataFeedBase *, NSError *)' vs
'GDataServiceFeedBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataFeedBase *, NSError *)') [2]

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m:950:83:{950:44-950:82}: error:
conflicting parameter types in implementation of
'fetchEntryWithURL:completionHandler:': 'void (^)(GDataServiceTicket
*, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)') [2]

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m:964:92:{964:53-964:91}: error:
conflicting parameter types in implementation of
'fetchEntryByInsertingEntry:forFeedURL:completionHandler:': 'void (^)
(GDataServiceTicket *, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)') [2]

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m:981:91:{981:52-981:90}: error:
conflicting parameter types in implementation of
'fetchEntryByUpdatingEntry:completionHandler:': 'void (^)
(GDataServiceTicket *, GDataEntryBase *, NSError *)' vs
'GDataServiceEntryBaseCompletionHandler' (aka 'void (^)
(GDataServiceTicketBase *, GDataEntryBase *, NSError *)') [2]

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
BaseClasses/GDataServiceGoogle.m:1027:74:{1027:44-1027:73}: error:
conflicting parameter types in implementation of
'deleteResourceURL:ETag:completionHandler:': 'void (^)
(GDataServiceTicket *, id, NSError *)' vs
'GDataServiceCompletionHandler' (aka 'void (^)(GDataServiceTicketBase
*, id, NSError *)') [2]

Jackpod

unread,
May 11, 2011, 7:05:19 PM5/11/11
to Google Data APIs Objective-C Client Library Discussion
sorry, there is one additional error that shows up when building for
release...

/Users/user/Untitled/Untitled/gdata-objectivec-client-1.12.0/Source/
Networking/GDataHTTPFetcherLogging.m:368:26:{368:26-368:60}
{368:5-368:23}: error: implicit conversion loses integer precision:
'unsigned long long' to 'NSUInteger' (aka 'unsigned int') [-
Wshorten-64-to-32,2]

thanks for looking into this!

Jackpod

unread,
May 17, 2011, 1:51:15 PM5/17/11
to Google Data APIs Objective-C Client Library Discussion
hi

just checking in to see if there is any information available on this
issue

thanks!

Greg Robbins

unread,
May 17, 2011, 11:30:39 PM5/17/11
to gdata-objec...@googlegroups.com
We're not using Xcode 4 internally yet, in part due to its backwards-compatibility issues.

Still, I'll try to rectify the type warnings in the top-of-trunk sources soon. Thanks for pointing them out.


Greg Robbins

unread,
May 18, 2011, 9:25:21 PM5/18/11
to gdata-objec...@googlegroups.com
I've checked in some changes to the top-of-trunk sources that should hopefully resolve the compiler errors.

Jackpod

unread,
May 23, 2011, 5:28:16 PM5/23/11
to Google Data APIs Objective-C Client Library Discussion
hi

thank you!

form my quick test it looks like you may still have an issue in
GTMHTTPFetcherLogging.m with

responseDataLength = [downloadFileHandle_ offsetInFile];

as far as 'unsigned long long' to 'NSUInteger' is concerend

when i have time i suppose i'll check out the trunk and see if i can
integrate into project and see what errors occur

thanks again!

Greg Robbins

unread,
May 24, 2011, 2:34:33 PM5/24/11
to gdata-objec...@googlegroups.com
I've updated the top-of-trunk sources to explicitly cast this assignment. Thank you for pointing it out.


David Lowe

unread,
Nov 11, 2011, 4:24:54 PM11/11/11
to gdata-objec...@googlegroups.com
My app uses Google Docs and I just got these errors, too.  Sorry for the noob question, but what do I do to access the updates?  Do I need to re-download the library and link it again?

Greg Robbins

unread,
Nov 11, 2011, 4:46:38 PM11/11/11
to gdata-objec...@googlegroups.com
Assuming you checked the library out from the subversion repository, you can update your sources in a terminal window by changing directory into the library's folder, and typing   svn update

David Lowe

unread,
Nov 12, 2011, 12:36:28 AM11/12/11
to gdata-objec...@googlegroups.com
I'm not sure what it means to "check the library out from the subversion repository."  I have a folder called "gdata-objectivec-client-1.10.0" in my documents directory, and when I go into xcode, and use "show in Finder" to reveal the GData files they are gdata-objectivec-client-1.10.0/Source/Clients/etc.  But when I use svn update in any one of those directories I get a "Skipped '.' " error.

Greg Robbins

unread,
Nov 12, 2011, 12:59:20 AM11/12/11
to gdata-objec...@googlegroups.com
1.10.0 is an old version that was downloaded as a zip file.

You can get the current version of the library by opening a terminal window and entering the svn checkout command shown at http://code.google.com/p/gdata-objectivec-client/source/checkout

David Lowe

unread,
Nov 12, 2011, 10:35:13 PM11/12/11
to gdata-objec...@googlegroups.com
Thanks!  I used svn checkout and got the newest version, deleted all the references to the old GData files in my project, then dragged the new Sources folder into the project.  That eliminated the initial errors I was getting.  I had some errors from the old OAuth code in my project, but replaced that with the new code from here (http://code.google.com/p/gtm-oauth2/wiki/Introduction) and there's no warnings there now, either.

I am getting a warning in the following section of my code that the instance method -setShouldCacheDatedData can't be found.  I can't find an alternative in GDataServiceGoogleDocs.h.

- (GDataServiceGoogleDocs *)docsService {
static GDataServiceGoogleDocs* service = nil;
if (!service) {
service = [[GDataServiceGoogleDocs allocinit];
[service setShouldCacheDatedData:YES];
[service setServiceShouldFollowNextLinks:YES];
[service setIsServiceRetryEnabled:YES];
[service setAuthorizer:self.mAuth];
}
return service;
}

Also, all of the test .m files in the Tests folder are giving me countless errors.  But when I simply delete the Tests folder I get an "Apple Mach-O Linker" error: "Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1"  Is there a way to remove folders I don't need (like the Tests folder) without this error?

Greg Robbins

unread,
Nov 12, 2011, 11:35:39 PM11/12/11
to gdata-objec...@googlegroups.com
setShouldCacheDatedData: has been replaced in the service objects with setShouldCacheResponseData:

The test files should not be included in any application build target. They are for use only in the GData project's unit test target.

David Lowe

unread,
Nov 13, 2011, 1:18:19 AM11/13/11
to Google Data APIs Objective-C Client Library Discussion
Thanks again! I removed all the test files, linked to
SystemConfiguration.framework, which was apparently responsible for
the Apple Mach-O Linker errors, and it resolved that issue. I also
replaced the GDATA_FOREACH statements (which were getting the warning
"implicit declaration of function 'GDATA_FOREACH' is invalid in
C99") from the code sample I'd received for uploading a spreadsheet,
with a regular 'for' statement and it compiled without issues.

The only problem I'm having now, is that when I go to upload a
spreadsheet in my app, whichever gmail login I use the first time, is
the only account it uploads to. It doesn't keep me visibly signed
into that account, it still prompts me to sign in again each time I go
to upload. And even when I log in with a different account (I can see
the new account name and picture displayed on the "requesting
permission to" page), when I tap "Allow access" and it pushes back to
my app to upload the spreadsheet, it still uploads it to the account I
used the first time. When I stop the app from running in the
background and restart it, I can log in again with another account and
upload, but then that becomes the only account it uploads to until I
close the app completely again.

Sorry to post such a string of questions, but thank you so much for
your help! It really has been a life saver.

david

Greg Robbins

unread,
Nov 13, 2011, 3:06:07 AM11/13/11
to gdata-objec...@googlegroups.com
Sign-in via OAuth 2 returns a authorization token, wrapped by the gtm-oauth2 view controller in a GTMOAuth2Authorization object. Be sure to replace the authorizer of the GData service class with the new authorization object when the user has signed in.
Reply all
Reply to author
Forward
0 new messages