Frank Frank - 1 year ago 40
Objective-C Question

Property 'levelCompleted' not found on object of type 'id'

Here's my model class


@interface LevelInformationModel : NSObject

@property NSInteger levelCompleted;


#import "LevelInformationModel.h"

@implementation LevelInformationModel

@synthesize levelCompleted;

/* Return singleton model */
+ (id)sharedModel {
static LevelInformationModel *sharedModel = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedModel = [[self alloc] init];
return sharedModel;

- (id)init {
self = [super init];
if (self) {
self.levelCompleted = 0;
return self;


And here's how I'm using it all (in
class). I have imported

NSInteger currentLevel = [LevelInformationModel sharedModel].levelCompleted;

But above the
property is the error
Property 'levelCompleted
not found on type 'id'`. Any thoughts would be great.

Answer Source

That's because your method is returning an id.

Change it to this

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download