0

The setup:

I have an AppDelegate and declared on that is CustomUIViewController.h and in that controller I have RandomName.h declared (as an object, not a subclass) can I use [super methodName] or similar to trigger a method on CustomUIViewController from a method on RandomName.h?

Or do I have to pass it to the appDelegate and then from there to CustomUIViewController? (How I have been doing it)

Thanks

P.S. Coffee is good.

EmptyStack
  • 51,274
  • 23
  • 147
  • 178
Mytheral
  • 3,929
  • 7
  • 34
  • 57
  • Exactly in the project I'm working on it's a class that plays image sequences for me. What I'm attempting to find is another way of passing a "I'm done animating" value from RandomName back to CustomUIView without having to run it through AppDelegate. – Mytheral Sep 15 '11 at 13:27
  • For anyone looking at this thread, the notification center will work as well for the purpose. – Mytheral Sep 15 '11 at 14:49
  • Link for explanation: http://stackoverflow.com/questions/2191594/how-to-send-and-receive-message-through-nsnotificationcenter-in-objective-c – Mytheral Sep 15 '11 at 15:02

1 Answers1

0

I think I've understood your question. Pardon me if I didn't ;-)

super doesn't work that way. You can simply call,

[appDelegate.customViewController methodName];

The other way is to pass the reference of the customViewController to RandomName object, something like,

[[RandomName alloc] initWithParent:self];

You have to keep the reference of self in initWithParent method, lets say the variable name is parent, and call the method like this,

[parent methodName];
EmptyStack
  • 51,274
  • 23
  • 147
  • 178