gpt4 book ai didi

objective-c - Xcode - 有些东西可能没有回应

转载 作者:行者123 更新时间:2023-11-29 11:23:51 24 4
gpt4 key购买 nike

我收到一些警告,提示某些功能可能无法响应。

#import "Lane.h"
#import "TrafficController.h"


@implementation Lane
@synthesize controller;


-(void)awakeFromNib
{
[controller registerLane:self]; -- 'TrafficController' may not respond to '-registerlane'
srandom(time(NULL));
[self start];
}

-(void)start
{
long newStartTime = random() % 200;
carStartTimer = [NSTimer scheduledTimerWithTimeInterval:newStartTime / 1000.0 target:self selector:@selector(startTimerFired:) userInfo:nil repeats:YES];
[carStartTimer retain];
}

-(void)startTimerFired: (NSTimer*)timer
{
//pick a random number of milliseconds to fire again at

long newStartTime = random() % 1500 + 500;

[timer setFireDate:[NSDate datewWithTimeIntervalSinceNow:newStartTime / 1000.0]];
[controller startCarFromLane:self]; - 'TrafficController' may not respond to '-startCarFromLane'

NSLog(@"Starting new car");
}

-(void)stop
{
[carStartTimer invalidate];
[carStartTimer release];
carStartTimer = nil;
}

@end

这是否意味着那些函数没有在这个或其他头文件中声明?还是有别的意思?

最佳答案

在您的 TrafficController.h 中,是否有这样一行:

-(void) registerLane: (type) variablename;

如果你没有,你应该有

关于objective-c - Xcode - 有些东西可能没有回应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4992044/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com