views:

365

answers:

2

Hey, What does this line of code mean? I do not understand it

- (IBAction)edit {
    self.editingViewController.movie = self.movie; // I dont understand this line
    [self presentModalViewController:self.editingViewController animated:YES]; 
}

And what about this?

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.titleLabel.text = self.movie.title;
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    self.boxOfficeGrossLabel.text = 
    [formatter stringFromNumber:self.movie.boxOfficeGross];
    [formatter release];
    self.summaryLabel.text = self.movie.summary;
}

Thanks

+5  A: 

Well, self is the object executing the method, editingViewController is a property of self, and movie is a property of both editingViewController and self. That line sets editingViewController's movie property to be the same as self's.

Chuck
+3  A: 

It looks like the object holds a reference to an editingViewController. Apparently, an editingViewController has a movie property. The first line is setting that property to the movie referenced by the movie property of the object.

Sinan Ünür