William Falcon
William Falcon

Reputation: 9813

property not found on object Type (custom) xcode

the strangest thing happened. Although I don't think I touched anything in that class, suddenly it started telling me it couldn't find an array in a class...

Here are the errors:

basically it cannot access the mutable array in baseobject (custom Car.h type) (semantic issue: property objectReadyForCoreDatabase not found in object of type CarPacket (false, because it is declared))

if([baseObject.objectsReadyForCoreDataBaseInput count]<kLenght )
            {
}

car packet .h

 #import <Foundation/Foundation.h>
    #import "ResponsePacket.h"

    @interface CarPacket : ResponsePacket

    @property (nonatomic, copy) NSString *objectID;
    @property (nonatomic, retain) NSMutableArray *objectsReadyForCoreDataBaseInput;
    @property (nonatomic, assign) NSInteger timeStamp;



@end

It is weird because on the same page where I get the error if I type object.objectID it recognizes that but not object.objectReadyForCoreDataBaseInput (also it just suddenly stopped working)

Please let me know if you have any ideas... Thank you

I tried restoring to previous snapshots and it had no effect... it still showed the error (even though I know on that date it didn't)

Upvotes: 0

Views: 2457

Answers (1)

isaac
isaac

Reputation: 4897

You haven't shared much about the context of where you're making the call (and seeing the error). That said, my guess would be one of two things: The calling class isn't familiar with the receiving class (CarPacket), or, the calling class doesn't know that baseObject is a CarPacket.

Where are you calling from? Make sure the calling class imports the headers. Since I don't know where you're calling from, let's say it's from within UnknownClass:

UnknownClass.m

#import UnknownClass.h
#import CarPacket.h // This should make your class familiar

@implementation UnknownClass

The other thing is that you need to make sure that at the time you're touching the baseObject, your UnknownClass instance knows that it is dealing with a CarPacket instance, e.g.:

- (void)someMethodOfUnknownClass
{

CarPacket *baseObject = (CarPacket *)baseObject; // Cast baseObject if it hasn't been declared as a CarPack in scope...

if([baseObject.objectsReadyForCoreDataBaseInput count]<kLenght )
    {
    }

}

Upvotes: 2

Related Questions