gpt4 book ai didi

ios - 关于 NSKeyedArchiver archiveRootObject :toFile:

转载 作者:行者123 更新时间:2023-12-01 20:10:05 26 4
gpt4 key购买 nike

我有一个非常简单的问题,我只是找不到合适的答案。那是

[NSKeyedArchiver archiveRootObject:value toFile:filePath];

根据苹果文档 here ,上面的函数:

Archives an object graph rooted at a given object by encoding it into a data object then atomically writes the resulting data object to a file at a given path, and returns a Boolean value that indicates whether the operation was successful.



我的问题是,如果我使用相同的文件路径多次调用此函数,它会覆盖此文件中的先前值吗?我可以使用此函数将空数组写入文件吗?

最佳答案

是的,它将覆盖以前的值,是的,您可以使用该函数将一个空数组写入文件。

该方法的实现并不关心那里有什么,它会覆盖它。

关于ios - 关于 NSKeyedArchiver archiveRootObject :toFile:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37898765/

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