我開發一個iPhone 4應用程序,我有與類問題:類型的特性「shapeMatched」不匹配訪問類型「setShapeMatched:」
@interface Pattern : NSObject {
int maxNumShapes;
NSMutableArray* shapes;
NSMutableArray* shapeMatched;
CGSize bounds;
}
@property (nonatomic, retain, readonly) NSMutableArray* shapes;
@property (nonatomic, retain, readonly) NSMutableArray* shapeMatched;
...
- (void) setShapeMatched:(ShapeType)type;
@end
及其實施:
- (void) setShapeMatched:(ShapeType)type {
int index = 0;
if (shapes != nil)
{
for(Object2D* obj in shapes)
{
if (obj.figure == type)
{
[shapeMatched replaceObjectAtIndex:index
withObject:[NSNumber numberWithBool:YES]];
obj.withFillColor = YES;
break;
}
else
index++;
}
}
}
我得到以下警告:
Type of property 'shapeMatched' does not match type of accessor 'setShapeMatched:'
我怎樣才能解決這個警告呢?
當他/她首先回答這個問題時,你應該把支票寄給'sidyll'。 – MusiGenesis