I have a block of source code getting from Github. It looks like:
Header file
@interface VTDUpcomingDisplayData : NSObject
@property (nonatomic, readonly, copy,) NSArray* sections; // array of VTDUpcomingDisplaySection
+ (instancetype)upcomingDisplayDataWithSections:(NSArray *)sections;
@end
Implementation file
#import "VTDUpcomingDisplayData.h"
@interface VTDUpcomingDisplayData()
@property (nonatomic, copy) NSArray* sections;
@end
@implementation VTDUpcomingDisplayData
+ (instancetype)upcomingDisplayDataWithSections:(NSArray *)sections
{
VTDUpcomingDisplayData* data = [[VTDUpcomingDisplayData alloc] init];
data.sections = sections;
return data;
}
This block code has two variable name called 'sections' but builds successfully. I have two questions:
- First of all, I do not understand why this is allowed to happen?
- Second, how to call exact the variable I want in source code?