alertViewShouldEnableFirstOtherButton 메서드에서 사용자 입력의 첫 문자를 대문자로 변경하려고합니다.alertViewShouldEnableFirstOtherButton의 무한 루프 iOS5
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView{
NSString *inputText = [[alertView textFieldAtIndex:0] text];
if(inputText.length==0)return NO;
unichar firstChar=[[inputText capitalizedString] characterAtIndex:0];
NSString *capitalizedLetter= [NSString stringWithCharacters:&firstChar length:1];
NSString *str=[inputText stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:capitalizedLetter];
[[alertView textFieldAtIndex:0] setText:str];// setText calls again alertViewShouldEnableFirstOtherButton
return YES;
}
: 아이폰 OS 6하지만 내가 무한 루프를 얻을 것 같다에서 iOS 5에서 예상대로 모든는 코드 여기 (I은 경고보기의 텍스트 필드를 설정하면 프로그램이 재귀 적 방법 alertViewShouldEnableFirstOtherButton를 호출) 작동