Skip to content

Instantly share code, notes, and snippets.

@PsychoH13
Created June 28, 2013 22:05
Show Gist options
  • Save PsychoH13/5888505 to your computer and use it in GitHub Desktop.
Save PsychoH13/5888505 to your computer and use it in GitHub Desktop.
#import problem
//----------------------------------------
// A.h
#import "B.h"
@interface A : NSObject
@property B *obj;
@end
// ---------------------------------------
// A.m
#import "A.h"
@implementation A
@end
//----------------------------------------
// B.h
#import "A.h"
@interface B : NSObject
@property A *obj;
@end
// ---------------------------------------
// B.m
#import "B.h"
@implementation B
@end
//----------------------------------------
// What the compiler do when compiling A.m
@interface B : NSObject
@property A *obj;
@end
@interface A : NSObject
@property B *obj;
@end
@implementation A
@end
//----------------------------------------
// What the compiler do when compiling B.m
@interface A : NSObject
@property B *obj;
@end
@interface B : NSObject
@property A *obj;
@end
@implementation B
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment