Skip to content

Commit

Permalink
backtrack
Browse files Browse the repository at this point in the history
  • Loading branch information
tvillia committed May 11, 2012
1 parent 997cb67 commit c80fac5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
2 changes: 2 additions & 0 deletions Restaurants/DetailViewController.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "Restaurant.h" #import "Restaurant.h"


@class Review;

@interface DetailViewController : UIViewController @interface DetailViewController : UIViewController
{ {
Restaurant* restaurant; Restaurant* restaurant;
Expand Down
39 changes: 5 additions & 34 deletions Restaurants/DetailViewController.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,46 +20,17 @@ @implementation DetailViewController
@synthesize star4; @synthesize star4;
@synthesize star5; @synthesize star5;


- (Review*) findMostHelpfulReview
{
return nil;
}

#pragma mark - View lifecycle #pragma mark - View lifecycle


- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
restaurant = [[Restaurant alloc] init];


restaurant.name = @"Pio Pio";
restaurant.address = @"746 First Avenue\nNew York, NY 10128";
restaurant.cuisineType = @"Peruvian";
restaurant.yearOpened = 1995;

Review* review1 = [[Review alloc] init];
review1.text = @"What fab-u-lass chicken! We could eat it all day if we didn't have to stop to drink sangria!";
// review1.reviewer = @"The Addams";
review1.score = 5;
review1.numberOfHelpfulRatings = 19;
review1.numberOfUnhelpfulRatings = 8;

Review* review2 = [[Review alloc] init];
review2.text = @"I DONE POSTED ON DA INTARWEBS!";
// review2.reviewer = @"Anonymous";
review2.score = 1;
review2.numberOfHelpfulRatings = 0;
review2.numberOfUnhelpfulRatings = 45;

Review* review3 = [[Review alloc] init];
review3.text = @"Some of the best chicken I've ever eaten. A helpful tip: get some green (Aji) sauce to go, they sell it by the pint!";
review3.reviewerName = @"Jim Carr";
review3.score = 5;
review3.numberOfHelpfulRatings = 28;
review3.numberOfUnhelpfulRatings = 2;

Review* review4 = [[Review alloc] init];
review4.text = @"While the food is amazing, they often simply don't pick up the phone when ordering out!";
// review4.reviewer = @"Paul";
review4.score = 4;
review4.numberOfHelpfulRatings = 14;
review4.numberOfUnhelpfulRatings = 5;

NSArray* array = [[NSArray alloc] initWithObjects:review1, review2, review3, review4, nil]; NSArray* array = [[NSArray alloc] initWithObjects:review1, review2, review3, review4, nil];
NSArray* reviews = [restaurant reviews]; NSArray* reviews = [restaurant reviews];


Expand Down

0 comments on commit c80fac5

Please sign in to comment.