I am trying to use GData ObjC library to upload videos from iPhone to Youtube.
When I try to build my project after adding the library (present here : svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/gdata-objectivec-client-read-only) , I keep getting the error –Duplicate interface definition for class ‘GDataHTTPUploadFetcher’– in GDataServiceBase.m.
However, when I do the same in a fresh project, I don’t run into any issues at all. I have checked all the imports and project settings, they are all the same.
What should I look for, to resolve such an issue ?
Additional Info :
(To answer one of Till’s questions in the comments, because I’m not absolutely sure about categories)
In GDataHTTPUploadFetcher.h, this is how the interface is :
@interface GDataHTTPUploadFetcher : GDataHTTPFetcher {
GDataHTTPFetcher *chunkFetcher_;
BOOL needsManualProgress_
NSURL *locationURL_;
// uploadData_ or uploadFileHandle_ may be set, but not both
NSData *uploadData_;
NSFileHandle *uploadFileHandle_;
NSInteger uploadFileHandleLength_;
NSString *uploadMIMEType_;
NSUInteger chunkSize_;
BOOL isPaused_;
.
.
.
}
+ (GDataHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request
uploadData:(NSData *)data
uploadMIMEType:(NSString *)uploadMIMEType
chunkSize:(NSUInteger)chunkSize;
+ (GDataHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request
uploadFileHandle:(NSFileHandle *)fileHandle
uploadMIMEType:(NSString *)uploadMIMEType
chunkSize:(NSUInteger)chunkSize;
- (id)initWithRequest:(NSURLRequest *)request
uploadData:(NSData *)data
uploadFileHandle:(NSFileHandle *)fileHandle
uploadMIMEType:(NSString *)uploadMIMEType
chunkSize:(NSUInteger)chunkSize;
- (void)pauseFetching;
- (void)resumeFetchingWithDelegate:(id)delegate;
- (BOOL)isPaused;
@end
In GDataHTTPUploadFetcher.m, this is how the interface is :
@interface GDataHTTPUploadFetcher (InternalMethods)
- (void)uploadNextChunkWithOffset:(NSUInteger)offset;
- (void)uploadNextChunkWithOffset:(NSUInteger)offset
fetcherProperties:(NSDictionary *)props;
- (void)destroyChunkFetcher;
- (void)uploadFetcher:(GDataHTTPFetcher *)fetcher
didSendBytes:(NSInteger)bytesSent
totalBytesSent:(NSInteger)totalBytesSent
totalBytesExpectedToSend:(NSInteger)totalBytesExpected;
- (void)reportProgressManually;
- (NSUInteger)fullUploadLength;
// private methods of the superclass
- (void)invokeSentDataCallback:(SEL)sel
target:(id)target
didSendBodyData:(NSInteger)bytesWritten
totalBytesWritten:(NSInteger)totalBytesWritten
totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
- (void)invokeStatusCallback:(SEL)sel
target:(id)target
status:(NSInteger)status
data:(NSData *)data;
- (BOOL)invokeRetryCallback:(SEL)sel
target:(id)target
willRetry:(BOOL)willRetry
error:(NSError *)error;
@end
In GDataServiceBase.m, this is how the interface is :
@interface GDataHTTPUploadFetcher : GDataHTTPFetcher
+ (GDataHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request
uploadData:(NSData *)data
uploadMIMEType:(NSString *)uploadMIMEType
chunkSize:(NSUInteger)chunkSize;
+ (GDataHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request
uploadFileHandle:(NSFileHandle *)uploadFileHandle
uploadMIMEType:(NSString *)uploadMIMEType
chunkSize:(NSUInteger)chunkSize;
- (void)pauseFetching;
- (void)resumeFetchingWithDelegate:(id)delegate;
- (BOOL)isPaused;
@end
But the problem is, this code only creates problems in one of the existing projects, and not in a fresh project.
I had to move all my code to a new project, and then everything worked.
So apparently, I had messed up something in my project settings.
Thanks so much for all the help everyone.