Dot notation vs square brackets and casting in Objective-C
问题 Which of the following is best practice in Objective-C? UITableView* view = (UITableView*) [self view]; [view setSeparatorColor:[UIColor blackColor]]; [view release]; vs. ((UITableView*) self.view).separatorColor = [UIColor blackColor]; Or is there a better way of writing this? self.view is a UIView* . I'm asking both because I have a weird looking cast (maybe there's a better way?) and because of the following text from the official documentation, which hints that it's more than just a