I have recently completed an exercise using two views, and the appDelegate to display a slider Value on a label on a different view from the slider itself. (label is updated with a refresh button.) It all works fine. Now i want to do the same thing, only send text from one view to the other. I tried to manipulate the code, but keep getting the error...(in something not a structure or union). Below is a snip of code of the action which dismisses the view and pulls the slider value.....I rather it pulled just a plain old UILabel and displayed the same text in my other UILabel in second view. Please let me know if you can help sort me out.
-(IBAction)returnToMainView{
XXXXAppDelegate *mainDelegate = (XXXXAppDelegate *)[[UIApplication sharedApplication]delegate];
mainDelegate.sli = slider.value;
[self dismissModalViewControllerAnimated:YES];
}
In second View where the value is retrieved:
-(IBAction)refresh{
XXXXAppDelegate *mainDelegate = (XXXXAppDelegate *)[[UIApplication sharedApplication]delegate];
NSString* convert = [NSString stringWithFormat"%f", mainDelegate.sli];
valueLBL.text = convert;
}
Thank you.
-(IBAction)returnToMainView{
XXXXAppDelegate *mainDelegate = (XXXXAppDelegate *)[[UIApplication sharedApplication]delegate];
mainDelegate.sli = slider.value;
[self dismissModalViewControllerAnimated:YES];
}
In second View where the value is retrieved:
-(IBAction)refresh{
XXXXAppDelegate *mainDelegate = (XXXXAppDelegate *)[[UIApplication sharedApplication]delegate];
NSString* convert = [NSString stringWithFormat"%f", mainDelegate.sli];
valueLBL.text = convert;
}
Thank you.