1
내 프로그램에 UIActionSheet가 포함되어 있습니다. A 버튼과 B 버튼이 2 개 포함되어 있습니다. 사용자가 A 버튼을 클릭하면 다른보기로 이동합니다. 이보기에는 3 개의 텍스트 필드가 있습니다. mainviewcontroller에서이 텍스트 필드에 값을 할당하고 있습니다. 문제는 내가는 newtask에 null 값을 얻고있다 AnotherViewcontroller.miphone에서 한보기에서 다른보기로 데이터를 전달할 수 없습니다.
- (void)viewDidLoad
{
task_update.text = newtask;
subtask_update.text =newsubtask;
duedate_update.text = newduedate;
time_update.text = newtime;
NSLog(@"The task is :%@",newtask);
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex: (NSInteger)buttonIndex
{
AnotherViewController *A = [[AnotherViewController alloc] init];
if (buttonIndex == 1)
{
A.newtask = name;
A.newsubtask = sub1;
A.newduedate = dateName;
A.newtime = timeName;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UpdateViewController *viewController =[storyboard instantiateViewControllerWithIdentifier:@"update"];
[self presentViewController:viewController animated:YES completion:NULL];
}
}
MainViewController.m
에서 그리고에- : 나는 아래의 코드를 붙여 넣습니다. 누구든지 해결책을 말해 줄 수 있습니까? :(
: 아직도 내가는 newtask에 null 값을 받고 없습니다 이니 .. :( – Div
다른보기 컨트롤러에서 업데이트 코드보기 appDelegate = (AppDele 게이트 *) [[UIApplication sharedApplication] delegate]; 이 라인 뷰를 추가로드 – iSanjay
않았다 : 정말 고마워요.... 그것을 가지고있어 .. :) – Div