我试图直接打开一个文件fopen("/test.txt","w+")
;它适用于模拟器,但不适用于 iPhone。
然后我试过这个:
NSString *path = [[NSBundle mainBundle] pathForResource: @"GirlName.txt" ofType:nil];
NSLog(path);
fichier = fopen([path cStringUsingEncoding:1],"w+");
if (fichier != NULL)
{
...
}
else
{
perror("error ");
}
我在控制台中收到权限被拒绝:
2009-07-24 17:17:27.415 Mademoiselle[897:20b]
/var/mobile/Applications/.../....app/GirlName.txt
error : Permission denied
你能告诉我有什么问题吗?