Forums › Programming › cocos2d support (graphics engine) › how to get device sd card path
This topic contains 7 replies, has 3 voices, and was last updated by varedis 11 months, 4 weeks ago.
in my project i am downloading data from server after that i need to save downloaded data to iphone device memory.
here my problem is how to get device memory path to save the downloaded data.
can any one help me to get iphone device memory path.
If you download on memory it means it’s stored on a variable, so no path. All download code I have ever implemented on iOS is on memory first then I save wherever I like. Perhaps you want to share that code cos your question is confusing.
my code is :
char szBuf=”hello cocos2d”;
const char * path=”device sd card path/textFile.txt”;
File * fp=fopen(“”,”wb”);
from the above code i am trying to create textFile.txt in device sd card.
here my problem is to get sd card path;
how to get path of sd card
Uh, sd card? You are posting on the wrong forums, you realise this is cocos2d in objective-c for iOS?
i know that was c++ code,i just tried with c++ code in cocos2d.
that code is working well in cocos2d
by using that code i created textFile.txt file also in simulator path (/users/…/iphone simulator/..caches/textFile.txt).
What iOS are you using that has an SD card slot? I think you have picked up some knockoff lPhone
sorry for wrong framing the question
i am trying to implement things which i implemented in android
in android i downloaded images from the server and saved that to device memory
card and creating folders in memory card.
like that i am trying in iphone also
here i am trying to create folder in device memory(not in project folder) and adding some text file/images
to that folder.
can i create files in device memory through pragmatically?
Each app runs in its own sandbox. You do not need to create separate folders in device memory to store things. Look in to NSDocuments
You must be logged in to reply to this topic.
Social Widgets powered by AB-WebLog.com.