iphone - How can a method tell which view controller called it -


i want current view controller in own method. mean have 2 view controllers calling same method. in want diffentiate view controller class calling method.

please me out

lets mycommonmethod: common function called both view controller , check viewcontroller whether it's member of class or not using ismemberofclass: method of nsobject.

-(void) mycommonmethod:(uiviewcontroller*) aviewcontroller {       if([aviewcontroller ismemberofclass:nsclassfromstring(@"myfirstcontroller")])       {       }       else if([aviewcontroller ismemberofclass:nsclassfromstring(@"mysecondcontroller")])       {          } } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -