xcode declare and call method with parameter


/ Published in: Objective C
Save to your folder(s)

I wanted to make a function / method and pass a var to it form another class.


Copy this code and paste it in your HTML
  1. //declare the method
  2. +(void) goGameScene:(int)lvl; //SceneManager.h
  3. +(void)goGameScene:(int)lvl { //SceneManager.m
  4.  
  5. //to call the method
  6. #import "SceneManager.h" //in the .h of class you call it from
  7. [SceneManager goGameScene:lvl]; //in the .m of the class you call it from

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.