我正在尝试使用 GData ObjC 库将视频从 iPhone 上传到 Youtube。
当我在添加库后尝试构建我的项目时(此处显示: svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/gdata-objectivec-client-read-only),我不断得到错误 - GDataServiceBase.m 中类“GDataHTTPUploadFetcher”的重复接口定义。
但是,当我在一个新项目中做同样的事情时,我根本不会遇到任何问题。我检查了所有的导入和项目设置,它们都是一样的。
我应该寻找什么来解决这样的问题?
附加信息 :
(在评论中回答 Till 的问题之一,因为我对类别不确定)
在GDataHTTPUploadFetcher.h中,界面是这样的:
@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
在GDataHTTPUploadFetcher.m中,界面是这样的:
@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
在GDataServiceBase.m中,接口是这样的:
@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
但问题是,这段代码只会在现有项目之一中产生问题,而不会在新项目中产生问题。