Posted By

kutyadog on 09/26/12


method function parameter variable Pass xcode

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


xcode declare and call method with parameter

 / Published in: Objective C

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

  1. //declare the method
  2. +(void) goGameScene:(int)lvl; //SceneManager.h
  3. +(void)goGameScene:(int)lvl { //SceneManager.m
  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  

You need to login to post a comment.