0

I create the instance of the Object 'Event' then add it to the array called eventsStore.

Event *event = [[Event alloc] init];
 event.courseName = @"Maths";
 event.room = @"405";
 event.startTime = [NSNumber numberWithInt:9];
 event.endTime = [NSNumber numberWithInt:10];
[eventsStore addObject:event];

I can see in the debugger when I run it that all the information is stored but when I try to NSLog the information back out using:

NSLog(@"%@", [eventsStore objectAtIndex:i]);

The only thing that shows up <Event: 0x10010ff10>. How can I print out the whole contents of the Event?

Larme
  • 24,190
  • 6
  • 51
  • 81

1 Answers1

1

To get a more detailed output when using this kind of NSLog, you can override the - (NSString *)description method of your NSObject subclass. See also this question: What is the Objective-C equivalent for "toString()", for use with NSLog?

Community
  • 1
  • 1
Sebastian Wramba
  • 10,087
  • 8
  • 41
  • 58