iphone / hello world 2 / single rows in the table view

// --
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

// Customize the appearance of table view cells.
- (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];
    }

    [cell.textLabel setText:@"Hello World!"];
    return cell;
}
// --
// --

Comments are closed.

Related URL:
  1. Garmin 310XT PK iPhone4 GPS location 精準度
  2. 2011 巴黎馬拉松 – 法國警局
  3. [open source] iPhone , UIImage and PhotosAlbum 上傳一個圖到 simulator 的相簿 PhotosAlbum sample code
  4. 試用 ADIDAS 的 micoach iPhone APP. 跑10K間歇 ( without heart rate monitor)
  5. sample iPhone screen snapshot
  6. [iPhone dev] 今天看到一個精巧的設計 / tableview / iPhone design pattern
  7. 幾個 iPhone dev 的 opensource site
  8. My iPhone 4 / iP 4
  9. @@ 是誰又亂丟箱子在我桌上啊. . .
  10. iPhone icon size / iPhone 人機介面建議守則