ARC error: init methods must return a type related to the receiver type

Question:

set 

@property (nonatomic, retain) NSArray* initRecipients;

Answer:

The init method that was posted in the question was in the wrong form. The init method should (usually) have the form:

-(id)initWithParams:(BOOL)aBoolParam {
    if (self = [super init]) {
        //do stuff
    }
    return self;
}

The problem with code above was that it was done as a class method, so if the poster wanted to do this he had to do moment = [[Moment alloc] init] and return it.

 

 

Or change the property name.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s