Question

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?

Was it helpful?

Solution

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);
}

OTHER TIPS

Try this,

-(BOOL)isInPot
{
   return (self.beingPlayed == 0 && self.position == 0);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top