Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 144

Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
03/17/13 04:32 PM (12 years ago)

calling all hackers

I'll admit, I've been pretty needy this week. I've spent hours hunched over my computer working on replacing Socialize features with Scringo and Social.framework features. If I can get this one last thing to work I might just end up ditching Socialize completely. I already have it set up where I can share images from the Mac Image Gallery by turning each image into it's own Socialize entity. I am trying to figure out a way to replace that method with a simple "Share" button that attaches the image to a Facebook or Twitter share sheet. It's easy enough to share the url of the current image, but ideally I would want to share the image itself...in other words, when the user taps the "Share" button, I would want the current image to show up underneath the little paperclip on the share sheet. I've unearthed the following code in Mac_photo.m - [BT_fileManager saveImageToFile:img fileName:self.imageName]; Am I correct in assuming that this is where the physical image is stored while the app is active? I have been trying to figure out how to recall this filename string to use in Mac_image_gallery.m but I'm just not getting it. Any help would be very appreciated.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/17/13 09:59 PM (12 years ago)
Yes. That line of code saves the raw image data contained in "img" to the filename stored in "self.imageName". Without looking at the code, I believe it will save it to the documents path as defined by BT_fileManager. It will also get deleted when the app is updated via the control panel unless the filename begins with "persist_".
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/18/13 06:37 PM (12 years ago)
ok thanks, I've tried the following code - [self.facebook addImage:[BT_fileManager getImageFromFile:img]]; it compiles fine, but still no image :/ guess I'll keep messing around
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/18/13 06:43 PM (12 years ago)
before you run that code, run a check to see if the file exists or not and use debugger to see what the result is.
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
03/18/13 07:01 PM (12 years ago)
Got it! Turns out it was easier than I thought - UIImage *sharePic = [self imageAtIndex:currentPageIndex]; [self.facebook addImage:sharePic]; thanks for helping out!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/18/13 07:02 PM (12 years ago)
no problem -glad you got it! :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.