iphone - Accessing a class' running instance from the AppDelegate -


New in Obje-C, I'm trying to trigger a method, an example of myMethod is viewControllerB = & Gt; The visual controller is instantciated to see the controller A = & Gt; I'm trying to call myMethod from AppDelegate => & gt; It seems that anyway I try to do this, this is my method triggering in a new instance of the view controller B

So the question is: How to send is the current of a view controller For example a message?

Please explain with code samples because I am not really comfortable with Obj-C

Thank you!

> ViewControllerA.m:

  if (_viewControllerB == zero) {self.viewControllerB = [[[ViewControllerB alloc] initWithNibName: @ "View ControllerB" bundle: [NSBindle Main bundle]] Autoreshal]; }   

viewControllerB.m:

- (zero) myMethod {NSLog (@ "myMethod!"); }

AppDelegate.m: Do not know what to put here: (

To get the same example

{

  (See isKindOfClass) (see UIViewController * self.navigationController.viewControllers)  

: [ViewControllerB class]) {[see yourmethodname];}

}

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -