Assigning to struct in different class
- by 4thSpace
I have a struct in ClassA and want to assign it to the same struct in ClassB (the two structs are the same with different names). ClassA and ClassB are view controllers. Basically, I need to pass this struct to another class. However, structs don't seem to be exposed as members, which means I can't access them. Here is ClassA's struct declared in its header file:
typedef struct {
NSString *startDate;
NSString *endDate;
NSString *classId;
} selectedItemsClassAStruct;
selectedItemsClassAStruct selectedItemsClassA;
and the same for ClassB (just with ClassA text replaced)
It doesn't appear in code hints for ClassB. I see this error if I try to access it:
request for member 'selectedItemsClassBStruct' in something not a structure or union
How should it be done?