为什么我在尝试在 NSString 语句中使用 NSScanner 时收到错误消息?
我想知道为什么
Thread 1: Program received signal: "SIGABRT")
当我使用这行代码时收到错误消息:
NSScanner *userEntered = [[NSScanner alloc] scannerWithString:temp];
错误是:
2011-04-18 02:06:11.995 XXX[25929:207] -[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0
2011-04-18 02:06:11.999 XXX[25929:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0'
谢谢。
I would like to know why I get an error message
Thread 1: Program received signal: "SIGABRT")
When I use this line of code:
NSScanner *userEntered = [[NSScanner alloc] scannerWithString:temp];
The error is:
2011-04-18 02:06:11.995 XXX[25929:207] -[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0
2011-04-18 02:06:11.999 XXX[25929:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0'
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
+scannerWithString 是一个类方法,应按以下方式使用:
+scannerWithString is a class method and should be used the following way: