NSInteger,NSNumber "property 'x' with 'retain' attribute must be of object type "
<p>i am working an application in which data is being populated from sqlite databae.all database related stuff is done in appdelegate class.I have use NSMutable array to hold objects.
I have used a seperate NSObject class for properties.</p>

<p>I am having trouble in error: "property 'x' with 'retain' attribute must be of object type"<br>
my appdelegate.m file's code is as:</p>

<pre><code>NSString *amovieName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
NSInteger amovieId = sqlite3_column_int(compiledStatement, 1);//problem is here the //value of movieId is coming from database.But error: "must be of object type" is puzzling me. I am assuming to use NSNumber here.  
</code></pre>

<p>my NSObject file's code is as:</p>

<p>in .h file-  </p>

<pre><code>NSInteger movieId;
</code></pre>

<p>its property as:   </p>

<pre><code>@property (nonatomic, retain) NSInteger movieId;
</code></pre>

<p>and in .m file-    </p>

<pre><code>@synthesize movieId; 
</code></pre>

<p>then I have just initialize as:</p>

<pre><code>-(id)initWithmovieName:(NSString *)mN movieId:(NSInteger)mId 
{    
    self.movieName=mN;  
    self.movieId=mId;  
    return self;  
}
</code></pre>

<p>I found another way as:
assigning value in a NSnumber object .then type caste in NSInteger.for ex;</p>

<pre><code>NSNumber aNSNumbermovieID = sqlite3_column_int(compiledStatement, 1); 
            NSInteger amovieId = [aNSNumbermovieID integerValue];
</code></pre>

<p>but still I am getting the same errors(property 'x' with 'retain' attribute must be of object type).</p>

<p>Any suggestion?
Thanks</p>
