iOS 开发人员:将 UIImage 上传到 facebook 相册时出现问题
请检查我的代码:
在这里,我尝试将屏幕截图上传到 Facebook 相册,但这不起作用
CGImageRef screen = UIGetScreenImage();
self.image = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.image, @"picture",
nil];
[self.facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
self.image 没问题,它用于代码的其他部分,一切看起来都不错。如果我为 [uiimage imagenamed@"example.png""] 设置 self.image ,一切都会很好。不同的是,一个 uiimage 存在于内存中,而另一个 uiimage 存在于内存和设备中。
有什么问题吗?
谢谢
please check my code:
Here i'm trying to upload screenshot to facebook album, but that doesnt works
CGImageRef screen = UIGetScreenImage();
self.image = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.image, @"picture",
nil];
[self.facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
self.image is ok, it is used in other parts of the code and everything looks nice. if i set up self.image for ex for [uiimage imagenamed@"example.png""] everything works nice. the different is that one uiimage exists on in memory and another both in memory and device.
what can bee wrong?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。问题是制作屏幕截图的方式错误。
solved. the problem was the wrong way of making a screenshot.