Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 3, 2009, 05:57 PM   #1
ncohen
macrumors newbie
 
Join Date: Mar 2009
Virtual interface

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
ncohen is offline   0 Reply With Quote
Old Jun 3, 2009, 06:05 PM   #2
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
You want a protocol:
http://developer.apple.com/documenta...01163-CH15-SW1

-Lee

Last edited by lee1210; Jun 3, 2009 at 06:07 PM. Reason: fix link
lee1210 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Getting the right interface... Drew017 Digital Audio 4 Jan 11, 2014 01:37 AM
Audio Interface inhalexhale1 Digital Audio 8 Nov 2, 2013 09:55 PM
Pashua gui tool interface elements anything similar in xcode interface builder wild4life2013 Mac Programming 1 Aug 10, 2013 09:13 PM
Interface Help masch152 OS X 10.8 Mountain Lion 0 Nov 26, 2012 05:48 PM
Help with @interface code tulipano Mac Programming 15 Jul 11, 2012 11:08 AM

Forum Jump

All times are GMT -5. The time now is 04:19 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC