On Mar 28, 8:59 am, yohann <
fil...@mac.com> wrote:
> Person* person = [Person findByPk:1];
>
> I get the following error :'warning assignment from disctinct
> objective-c type'
>
> I've checked the returned object cast of [Person findByPk:1] and
> without typecasting it with (person*), it returns correctly a Person
> object.
>
Yohann,
You could either do the cast or subclass the class method:
+ (Person *) findByPk: (int) inPk {
return (Person *)[super inPk];
} // findByPk
I, myself, prefer using the subclass. A regular use of casting is
showing a failure in your type system.
Anon,
Andrew