-
-
Save Shereef/37447d76ec18a3ae3d34 to your computer and use it in GitHub Desktop.
Challenge 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XYZAppDelegate.h" | |
@interface XYZParent : NSObject | |
@property (atomic) NSMutableArray *children; | |
@end | |
@implementation XYZParent | |
@end | |
@interface XYZChild : NSObject | |
@property (atomic) XYZParent *parent; | |
@end | |
@implementation XYZChild | |
@end | |
@implementation XYZAppDelegate | |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
XYZParent *parent = [[XYZParent alloc] init]; | |
parent.children = [[NSMutableArray alloc] init]; | |
for (int i = 0; i < 10; i++) { | |
XYZChild *child = [[XYZChild alloc] init]; | |
child.parent = parent; | |
[parent.children addObject:child]; | |
} | |
return YES; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment