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

Ludwing Najera
Ludwing Najera
4,596 Points

i have no idea what this means

No visible @interface for 'shape' declares the selector 'alloc'

Please help me! i do not know what this means

10 Answers

Stone Preston
Stone Preston
42,016 Points

ok it looks like you need to capitalize Shape. Class names usually start with a capital letter and if you followed along in the video your class is most likely named Shape. so try

Shape *shape = [[Shape alloc] init];
Stone Preston
Stone Preston
42,016 Points

it means your shape class doesnt have a method called alloc in its interface. Is this for a treehouse challenge or video? if so please provide a link

Stone Preston
Stone Preston
42,016 Points

can you please post the code that you are using in your main method

Stone Preston
Stone Preston
42,016 Points

did you import your Shape.h in main.m? does your shape class inherit from NSObject?

Ludwing Najera
Ludwing Najera
4,596 Points

import <Cocoa/Cocoa.h>

import "shape.h"

int main() { shape *shape = [[shape alloc] init];

return 0;

}

here

Ludwing Najera
Ludwing Najera
4,596 Points

import <Cocoa/Cocoa.h>

import "shape.h"

int main() { shape *shape = [[shape alloc] init];

return 0;

}

Ludwing Najera
Ludwing Najera
4,596 Points

im sorry its acting funny

Ludwing Najera
Ludwing Najera
4,596 Points

import <Cocoa/Cocoa.h>

import "shape.h"

int main() { shape *shape = [[shape alloc] init];

return 0;
Ludwing Najera
Ludwing Najera
4,596 Points

well that failed and i think thats because the file shape.h is uncapitalized