스위프트 초보자는 여기에 있습니다. 나는 Swift의 교과서를 읽고 이상한 표현을 발견했다 ...이 코드는 무엇인가 (두 번째 "let"라인)하고 있는가? 등호와 UITableVIewCell 메소드 사이를 살펴보십시오. 내게는 "c는 무효가 아니며 선택적이어야하며 C가 언랩되어야합니다 ...."처럼 보입니다.스위프트의 브래킷에 할당
(c! = nil)? 기음!
검색 엔진에서 좋은 검색 키워드를 만들 수 없어 인터넷 (Google)에서 검색하기가 어렵습니다.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
//create cells in table
let c = tableView.dequeueReusableCellWithIdentifier("table_cell")
let cell = (c != nil) ? c!: UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "table_cell")
return cell
}