2011-07-31 95 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的输出viewDidLod正确的文本

回答

0

检查你已经设定了在厦门国际银行文件委托数据源出口连接。