user2102538
user2102538

Reputation: 39

Semantic Issue with ARC

My code in my .h file is

@property (weak, nonatomic) IBOutlet UITextField *textFieldTask;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *buttonDone;

and the error shows up

@synthesize of 'weak' property is only allowed in ARC or GC mode

when I replace the weak with strong, the button doesn't work

I can't put it in ARC mode( it will destroy my project)

Anything I can Do?

Upvotes: 1

Views: 1059

Answers (1)

nsgulliver
nsgulliver

Reputation: 12671

you need to use retain or assign if you don't want to use ARC

retain

@property (retain, nonatomic) IBOutlet UITextField *textFieldTask;
@property (retain, nonatomic) IBOutlet UIBarButtonItem *buttonDone;

assign

@property (assign, nonatomic) IBOutlet UITextField *textFieldTask;
@property (assign, nonatomic) IBOutlet UIBarButtonItem *buttonDone;

Upvotes: 5

Related Questions