gpt4 book ai didi

iphone - 如何使用方法 stringWithContentsOfFile :encoding:error

转载 作者:行者123 更新时间:2023-12-03 19:19:29 24 4
gpt4 key购买 nike

我不知道如何使用这个方法。

我想以 NSString 的形式获取 rtf 文件中的数据,但我不能。

这是我的代码的一部分。

NSString *filePath = @"path of the file";

NSString *ImagePath = [[[NSString alloc] init] autorelease];

imagePath = [NSString stringWithContentsOfFile: filePath encoding:(NSStringEncoding)nil error:(NSError**) nil];

我无法读出该 .rtf 文件中的数据。我很感激每个人都可以帮助我。谢谢。

最佳答案

尝试使用这个imagePath = [NSString stringWithContentsOfFile: filePath 编码:NSUTF8StringEncoding 错误:nil];

关于iphone - 如何使用方法 stringWithContentsOfFile :encoding:error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5374328/

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