1

[NSDate distanceFuture] について問題があり、次のように使用します。

while (_connection != nil)
    {
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSData distantFuture]];
    }

「Class method '+distantFuture' not found (return type defaults to 'id')」という警告が表示されます。コードを実行すると、Error:-[NSConcreteData timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x80d18e0

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteData timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x80d18e0' * First throw call stack: (0x1e63022 0x1606cd6 0x1e64cbd 0x1dc9ed0 0x1dc9cb2 0x10af3e1 0x72181 0x11300ad 0x18a9330 0x18aa439 0x95707b24 0x957096fe) terminate called throwing例外。[NSDate dateWithTimeIntervalSinceNow:2] を使用していますが、エラーは同じです。誰かが私を助けることができますか?ありがとう。

4

1 に答える 1

5

NSData は NSDate ではありません。試してください: 代わりに [NSDate distanceFuture] を使用してください。

于 2012-11-09T17:23:49.843 に答える