You should not use * with BOOL.
Tile.h
@property (nonatomic, assign) BOOL isInPot;
Tile.m:
@implementation Tile
@dynamic beingPlayed;
@dynamic position;
-(BOOL)isInPot
{
return (self.beingPlayed == 0 && self.position == 0);
}
Domanda
First apologies for the n00b question...
I have a Core Data object "Tile" with a corresponding generated NSManagedObject class. It has 2 parameters which come from the database - beingPlayed - position
Now, I want to create an instance boolean parameter isOnBoard which is based on the value of these 2 CoreData values.
Tile.h
@property (nonatomic, assign) BOOL *isInPot;
Tile.m:
@implementation Tile
@dynamic beingPlayed;
@dynamic position;
-(BOOL *)isInPot
{
if (beingPlayed == 0 and position == 0) return TRUE;
else return FALSE;
}
But when I want to use the dynamic parameters I can not access them.
What am I doing wrong?
Soluzione
You should not use * with BOOL.
Tile.h
@property (nonatomic, assign) BOOL isInPot;
Tile.m:
@implementation Tile
@dynamic beingPlayed;
@dynamic position;
-(BOOL)isInPot
{
return (self.beingPlayed == 0 && self.position == 0);
}
Altri suggerimenti
Try this,
-(BOOL)isInPot
{
return (self.beingPlayed == 0 && self.position == 0);
}