2015-02-04 11 views
0

프로토 타입 셀에 두 개의 레이블 (CountryCode, CountryName)이 있고 "CountryCell"이라는 클래스를 만들고 "CountriesVC"라는 TableViewController 클래스를 만들었습니다. 레이블을 만들었습니다. 'CountryCell의 콘센트는 CountriesVC에서 사용하기를 원합니다. 그렇게하면'CountriesVC '에'CountryCode '라는 멤버가 없다는 오류가 발생합니다.(스위프트)

고마워요.

class CountryCell: UITableViewCell { 

@IBOutlet weak var CountryCode: UILabel! 
@IBOutlet weak var CountryName: UILabel! 


override func awakeFromNib() { 
    super.awakeFromNib() 
    // Initialization code 
} 

override func setSelected(selected: Bool, animated: Bool) { 
    super.setSelected(selected, animated: animated) 

    // Configure the view for the selected state 
} 

} 
+0

또한 선택한 셀에 CountryCode 및 CountryName을 사용하고 싶습니다. 어떻게 할 수 있습니까? – user3380361

답변

0

액세스하려는 이러한 속성은 현재 클래스에 선언되지 않은 : 여기

은 내가 COUNTRYCODE를 사용하려면 코드와 COUNTRYNAME입니다

다음
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 
     if segue.identifier == "ChangeCountryCode" { 

      SelectedCCode = self.CountryCode.text 
      SelectedCName = self.CountryName.text 

     } 
    } 

는 CountryCell 코드 . 먼저 "CountryCell"유형의 변수를 작성한 다음 해당 클래스의 특성에 액세스해야합니다.

+0

고맙습니다 ... – user3380361