Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDevin Scheu
66,191 PointsIOS
can somebody walk me step by step through this whole challenge or just gimme a answer because im done trying on it :/
#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
Devin Scheu
66,191 Pointsnot passing the challenge, i have no clue what i'm doing wrong.
Meek D
3,457 Pointscan you post the question ?
Devin Scheu
66,191 PointsThis 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.
Meek D
3,457 Pointsdid it work ?
Meek D
3,457 PointsGlad I help you :) have a nice day
1 Answer
Meek D
3,457 PointsSo 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 ;}
Devin Scheu
66,191 PointsOh, okay, thanks!
Meek D
3,457 PointsMeek D
3,457 Pointswhat is the problem you are having ?