私のオブジェクトは次のように宣言されました:
私の.h
@interface My:NSObject{
NSTimeInterval time;
}
@property (assign) NSTimeInterval time;
@end
私の.m
@implementation My
@synthesize time;
@end
コードのどこかに:
-(NSTimeInterval)getTimeInterval:(NSString*)timeStr
{
NSTimeInterval interval;
//some code
return interval;
}
-(void) func:(NSString*)timeInterval
{
My *my = [[My alloc] init];
my.time = [self getTimeInterval:timeInterval];
}
ラインで
my.time = [self getTimeInterval:timeInterval];
エラーが表示されます:「'setTime' の引数 1 の型に互換性がありません」
誰が問題がどこにあるのか教えてもらえますか?