Chris Muench
Chris Muench

Reputation: 18318

Defining properties in header file vs implementation file objective c

In the page based application template, I am seeing this a lot in the implementation (.m) files.

@interface ModelController()
@property (readonly, strong, nonatomic) NSArray *pageData;
@end

Why isn't this done in the header (.h) file?

Upvotes: 8

Views: 2349

Answers (1)

Sean
Sean

Reputation: 5820

This property is in the implementation file because it does not need to be declared publicly and only used within the .m file.

Upvotes: 13

Related Questions