这是我的代码。
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList];
query.q = [NSString stringWithFormat:@"'%@' IN parents", @"root"];
[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,GTLDriveFileList *files, NSError *error)
{
if (error == nil) {
if (self.driveFiles == nil) {
self.driveFiles = [[NSMutableArray alloc] init];
}
[self.driveFiles removeAllObjects];
[self.driveFiles addObjectsFromArray:files.items];
[tbDownload reloadData];
}
else
{
NSLog(@"An error occurred: %@", error);
}
}];
使用以下代码时出现错误。
发生了一个错误:Error Domain=com.google.GTLJSONRPCErrorDomain Code=401 "The operation couldn’t be completed. (Login Required)" UserInfo=0x8f72a40 {error=Login Required, GTLStructuredError=GTLErrorObject 0x8f647a0: {message:"Login Required" code:401 data:[1]}, NSLocalizedFailureReason=(Login Required)}
我已经在我的应用程序中登录了Google Drive。