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 trialJesse Price
Courses Plus Student 14,333 PointsCode Challenge: Introducing the Project
I'm stuck on the second part of this code challenge.
I've entered:
self.items = [NSMutableArray arrayWithObjects:@"String1",@"String2",nil];
2 Answers
Stone Preston
42,016 Pointstried your code and it worked fine. make sure you put it in view did load inside the .m file
#import "InboxViewController.h"
@implementation InboxViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Add custom code below!
self.items = [NSMutableArray arrayWithObjects:@"String1",@"String2",nil];
}
@end
also make sure you declared the property correctly in the header fileand set its attributes as nonatomic and strong
#import "UITableViewController.h"
@interface InboxViewController : UITableViewController
@property (nonatomic, strong) NSMutableArray *items;
@end
Jesse Price
Courses Plus Student 14,333 PointsWasn't in .m, doh!