0
我在看一些代碼,並想知道這是如何工作的。在一個類中,我看到這樣的事情:UITableViewCellIdentifier的靜態NSString
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *simpleCellIdentifier = @"SimpleCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SimpleCellIdentifier"];
....
return cell
}
然後在另一個班,我會看到相同的片段股票UITableViewCells。我不知道,因爲它是靜態的,它就會被分配給項目右側的一生會發生什麼變化
static NSString *simpleCellIdentifier;
?所以如果另一個viewController中的代碼運行,會發生什麼?它只是使用在其他課程中創建的舊simpleCellIdentifier
?謝謝。