Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Main Method
- **************************************************
- #import <Foundation/Foundation.h>
- #import "XYZShoutingPerson.h"
- int main(int argc, const char * argv[])
- {
- @autoreleasepool {
- XYZPerson *person=[[XYZPerson alloc] init];
- if(person)
- {
- [person sayHello];
- }
- else
- {
- NSLog(@"Person Object is NULL");
- }
- }
- return 0;
- }
- ****************************************************
- -(id)init
- {
- self=[super init];
- return [self initWithFirstName:@"Ankit" LastName:@"Sehra" DOB:01/01/2000];
- }
- ***************************************************
- -(id)initWithFirstName:(NSString *)aFirstName LastName:(NSString *)aLastName DOB:(NSDate *)aDateOfBirth
- {
- _firstName=aFirstName;
- _lastName=aLastName;
- _dateOfBirth=aDateOfBirth;
- }
- ***********************************************
- -(void)sayHello;
- {
- NSLog(@"%@ %@ %@",self.firstName,self.lastName,self.dateOfBirth);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement