Skip to content

Instantly share code, notes, and snippets.

@Shereef
Forked from hamadmj/Find and fix the problem.
Created November 10, 2015 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shereef/37447d76ec18a3ae3d34 to your computer and use it in GitHub Desktop.
Save Shereef/37447d76ec18a3ae3d34 to your computer and use it in GitHub Desktop.
Challenge 2
#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