Tableview icon

Discussion in 'iOS Programming' started by fireshot91, Aug 16, 2011.

  1. fireshot91
    Expand Collapse
    macrumors 601


    Jul 31, 2008
    Northern VA
    So, forgive my newbieness. I'm not an objective-c developer.

    But, I've created a sample application that consists of a table, pulling entries in cells from a database. Then, when you click on that cell, it goes to a text & image view where it displays a number, pulled from the database, and a pie chart.

    Now, I want to put icons on the left side of each cell (Preferably a different icon in each, hosted in the workspace in a .png). How/where would I put that code, and..what code would I even put?
  2. Shawnpk, Aug 16, 2011
    Last edited: Aug 16, 2011

    Expand Collapse
    macrumors 6502

    Jan 13, 2011
    Los Angeles, CA
    That code belongs in the -(UITableViewCell *)tableView: (UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath method. You can use an "if" statement or better yet a "switch" statement to add a unique icon in each cell.

Share This Page