c++ - Is it possible to get file path from cpp file in IOS project -
hi developing ios app , have cpp file in need read binary file. sending path .mm file cpp file via function call not option unfortunately. way see cpp file somehow should call function in .mm file return exact path binary file. how may that?
sounds calling objectivec method (returning file path application bundle) c / c++ want achieve. question has answer how call objective-c method c method?
to obtain actual path of binary file add xcode project , make sure add "build phases" > "copy bundle resources" phase inside xcode project setting.
call
[[nsbundle mainbundle] resourcepath]
to path directory should contain binary file.
don't forget helper methods
[nsstring stringbydeletinglastpathcomponent];
when working file paths.
Comments
Post a Comment