Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to solve this error? "property with 'retain(or strong)' attribute must be of object type"
    primarykey
    data
    text
    <p>I have been working on an app all day which has been working fine until Xcode downloaded libraries or something and then it started having issues. I am just trying to create the getter/setter methods to get a couple of arrays out of my APPDelegate. Like I said it was working fine and then randomly it showed up with this error and now won't build anymore: </p> <pre><code>property with 'retain(or strong)' attribute must be of object type </code></pre> <p>Here is the rest of the code:</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import "Project.h" #import "TeamMember.h" @interface Task : NSObject{ NSDate *endDate; NSDate *startDate; NSMutableString* notes; NSMutableString* taskName; //The error appears first right here over teamMember TeamMember *teamMember; Project *project; } //The error appears over both of the following lines as well... @property (nonatomic, retain)TeamMember *teamMember; @property (nonatomic, retain) Project * project; @property (nonatomic, retain) NSMutableString *notes; @property (nonatomic, retain) NSMutableString *taskName; @property (nonatomic, retain) NSDate *startDate; @property (nonatomic, retain) NSDate *endDate; @end </code></pre> <p>Any ideas? This has got me stumped....</p> <p>Here is Project.h:</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import "Task.h" @interface Project : NSObject{ NSDate *dueDate; NSDate *startDate; NSArray *tasksInProject; NSMutableString* notes; NSMutableString* description; NSMutableString* projectName; } @property (nonatomic, retain) NSDate *startDate; @property (nonatomic, retain) NSDate *dueDate; @property (nonatomic, retain) NSArray *tasksInProject; @property (nonatomic, retain) NSMutableString *description; @property (nonatomic, retain) NSMutableString *projectName; @end </code></pre> <p>Here is TeamMember.h</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import "Task.h" #import "Project.h" @interface TeamMember : NSObject{ NSMutableArray *projects; NSMutableString *name; NSMutableString *title; NSMutableString *email; NSMutableString *phone; NSMutableString *notes; } //@property(nonatomic, retain) NSArray *projects; @property (nonatomic, retain) NSMutableString *name; @property (nonatomic, retain) NSMutableString *title; @property (nonatomic, retain) NSMutableString *email; @property (nonatomic, retain) NSMutableString *phone; @property (nonatomic, retain) NSMutableString *notes; @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload