텍스트 입력으로 경고 창을 표시하도록되어이 코드 조각 UIAlertView 표시 할 수 없습니다 :텍스트 필드
self.alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"How are you?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
self.alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[self.alert show];
원인이 오류 :
Thread 7: Program received signal: "EXC_BAD_ACCESS"
이 자기 방법이다. 경고는 다음과 같이 정의됩니다.
@interface MyClass : NSObject
{
UIAlertView *alert;
id <MyClassDelegate> __unsafe_unretained delegate;
}
@property (nonatomic, retain) UIAlertView *alert;
@property (unsafe_unretained) id <MyClassDelegate> delegate;
나에게 아무런 문제가 없다. (대부분의 메모리 관리 문제를 해결할 수있는 ARC를 사용하고있다.) UIAlertViewDelegate 구현을 보여줄 수 있습니까? 백 트레이스를 게시 할 수 있습니까? –
이것을 실행하려고하는 iOS의 버전은 무엇입니까 ?? alertViewStyle은 iOS 5 이상에서만 사용할 수 있습니다. iOS 4.3 이하에서이 작업을 시도하면 충돌이 발생합니다. – jmstone617
iOS4에서는 setAlertViewStyle에 대해 "인식 할 수없는 선택기"가 될 수 있습니다. UI 스레드에 있습니까? – SVD