2011-07-31 7 views
0

私はWindowsベースのアプリケーションを作成し、UITabBarControllerを追加しました。すべてのタブのビューの要素として、(オブジェクトパネルから)ナビゲーションコントローラを追加しました。 次に、xibファイルを持つUITableViewControllerのサブクラスを作成しました。そして、私のサブクラスに前に追加したUINavigationControllerのビューを(プロパティで)変更しました。その後、私は次の行を変更しました。UITableViewは要素を表示しません

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    self.title = NSLocalizedString(@"devices", @"my devices"); 
    NSMutableArray *array = [[NSArray alloc] initWithObjects: @"Kitchen", @"Door 1", @"Door 2", nil]; 
    self.devicesArray = array; // it's a private variable 
    [array release]; 
    NSLog(@"%@", [self.devicesArray objectAtIndex:0]); 
} 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
    return [self.devicesArray count]; 
} 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"Cell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
    } 

    // Configure the cell... 

    NSInteger row = [indexPath row]; 
    cell.textLabel.text = [devicesArray objectAtIndex:row]; 

    return cell; 
} 

しかし、私はきれいなUITableViewを見ることができます。テキストなし。しかし、のNSLogを使用すると、XIBファイル内デリゲートのdataSourceアウトレット接続を設定している適切

答えて

0

チェックviewDidLodでテキストを出力します。

関連する問題