Assigning to struct in different class
Posted
by 4thSpace
on Stack Overflow
See other posts from Stack Overflow
or by 4thSpace
Published on 2010-04-18T16:37:33Z
Indexed on
2010/04/18
16:43 UTC
Read the original article
Hit count: 367
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?
© Stack Overflow or respective owner