0

I've struggled for 6 hrs trying to pass a mutable string object from a view controller to the AppDelegate. I've seen a lot of comments on passing data between view controllers and have worked some of those tutorials, but can't seem to figure out how to pass data to the AppDelegate.

Thanks for any ideas

ronsinda
  • 139
  • 1
  • 5
  • possible duplicate of [iOS - Calling App Delegate method from ViewController](http://stackoverflow.com/questions/5082738/ios-calling-app-delegate-method-from-viewcontroller) – jrturton Jun 07 '12 at 06:43

1 Answers1

2
MyApplication *appDelegate = (MyApplication *)[[UIApplication sharedApplication] delegate];
[appDelegate appDelegateFunction:myString];

found on the SO question here

Community
  • 1
  • 1
Jason Kulatunga
  • 5,814
  • 1
  • 26
  • 50
  • Thanks Jason. The link provides more info than I found before, so maybe I can figure it out now. I tried this method for 3 hrs last night but guess I'm getting mixed up on where the object is declared and allocated. I'll try again with the help of this link – ronsinda Jun 07 '12 at 16:16