在视图之间传递浮动
我一直在使用 NSUserDefaults 在我的应用程序中传递浮动。但他们开始不再为我工作了。我刚刚得到南。还有另一种方法可以做同样的事情吗?我一直在尝试一些单例类,但所做的只是使我的应用程序崩溃。
I have been using NSUserDefaults for passing floats all around my apps. But they are starting to not work for me anymore. I just get NAN. Is there another way to do the same thing? I have been toying around with some singleton classes but all that does is crash my app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。我只是取负数的平方根。 NSUserDefaults FTW!
我也让我的单身人士工作得很好。实际上我最终没有使用它,因为我找到了如何从 NSUserDefaults 中存储和提取 NSMutableArray 和 NSMutableDictionary 等对象。
I figured it out. I was just taking the square root of a negative number. NSUserDefaults FTW!
I also got my singleton to work great. I actually ended up not using it because I found how to store and pull objects like NSMutableArray and NSMutableDictionary out of NSUserDefaults.