두 개의 버튼과 TextField가있는 UIAlertView가 있습니다. 사용자가 텍스트 필드에 입력 한 텍스트를 저장하고 싶습니다. "name"이라는 문자열에 저장하십시오. 핵심 데이터. 모든 핵심 데이터 프로그래밍이 정확합니다. UITextField와 함께 alertview에서 사용하지 않았습니다. 사용자가 UIAlertView의 TextField에 저장 한 내용을 저장하는 방법을 모르겠습니다. 누군가 나를 도울 수 있다면 크게 감사하겠습니다. 여기 UIAlert TextField를 핵심 데이터로 저장
내 경고보기는 모습입니다 같은 : http://gyazo.com/8eba23f1fb1f5fbe49738af9185e689fUIAlertView에 대한 나의 코드 :
- (IBAction)button:(id)sender {
Lists *lists = [NSEntityDescription insertNewObjectForEntityForName:@"Lists" inManagedObjectContext:_managedObjectContext];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Add List" message:@"Create a New Wish List" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save", nil];
[alert setAlertViewStyle:UIAlertViewStylePlainTextInput];
[alert setTag:2];
[alert show];
NSError *error = nil;
if (![_managedObjectContext save:&error]) {
//Handle
}