开发者

Using a file which is located within the iPhone sandbox

开发者 https://www.devze.com 2023-02-10 01:08 出处:网络
I\'m creating an iPhone app that needs the location of .wav which is located in the sandbox. I do this wit开发者_如何学Ch the following:

I'm creating an iPhone app that needs the location of .wav which is located in the sandbox. I do this wit开发者_如何学Ch the following:

 recordFilePath = (CFStringRef)[NSTemporaryDirectory() stringByAppendingPathComponent: @"recordedFile.wav"];

How can I convert recordFilePath to a string that can then be passed into a C function?


EDIT 1

By the way, this is the statement that is going to receive the c string:

freopen ("locationOfFile/recordedFile.wav","r",stdin);


That will depend on what type your c function expects to get - you can write a c function that accepts NSString* object as parameter. If you want to convert your NSString to char* then you can use one of the following functions:

– cStringUsingEncoding:
– getCString:maxLength:encoding:
– UTF8String
0

精彩评论

暂无评论...
验证码 换一张
取 消