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 trialHoriuchi Yuto
2,372 PointsRefactoring into a Model 2/3
My code is not working. Is this structure problem? Here is my code.
#import "Quote.h"
@implementation Quote
- (NSArray *) quotes {
if (_quotes == nil) {
_quotes = [[NSArray alloc] initWithObjects:@"goo", @"choki", @"par", nil];
}
return _quotes;
}
- (NSString *) randomQuote {
return @"Some Quote";
}
@end
7 Answers
Holger Liesegang
50,595 PointsHi Horiuchi,
your same question already has been answered here
Horiuchi Yuto
2,372 PointsThank you for asking my question. Although I followed your answer and entered correct code, still I could not proceed next stage. I will treat another lesson. I can not understand this part.
Holger Liesegang
50,595 PointsHi Horiuchi,
I just tested my answers for Challenge task 1 of 3 and Challenge task 2 of 3 again and they completed with no problem.
However did you perhaps edit the header part instead of the implementation part or vice versa by mistake? Are there any specific problems or questions regarding this part of "Build a Simple iPhone App (iOS7)"? Just shoot your questions :)
Horiuchi Yuto
2,372 PointsIt is difficult for me to know about whether indent is existing or not. Regarding programming, it is important to use indent when I make a code, because it may cause error by structure problem. But, on the Forum, I mistakenly understand that they use 1 indent, 2 indent and more. So I hope that we can understand existence of indent more easily.
Holger Liesegang
50,595 PointsDo you mean indent with a meaning of indentation, so you're having problems formatting your code? The amount of spaces shouldn't be a big problem as long as you don't use any special (in your editor invisible) chars.
Horiuchi Yuto
2,372 PointsYes, indentation is called indent for me. It is clear regarding indentation. I don't have any question. Thank you very much.
Holger Liesegang
50,595 PointsI'm sorry I couldn't be of more help for you, Horiuchi Yuto
Kind Regards Holger