Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Returning/Passing a reference as its protocol
  2. @protocol Person<NSObject>
  3.  
  4. @interface Greek : NSObject <Person>
  5.        
  6. +(id<Person>)newGreek{
  7. return [[Greek alloc] init];        
  8. }
  9.        
  10. id<Person> person = [Persons newGreek];
  11.        
  12. Greek *greek = [[Greek alloc] init];
  13. [self talk:greek];
  14.        
  15. -(void)talk:(id<Person>)person