title: Why am I getting the superclass and not the subclass in my method call?
body: <p>I have this class, which is a port from a C# abstract class; this is the .h file:</p>
  
  <pre><code>@interface Schedule : NSObject  {
  
  }
  
  @property (strong, nonatomic) NSDate *apptStartTime;
  @property (strong, nonatomic) NSDate *apptEndTime;
  @property (strong, nonatomic) NSString *key;
  
  -(BOOL) occursOnDate: (NSDate *) timeOfAppointment;
  
  @end
  </code></pre>
  
  <p>This is the .m file for Schedule:</p>
  
  <pre><code>@implementation Schedule  {
  
  }
  
  @synthesize apptStartTime;
  @synthesize apptEndTime;
  @synthesize key;
  
  /**
  
  The OccursOnDate method is abstract and must be implemented by subclasses. When     passed a date, the schedulers must determine if an appointment falls on that date. If one does, the method should return true. If not, the method returns false.
  
  */
  
  -(BOOL) occursOnDate: (NSDate *) dateOfAppointment  {
  
      return YES:
  }
  </code></pre>
  
  <p>Because it's a C# abstract class, it has to be overridden (or subclassed) which I have done here (this is the .h file):</p>
  
  <pre><code>@interface SingleSchedule : Schedule  {
  
  }
  
  @property (strong,nonatomic) NSDate *apptDate;
  
  -(BOOL) occursOnDate: (NSDate *)date;
  
  @end
  </code></pre>
  
  <p>This is the .m file:</p>
  
  <pre><code>@implementation SingleSchedule  {
  
  }
  
  @synthesize apptDate; 
  
  -(BOOL) occursOnDate: (NSDate *)date  {
  
      return (apptDate == date);  //  &lt;--------- TODO   where is apptDate set?
  }
  </code></pre>
  
  <p>This is where I call the <strong>occursOnDate</strong> class, expecting to get the subcclass, but I get the superclass class instead:</p>
  
  <pre><code>-(void) addAppointmentsForDate:(NSDate *)checkDate scheduleSet: (NSMutableSet *)setOfSchedules appointmentSet:(NSMutableSet *)setOfAppts {
  
  Schedule *sc = [[Schedule alloc]init];
  Appointment *newAppt = [[Appointment alloc]init];
  
  NSArray *scheduleArray = [setOfSchedules allObjects];
  
  for(int i = 0; i &lt; scheduleArray.count; i++)  {
      if([sc occursOnDate: checkDate])   {  //  &lt;-------- method called is the superclass, not the override
          newAppt = [self generateAppointment:checkDate andSchedule: scheduleArray [i]];
          [setOfAppts addObject:newAppt];
      }
  }
  }
  </code></pre>
  
  <p>What am I missing here to be able to get the subclass method and not the other?  (I have looked at SO and Google but found nothing which would answer this question exactly).</p>