While this may be a total n00b question, I haven't encountered a situation like this before and was a bit stunned.
I have a few Objective C classes and each has a few properties declared. All properties are properly declared and synthesized.
Simplified, the structure looks something like:
CompanyData - hasA - DepartmentInfo - hasA - Office - hasA - Employee - hasA - isFemale(BOOL)
If I write something like this:
companyData.departmentInfo.office.currentEmployee.isFemale = YES;
my code won't compile and I get "Segmentation fault: 11"
error.
However, if I write:
Employee *currentEmployee = companyData.departmentInfo.office.currentEmployee;
currentEmployee.isFemale = YES;
everything compiles fine. Why? What am I missing here?
I am using XCode 4.5 and LLVM GCC 4.2 compiler.