0

UIPickerView 연결에 문제가 있습니다. 내의 ViewController 클래스는 다음과 같습니다 인터페이스 빌더에서UIPickerView 연결

@interface MyViewController: UIViewController <UITextFieldDelegate, UIPickerViewDataSource, UIPickerViewDelegate> 
{ 
IBOutlet UIPickerView *pickerView;/this is what it says in all tutorials 
//other textfields 
} 
@property..of textfields, label, nsstring 
@end 

을, 내가 파일의 소유자를 클릭 + Ctrl을 때, 내 pickerview은 (튜토리얼에 표시되는 내용에 대해) 콘센트를 참조에 콘센트에 나타나고하지. 어떻게 연결합니까? 무엇에 연결해야합니까? 위의 클래스에도 작업이 등록 된 버튼을 클릭하면 PickerView가 표시되기를 원합니다.

답변

0

오해가있을 수 있습니다. 내가 설명했던 것과 비슷한 클래스를 만들었습니다 :

@interface MyViewController : UIViewController { UIPickerView * pickerView; }

@property (비 원자력, 유지) IBOutlet UIPickerView * pickerView;

그런 다음 xib을 열었습니다. MyViewController의 모든 콘센트 목록을 가져온 파일 소유자 (또는 두 개의 단추 마우스가없는 경우 cmd-click)를 마우스 오른쪽 단추로 클릭했습니다. 대부분의 자습서에서 제안하는 Ctrl 키를 누르는 것보다 훨씬 쉽습니다. 그런 다음 pickerView 옆의 원에서 클릭하여 pickerView로 드래그했습니다. 마우스 버튼을 놓으면 잘 연결됩니다.

Interface Builder screenshot