Virtual interface

Discussion in 'Mac Programming' started by ncohen, Jun 3, 2009.

  1. macrumors newbie

    Joined:
    Mar 31, 2009
    #1
    Hello,
    I would like to create an interface without implementation... it would be an interface of a class which makes reference to the methods only. Is it possible to do that?

    For example:

    Superclass.h
    Code:
    
    @interface Superclass : NSObject
    {
    	
    }
    -(void)method1;
    -(void)method2;
    @end
    
    
    Subclass.h
    Code:
    
    @interface Subclass : Superclass
    {
    	int variable1;
            int variable2;
    }
    -(void)method1;
    -(void)method2;
    @end
    
    
    Subclass.m
    Code:
    @implementation Subclass
    -(void)method1
    {
          // some code
    }
    
    -(void)method2
    {
          // some code
    }
    @end
    
    This code doesn't work... is it possible to do something like that?

    Thanks
     
  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX

Share This Page