I'm pretty new to iOS development and I need the ability to dump some open GL framebuffers to png files for rendering engine debug purposes. I've found some great boilerplate code out there for doing this by reading the buffer into a UIImage object and write it as a png file.
In most cases of others asking about something like this, they've wanted to dump an image view and programmatically pick it up later, so the directory they're writing the files to is one of the app's private directories.
I'd like to do this simply for debugging purposes, so I'd like to be able to see the frame buffer images in the built in Photos app. Is there a way to write these photos so that they show up in the Photos app? I'm assuming there must be apps out there that write photos into this storage (e.g. picture editing software). Below is what I've seen recommended other places on SO, but I believe these write to the public Pictures directory. Perhaps I'm missing a permission, like I said, still new.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSPicturesDirectory, NSUserDomainMask, YES);
NSString *picsDirectory = [paths objectAtIndex:0];
NSString *dataPath = [picsDirectory stringByAppendingPathComponent:name];