I am new to Objective-C and trying to make my way through a book. I was following along a pretty basic tutorial, when I came upon an error. The code is afaik the same as in the book.
I have a class with MyController.h
and MyController.m
. The error happens as during the declaration.
MyController.h
:
#import <Foundation/Foundation.h>
@interface MyController : NSObject
@property (assign) IBOutlet id *textLabel;
- (IBAction)clickMeButtonClicked:(id)sender;
- (IBAction)deleteMeButtonClicked:(id)sender;
@end
The third line gives me a warning and an error:
The error:
Pointer to non-const type 'id' with no explicit ownership
The warning:
Property with 'iboutlet' attribute must be an object type (invalid '__strong id *')
As I said I am just beginning to learn and I am surely missing something very obvious here. It seems to have something to do with the 'id' type, but according to the book, there is nothing wrong.
Thank you for your help!