Use function from another class


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

Accessing Method from other Classes Objective-C


Copy this code and paste it in your HTML
  1. @implementation commonClass
  2. - (void)CommonMethod:(id)sender
  3. {
  4. //So some awesome generic stuff...
  5. }
  6. @end
  7.  
  8. @implementation ViewController2
  9.  
  10. - (void)do_something... {
  11. commonClass *c=[[commonClass alloc] init];
  12. [c CommonMethod];
  13. [c release];
  14. }
  15.  
  16. @end

URL: http://stackoverflow.com/q/1658471/907953

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.