Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS iOS Design Patterns Two-Stage Object Creation Test: Two-stage Object Creation

Nick Frozz
Nick Frozz
31,289 Points

Hello, I can't pass 1/2 part of this code challenge. Could someone help me to find a solution?

1/2: We need a ColoredCircle factory method named "asteroid" which has color "grey" and a diameter of 1.5. Start by writing the declaration for this class method.

@interface ColoredCircle : NSObject

+(ColoredCircle*) asteroid;
#import "asteroid.h"

@implementation ColoredCircle

+(ColoredCircle*) asteroid {
    ColoredCircle *a = [[ColoredCircle alloc] initWithDiameter:1.5 andColor:@"grey"];
    return a;