Objective-C skladnia funkcji

0

Witam! Mam problem ze zrozumienie tej definicji funkcji

(NSString)tableView:(UITableView *)tableView titleForHeaderSection:(NSInteger)section{}
moglby ktos napisac co tu sie dzieje...

1

to jest niepełne
powinno wyglądać tak:

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    return @"jakis tytuł";
}

Po pierwsze to jest implementacja protokołu (interface'u) UITableViewDataSource

- oznacza metodę wywoływaną na obiekcie
(NSString *) określa typ zwracany
(UITableView *)tableView - określa dla jakiej tabeli należy dostarczyć tytuł
(NSInteger)section - określa numer sekcji dla której potrzebny jest tytuł
tableView: titleForHeaderInSection: to nazwa funkcji (selektor).

To są podstawy składni, dowolny tutorial w sieci wszystko ci wyjaśni.

1 użytkowników online, w tym zalogowanych: 0, gości: 1