Guest User

Untitled

a guest
Apr 25th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main(void)
  2. {
  3. // Creating an object
  4. Possession *p = [[Possession alloc] init];
  5. NSString *s = [[NSString alloc] initWithString:@"Hey"];
  6. [p setPossessionName:s];
  7. [s release];
  8.  
  9. NSMutableArray *items = [[NSMutableArray alloc] init];
  10. items addObject:[p possessionName]];
  11.  
  12. for(i=0; i < [items count]; i++){      
  13.     NSLog(@"%@", [items objectAtIndex:i]);
  14. }
  15.  
  16. return 0;
  17. }
  18.  
  19.  
  20. //implementation
  21.  
  22. // Setters
  23. - (void)setPossessionName:(NSString *)str
  24. {
  25.     possessionName = str;
  26. }
Add Comment
Please, Sign In to add comment