Skip to content

Instantly share code, notes, and snippets.

@draftcode
Created December 2, 2011 18:37
Show Gist options
  • Select an option

  • Save draftcode/1424325 to your computer and use it in GitHub Desktop.

Select an option

Save draftcode/1424325 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface ClassA : NSObject
@end
@implementation ClassA
@end
@interface ClassB : NSObject
@end
@implementation ClassB
@end
int main(void) {
{
ClassA *objA = [[ClassB alloc] init]; // OK
[objA release];
}
{
ClassA *objA = [[ClassA alloc] init];
ClassB *objB = objA; // OK
[objB release];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment