한 번 할당하고 초기화 한 후 "Init"를 추가 할 때 UIActionSheet의 버튼 스타일이 변경되는 이유는 무엇입니까? 이 코드를 사용하는 경우UIActionSheet - "init"이 버튼 스타일을 변경합니다.
가 제대로 나타납니다 : 나는 (추가 ...init]
포함)이 코드를 사용하는 경우
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Photo/Camera" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Capture - Camera", @"Upload - Photo Library", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];
그것이 IM-제대로 표시하고 "취소 "버튼 스타일이 변경되었습니다.
UIActionSheet *popupQuery = [[[UIActionSheet alloc] initWithTitle:@"Photo/Camera" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Capture - Camera", @"Upload - Photo Library", nil] init];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];
왜 '초기화'를 두 번 하시겠습니까? –
저는 실제 프로젝트에 참여하지 않았습니다. 왜 그렇게했을 때 버튼 스타일을 변경하는지 궁금합니다. –