0

I have a ClassA defined as followed

@interface ClassA : NSObject
@property (assign) size_t Variable;
@end

In ClassB I tried to get the address of ClassA's Variable

ClassA *m_ClassA;
void* ptr = &[m_ClassA Variable];

But got the following error message Cannot take the address of an rvalue of type 'size_t'

I know the following code will work but wonder why the error above comes out

size_t so = [m_ClassA Variable];
void* ptr = &so;

Thank you for precious time on my question.

willSapgreen
  • 1,365
  • 2
  • 17
  • 27

0 Answers0