title: RestKit with Three20 Integration
body: <p>I'm trying to work with Restkit to call my web server api, but things are not working.
  My controller just show the activity indicator and nothing happens.</p>
  
  <p>I have an api call which suppose to return the top 50 videos ,for example:
  <a href="http://example.com/services/getTop50Video" rel="nofollow">http://example.com/services/getTop50Video</a></p>
  
  <p>The return is in the format of :</p>
  
  <pre><code>&lt;results&gt;
  &lt;mysql_host&gt;72.9.41.97&lt;/mysql_host&gt;
  &lt;results&gt;        
      &lt;title/&gt;
      &lt;views/&gt;
      &lt;video_id&gt;j2xFxHgENt4&lt;/video_id&gt;
      &lt;thumbnail&gt;http://img.youtube.com/vi/j2xFxHgENt4/2.jpg&lt;/thumbnail&gt;
      &lt;url/&gt;
  &lt;/results&gt;
  ...
  &lt;/results&gt;
  </code></pre>
  
  <p><strong>My App delegate Code</strong>:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  
      // Configure RestKit Object Manager
      RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://example.com/services"];
  
      RKObjectMapper* mapper =  objectManager.mapper;
      [mapper registerClass:[YouTubeVideo class] forElementNamed:@"video"];
  
       // Other non relevant stuff
  }
  </code></pre>
  
  <p><strong>TWYouTubeVideo Class</strong> :</p>
  
  <pre><code>@implementation TWYouTubeVideo
  
  @synthesize title = _title;
  @synthesize numberOfViews = _numberOfViews;
  @synthesize videoID = _videoID;
  @synthesize thumbnailURL = _thumbnailURL;
  
  
  + (NSDictionary*)elementToPropertyMappings {
      return [NSDictionary dictionaryWithKeysAndObjects:
              @"title", @"title",
              @"views", @"numberOfViews",
              @"video_id", @"videoID",
              @"thumbnail", @"thumbnailURL",
              nil];
  }
  </code></pre>
  
  <p><strong>My Controller code</strong> :</p>
  
  <pre><code>-(id) initWithResourcePath:(NSString*) requestedResourcePath
  {
      if (self = [super init])
      {
          self.resourcePath = requestedResourcePath;
      }
      return self;
  }
  
  - (void)createModel {
      self.model = [[[RKRequestTTModel alloc] initWithResourcePath:self.resourcePath] autorelease];
  }
  
  
  - (void)didLoadModel:(BOOL)firstTime {
      [super didLoadModel:firstTime];
  
      RKRequestTTModel* model = (RKRequestTTModel*)self.model;
      NSMutableArray* items = [NSMutableArray arrayWithCapacity:[model.objects count]];
  
          for (YouTubeVideo* video in model.objects) {
              TableSubtitleItem *item = [TableSubtitleItem itemWithText:video.title
                                                                   subtitle:[NSString stringWithFormat:@"%@ views", video.numberOfViews]
                                                                   imageURL:video.thumbnailURL
                                                               defaultImage:[YouTubeVideo defaultThumbnail]
                                                                        URL:nil
                                                               accessoryURL:nil];
  
              [items addObject:item];
          }
  
  
      // Ensure that the datasource's model is still the RKRequestTTModel;
      // Otherwise isOutdated will not work.
      TTListDataSource* dataSource = [TTListDataSource dataSourceWithItems:items];
      dataSource.model = model;
      self.dataSource = dataSource;
  }
  </code></pre>
  
  <p><strong>And pushing the Controller</strong>:</p>
  
  <pre><code>SecondYouTubeController* viewController = [[SecondYouTubeController alloc] initWithResourcePath:@"/getTop50VideoXML?json=true"];
  [self.navigationController pushViewController:viewController animated:YES];
  [viewController release];    
  </code></pre>
  
  <p>First, I guess I need to somehow tell the parser that the video objects appear inside a "response" node.
  Second, I'm not sure I'm doing all the calls as should.</p>
  
  <p>I would really appreciate help here. </p>