2015-02-09 88 views
-4

我用我的应用程序社交媒体链接和Twitter。如何获取链接和Twitter iOS中的用户个人资料图片?如何通过用户个人资料图片iOS获取Linkedin和Twitter集成?

NSString *profileImageURLString = [twitteruser valueForKey:@"profile_image_url"]; 
    NSURL *profileUrl = [NSURL URLWithString:profileImageURLString]; 
    self.twitterimage = [CIImage imageWithContentsOfURL:profileUrl]; 
+0

你已经试过了哪些代码?请参阅[我可以在这里询问哪些主题?](http://stackoverflow.com/help/on-topic),[我如何提出一个好问题?](http://stackoverflow.com/help/how -to-ask)和[如何创建最小,完整和可验证示例](http://stackoverflow.com/help/mcve)。 – Makyen 2015-02-09 20:34:30

+0

NSString * profileImageURLString = [twitteruser valueForKey:@“profile_image_url”]; NSURL * profileUrl = [NSURL URLWithString:profileImageURLString]; self.twitterimage = [CIImage imageWithContentsOfURL:profileUrl]; – 2015-02-09 20:43:14

+0

请* [编辑]问题*包括您的代码,而不仅仅是评论。 – Makyen 2015-02-09 20:45:10

回答

0

我在twitter用户头像中输出了这段代码。 NSString * profileImageURLString = [twitteruser valueForKey:@“profile_image_url”];};

NSURL *url = [NSURL URLWithString:[profileImageURLString stringByAddingPercentEscapesUsingEncoding: 
            NSUTF8StringEncoding]]; 

twitterimage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]];          
相关问题