This one has been driving me mad! I have a struct:
typedef struct{
int a;
}myStruct;
Then I have:
myStruct tempStruct;
I am trying to pass the struct to a class method whose implementation is:
- (void) myFunc:(struct myStruct)oneOfMyStructs{};
I call the method like so:
[myClass myFunc:(struct myStruct)tempStruct];
The compiler complains about "Conversion to non-scalar type requested." All I want to do is pass a struct into a class method, but the syntax has me a bit confused. I'm new to Objective-C. Please let me know if you can see where I'm going wrong. I've not been able to pass by reference either, so if you could help me out with that, that would be great!
Thanks!