Quote:
Originally Posted by nick.keroulis
The error:
Code:
Existing ivar 'delegate' for unsafe_unretained property 'delegate' must be_unsafe_unretained
The code:
Code:
@interface HRColorPickerViewController : UIViewController
{
id<HRColorPickerViewControllerDelegate> delegate;
HRColorPickerView* colorPickerView;
UIColor *_color;
BOOL _fullColor;
HCPCSaveStyle _saveStyle;
}
@property (assign, nonatomic) id<HRColorPickerViewControllerDelegate> delegate;
...
@end
Code:
@implementation HRColorPickerViewController
@synthesize delegate;
...
@end
It seems i can't find any errors.
|
You are tripping the peculiarities of ARC.
Properties that are declared as assign are not tracked by ARC. For properties, you use the settings strong, weak, and assign. These equate to __strong, __weak, and __unsafe_unretained for instance variables.
Here is a table of the way you declare properties, and the way you need to declare their instance variables to match
Property declaration............
iVar declaration
strong...............................__strong
weak................................__weak
assign ..............................__unsafe_unretained
so, change the declaration of your delegate iVar to look like this:
Code:
__unsafe_unretained id<HRColorPickerViewControllerDelegate> delegate;