텍스트 필드를 종료 할 때마다 UIActions 시트가 올라와 일부 정보를 저장하기로되어 있습니다. 텍스트 필드를 종료하면 프로그램이 종료되고 콘솔에 잘못된 클래스가 호출됩니다. 이 코드가 작동하지 않는 이유는 무엇입니까?클래스가 호출되지 않는 이유는 무엇입니까?
- (IBAction)classFieldDoneEditing:(id)sender
- (IBAction)classFieldDoneEditing:(id)sender
withActionSheet:(UIActionSheet *)typeSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
self.indicatedClass = classField.text;
NSString *greeting = [[NSString alloc]
initWithFormat:@"%@", indicatedClass];
labelClassTitle.text = greeting;
labelClassTitle.hidden = NO;
[greeting release];
[sender resignFirstResponder];
typeSheet = [[UIActionSheet alloc]
initWithTitle:@"Class types"delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@"Core Class", @"Elective", nil];
[typeSheet showInView:self.view];
[typeSheet release];
if (buttonIndex == 0) {
self.indicatedClass = classField.text;
NSString *indicatedString = indicatedClass;
NSString *greeting = [[NSString alloc]
initWithFormat:@"%@ meets 6 times per rotation", indicatedString];
labelClassTitle.text = greeting;
labelClassTitle.hidden = NO;
[greeting release];
[indicatedClass release];
}
else if (buttonIndex == 1) {
self.indicatedClass = classField.text;
NSString *indicatedString = indicatedClass;
NSString *greeting = [[NSString alloc]
initWithFormat:@"%@ meets 3 times per rotation", indicatedString];
labelClassTitle.text = greeting;
labelClassTitle.hidden = NO;
[greeting release];
[indicatedClass release];
}
}
나는 이것을 연결했다 – mentorship