2015-02-09 87 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]];          
相關問題