Guest User

Untitled

a guest
Jul 21st, 2013
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Main Method
  2. **************************************************
  3. #import <Foundation/Foundation.h>
  4. #import "XYZShoutingPerson.h"
  5.  
  6. int main(int argc, const char * argv[])
  7. {
  8.  
  9. @autoreleasepool {
  10.  
  11. XYZPerson *person=[[XYZPerson alloc] init];
  12. if(person)
  13. {
  14. [person sayHello];
  15. }
  16. else
  17. {
  18. NSLog(@"Person Object is NULL");
  19. }
  20. }
  21. return 0;
  22. }
  23. ****************************************************
  24. -(id)init
  25. {
  26. self=[super init];
  27. return [self initWithFirstName:@"Ankit" LastName:@"Sehra" DOB:01/01/2000];
  28. }
  29. ***************************************************
  30.  
  31. -(id)initWithFirstName:(NSString *)aFirstName LastName:(NSString *)aLastName DOB:(NSDate *)aDateOfBirth
  32. {
  33. _firstName=aFirstName;
  34. _lastName=aLastName;
  35. _dateOfBirth=aDateOfBirth;
  36. }
  37. ***********************************************
  38. -(void)sayHello;
  39. {
  40. NSLog(@"%@ %@ %@",self.firstName,self.lastName,self.dateOfBirth);
  41. }
RAW Paste Data