用 xcode 写 IOS 代码,用 fopen 写文件,可以写到手机的document 文件夹,然后可以通过xcode菜单获取document目录到Mac端;

1:获取 document 路径,转换为 char *;

 

      {

//获取 document 路径;
            NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
            
//转换为 char *;            
            //const char * foo= "Blah blah";
            NSString * bar = path;
            //bar = [NSString stringWithUTF8String:foo];//char*转NSString
            char * pstrDocument = [bar UTF8String];
                   
            
            maintets(pstrDocument);
        }
 

 

2:Mac 获取 IOS相关软件的document

Windows -》  Devices and Simulators ->  选择连接的手机设备 和 指定的软件 -》按 设置按钮 - 》Download Container...  -> 选择 Mac 上的接收文件夹;

IOS 写文件到 手机document 然后获取文件夹

IOS 写文件到 手机document 然后获取文件夹

 

 

 

相关文章:

  • 2021-10-20
  • 2021-08-06
  • 2022-12-23
  • 2022-01-17
  • 2021-07-12
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-07-19
  • 2021-11-04
  • 2022-12-23
相关资源
相似解决方案