title: GData Youtube Upload Crashing for iOS
body: <p>I'm trying to use the GData objective c project v1.12.0 to upload a video to youtube. I followed the following guide to get GData linked with my project:
  <a href="http://mischneider.net/?p=377#comment-1277" rel="nofollow">http://mischneider.net/?p=377#comment-1277</a></p>
  
  <p>It all seems to be linked properly, but I keep getting this error message:</p>
  
  <blockquote>
    <p>2011-06-23 15:06:30.729[79217:207] * Assertion failure in -GDataServiceBase fetchObjectWithURL:objectClass:objectToPost:ETag:httpMethod:delegate:didFinishSelector:completionHandler:retryInvocationValue:ticket:, /Users/aalesia88/Desktop/VOKAL/Developement/SSB-Youtube/GData/BaseClasses/GDataServiceBase.m:603
    2011-06-23 15:06:30.731[79217:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'GDataHTTPUploadFetcher needed'</p>
  </blockquote>
  
  <p>Here is my methods used in calling the upload procedure:</p>
  
  <pre><code>- (GDataServiceGoogleYouTube *)youTubeService 
  {
      GDataServiceGoogleYouTube* service = nil;
  
      if (!service) {
          service = [[GDataServiceGoogleYouTube alloc] init];
  
          [service setShouldCacheDatedData:YES];
          [service setServiceShouldFollowNextLinks:YES];
          [service setIsServiceRetryEnabled:YES];
      }
  
      SSBYoutubeCredentials *currentUser = [SSBYoutubeCredentials getCurrentUser];
      NSString *username = currentUser.username;
      NSString *password = currentUser.password;
  
      if ([username length] &gt; 0 &amp;&amp; [password length] &gt; 0) {
          [service setUserCredentialsWithUsername:username
                                         password:password];
      } else {
          // fetch unauthenticated
          [service setUserCredentialsWithUsername:nil
                                         password:nil];
      }
  
      NSString *devKey = DEVELOPER_KEY;
      [service setYouTubeDeveloperKey:devKey];
  
      return service;
  }
  
  - (void)setUploadTicket:(GDataServiceTicket *)ticket 
  {
      if (uploadTicket != nil) {
          [uploadTicket release];
      }
  
      uploadTicket = [ticket retain];
  }
  
  - (void)uploadVideoFile 
  {    
      NSString *devKey = DEVELOPER_KEY;
  
      GDataServiceGoogleYouTube *service = [self youTubeService];
      [service setYouTubeDeveloperKey:devKey];
  
      SSBYoutubeCredentials *currentUser = [SSBYoutubeCredentials getCurrentUser];
      NSString *username = currentUser.username;
  
      NSURL *url = [GDataServiceGoogleYouTube youTubeUploadURLForUserID:username];
  
      // load the file data
      NSString *path;
  #if !TARGET_IPHONE_SIMULATOR
      path = self.videoPath;
  #else
      path = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"];;
  #endif
      NSData *data = [NSData dataWithContentsOfFile:path];
      NSString *filename = [path lastPathComponent];
  
      // gather all the metadata needed for the mediaGroup
      NSString *titleStr = self.trick;
      GDataMediaTitle *title = [GDataMediaTitle textConstructWithString:titleStr];
  
      NSString *categoryStr = @"SSB";
      GDataMediaCategory *category = [GDataMediaCategory mediaCategoryWithString:categoryStr];
      [category setScheme:kGDataSchemeYouTubeCategory];
  
      NSString *descStr = self.description;
      GDataMediaDescription *desc = [GDataMediaDescription textConstructWithString:descStr];
  
      NSString *keywordsStr = @"SuperShredBros";
      GDataMediaKeywords *keywords = [GDataMediaKeywords keywordsWithString:keywordsStr];
  
      BOOL isPrivate = NO;
  
      GDataYouTubeMediaGroup *mediaGroup = [GDataYouTubeMediaGroup mediaGroup];
      [mediaGroup setMediaTitle:title];
      [mediaGroup setMediaDescription:desc];
      [mediaGroup addMediaCategory:category];
      [mediaGroup setMediaKeywords:keywords];
      [mediaGroup setIsPrivate:isPrivate];
  
      NSString *mimeType = [GDataUtilities MIMETypeForFileAtPath:path
                                                 defaultMIMEType:@"video/mp4"];
  
      // create the upload entry with the mediaGroup and the file
      GDataEntryYouTubeUpload *entry;
      entry = [GDataEntryYouTubeUpload uploadEntryWithMediaGroup:mediaGroup
                                                            data:data
                                                        MIMEType:mimeType
                                                            slug:filename];
  
  
      SEL progressSel = @selector(ticket:hasDeliveredByteCount:ofTotalByteCount:);
      [service setServiceUploadProgressSelector:progressSel];
  
      GDataServiceTicket *ticket;
      ticket = [service fetchEntryByInsertingEntry:entry
                                        forFeedURL:url
                                          delegate:self
                                          didFinishSelector:@selector(uploadTicket:finishedWithEntry:error:)];
  
      HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
      [self.navigationController.view addSubview:HUD];
      HUD.delegate = self;
      HUD.mode = MBProgressHUDModeDeterminate;
      HUD.labelText = @"Uploading...";
  
      [self setUploadTicket:ticket];
  }
  </code></pre>
  
  <p>If anyone has any insight into this problem that would be very helpful.</p>
  
  <p>Thanks,
  Anthony</p>