ios - Can't call method from second ViewController -


I'm having trouble creating my application I try to call any method from ViewController1 in my existing View Controller 2 I am doing

Mys I have declared the method in the File Viewer1 file, so it is visible.

  - (zero) saveLocation;   

I have the following in my ViewController2.h file

  #import "ViewController1.h" @ Interface View Controller 2: UIViewController @property (nonatomic, Assign) View Controller 1 * Save the Method; @end   

and in my ViewController2.m

  [self.MethodSave saveLocation];   

This does not work and I have tried to fix it for a while. Any help would be great. Thanks

I think you have only one property @property (nonatomic, assign) in ViewController1 Has been declared * save the law; But if this property is not allocated then first assign it then call the function.

  MethodSave = [ViewController1New]; [Self. Method save place];   

Also declare assets as strong as @property (nonatomic, strong) ViewController1 * MethodSave; This should work.

And try to declare the variable in the case of camel.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -