可可 arc4random OS X 10.6
我为 Lion 创建了一个简单的自定义视图应用程序。现在有朋友用Snow Leopard测试了一下,无法启动。可悲的是我没有例外。我唯一知道的是,这是关于 arc4random 的函数调用,这在她的版本中不可用。 我实际上无法想象,Lion 中引入了如此重要的功能(是的,我对可可相当陌生......),所以你们知道这可能是什么吗? 我会尝试获取异常详细信息,但我几乎处于时间压力之下......
I have created a simple Custom View Application for Lion. Now a friend tested it using Snow Leopard and couldn't launch it. Sadly I don't have the Exception. The only thing I know is, that it's about the function-call of arc4random, which is not available in her version.
I actually can't imagine, that such an essential function was introduced in Lion (yeah, im rather new to cocoa...), so do you guys have any idea, what that could be about?
I'll try to get the Exception Details, but I am pretty much under time pressure...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的应用程序在 Snow Leopard 上崩溃时遇到了类似的问题,崩溃报告显示:
我必须阅读 文档 多次,直到我意识到
arc4random()
本身从 10.4 开始就可用,但是arc4random_buf()
仅自 10.7 起可用。如果您使用arc4random_buf()
函数(像我一样),它将无法在 10.6 上运行。因此,我只是用以下 C 代码替换了 arc4random_buf() 函数:
这可能会慢一点,因为 arc4random() 被调用了几次,但它可以工作从 10.4 到 10.8 的所有 Mac 操作系统。
I just had a similar problem with my app crashing on Snow Leopard with the crash report saying:
I had to read the documentation several times until I realized that
arc4random()
itself is available since 10.4 butarc4random_buf()
is only available since 10.7. If you use thearc4random_buf()
function (like me) it will not run on 10.6.So, I just replaced the
arc4random_buf()
function with the following C-code:That is probably a bit slower because
arc4random()
is called several times, but it works on every Mac OS from 10.4 to 10.8.