Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Implementing Designs for iPhone Customizing Table View Controllers Customizing Table View Cell Disclosure Indicators

Devin Scheu
Devin Scheu
66,191 Points

IOS

can somebody walk me step by step through this whole challenge or just gimme a answer because im done trying on it :/

MenuViewController.m
#import "MenuViewController.h"

@implementation MenuViewController

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    // ... some code omitted for brevity ...


    return cell;
}

@end

what is the problem you are having ?

Devin Scheu
Devin Scheu
66,191 Points

not passing the challenge, i have no clue what i'm doing wrong.

can you post the question ?

Devin Scheu
Devin Scheu
66,191 Points

This app has a menu for a pizza restaurant, and the owner has requested an image of a pizza slice be used instead of arrows as the disclosure indicators for cells in the menu. In the video we saw how to use a custom disclosure indicator from the MSCellAccessory library, but we can use our own custom image instead. Start by initializing a UIImage variable using the 'imageNamed' class method and 'pizza_slice' as the image name.

did it work ?

Glad I help you :) have a nice day

1 Answer

So basically they are asking to change the cell disclosure to your own image...

            - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
      UIImage *Image = [UIImage imageNamed:@"pizza_slice"];
    cell.accessoryView =[[[UIImageView alloc]  initWithImage:Image] autorelease];
          return cell ;}