Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load Pods-acknowledgements.markdown as NSString

I'm building an application and want to load the cocoapods auto-generated acknowledgements markdown file into an NSString to be displayed in my application. I though it would be as simple, as doing this:

NSString *path = [[NSBundle mainBundle] pathForResource:@"Pods-acknowledgements" ofType:@"markdown"];
NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];

But this doesn't work.... Is there a way to access this file?

like image 540
lramirez135 Avatar asked Dec 17 '25 11:12

lramirez135


1 Answers

It doesn't look like this file is automatically copied into your project bundle.

You need to add this file to your Copy bundle Resource build phase. It's also worth nothing that the file name actually contains your project's name Pods-<PROJECT_NAME>-acknowledgements

In practice you may want to make a symbolic link in your project that points to the generated file in the Pods directory to ensure that the newly generated file is used each time

enter image description here

like image 129
Paul.s Avatar answered Dec 19 '25 07:12

Paul.s



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!