Objective-C, properties for links

It may be a specific iPhone, I'm not sure. The compiler does not complain when creating for the simulator, but when compiling for the device, it causes some funky errors when I try to set properties for object references. For instance,

@property (nonatomic) CGRect  &finalFrame;

and built-in synthesizer

@synthesize finalFrame;

for a variable declared as

CGRect finalFrame;

Gives errors

  • Property type 'finalFrame' does not match ivar type 'finalFrame'
  • Unrecognizable insn:
  • Compiler internal error: bus error
  • Compiler internal error: in extract_insn, in recog.c: 2904

However, I can do it manually without problems using the following methods:

- (CGRect&)finalFrame;
- (void)setFinalFrame:(CGRect&)aFrame;

Is this a gcc error? It compiles for the simulator.

+3
source share
1

(CGRect&), (CGRect). @synthesize.

, ++ Objective-C, , , Objective-C ++.

+5

Source: https://habr.com/ru/post/1735449/


All Articles