Add an external TableView inside a small view on the Main Screen
<p>I have a simply MainWindow file created by the Interface Builder in black background. Inside this plain view, I've added from top to bottom a small view (300x100), a textLabel and a couple of buttons.</p>

<p>In the MainApplication.h I've defined:</p>

<p>IBOutlet RoundRectView* smallView;
IBOutlet UILabel* label;</p>

<p>In the MainApplication.h I've @synthesized these variables and with that:</p>

<p>[label setText:@"Test"];</p>

<p>I can see all in my screen and it works perfect.</p>

<p>Now my problem:</p>

<p>I want to add a table with two rows inside my small white view, and what I've done is:</p>

<ol>
<li>Create a tableController.h who's the delegate and the data source:</li>
</ol>

<blockquote>
  <p>@interface IncomeExpenseController :
  UITableViewController
   {  IBOutlet
  UITableView* smallTable;  NSArray
  *content; }</p>
  
  <p>@property (nonatomic, retain)
  UITableView *smallTable; @property
  (nonatomic, retain) NSArray *content;</p>
  
  <p>@end</p>
</blockquote>

<ol>
<li>Create the .m file with:</li>
</ol>

<blockquote>
  <p>@synthesize smallTable; @synthesize
  content;</p>
  
  <ul>
  <li><p>(void)viewDidLoad {
  [super viewDidLoad];  content = [[NSArray alloc]
  initWithObjects:@"Item1", @"Item2",
  nil]; }</p></li>
  <li><p>(NSInteger)numberOfSectionsInTableView:(UITableView
  *)tableView {
  // Return the number of sections.
  return 0; }</p></li>
  <li><p>(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  // Return the number of rows in the section.
  return 2; }</p></li>
  </ul>
  
  <p>// Customize the appearance of table
  view cells.
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
  *)indexPath {</p>

<pre><code>static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc]
</code></pre>
  
  <p>initWithStyle:UITableViewCellStyleDefault
  reuseIdentifier:CellIdentifier]
  autorelease];
      }    NSLog(@"inside cell");</p>

<pre><code>// Configure the cell...    cell.textLabel.text = [content
</code></pre>
  
  <p>objectAtIndex:indexPath.row];</p>

<pre><code>return cell; }
</code></pre>
</blockquote>

<p>Now in the Interface Builder, I drag and drop a UITableView inside the white small view and drag and drop a Table View Controller along with the File Owner's window and I do these connections:</p>

<ol>
<li><p>Class of the Table View Controller to tableController</p></li>
<li><p>Outlets:
DataSource and Delegate to my Table Controller</p></li>
<li><p>Referencing Outlets:
customTable and View to my Table Controllers</p></li>
</ol>

<p>When I execute, I can see the lines of the table view but with no content, I cannot see the NSLog either but if I put a NSLog inside the viewDidLoad I can see it.</p>

<p>I'm really new (2 days) on that and any help would be really appreciated.</p>

<p>Thanks!</p>
