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 Objective-C Basics (Retired) Introduction to Objective-C Composition

Xcode complains about unused variable

Button *roundButton = [[Button alloc] init];

when i type this in it wont let me create this button object instead it says unusable variable "roundButton"

ios development in the composition video

2 Answers

Mike Baxter
Mike Baxter
4,442 Points

I think it probably says "unused" variable. Whenever you make something and don't use it, Xcode lets you know so that you can keep your code clean. Keep going, I think it will work.

As soon as you type a few more lines of code and use it, the warning should go away.

thanks you were right

Mike Baxter
Mike Baxter
4,442 Points

Glad I could help! Happy coding!