사용자가 textfiled에 잘못된 값을 입력하면 알림이 표시되고 텍스트 필드 emty와 버튼 제목도 비어있게하고 싶습니다. 내 코드 텍스트 필드는 비어 있지만 버튼이 있습니다. 직접UIButton의 제목이 비어 있거나 아이폰에 공백으로 설정되어 있지 않습니다.
처럼 할당하면 어떻게됩니까 내 코드
if (monthText>totalnumber) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"Value Must Be Less than total number of dogs " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
NSString *titleMonth [email protected]"0";
[cereniaButton setTitle:@"" forState:UIControlStateNormal];
[email protected]"";
}
int year=12;
int monthButtonTitle=monthText*year;
NSString *titleMonth =[NSString stringWithFormat:@"%d",monthButtonTitle];
[cereniaButton setTitle:titleMonth forState:UIControlStateNormal];
당신이 "지정을 시도 할 수 있습니다"는 NSString과 * titleMonth = @ ""; – CarlJ
도 표시되지 않습니다 – james
NSLog (@ "% @", cereniaButton)를 게시 할 수 있습니까? – CarlJ