iPhone 应用程序的 Twitter 背景主题
我能够在我的应用程序中获取 Twitter 的用户名及其个人资料图片。这是我的代码
- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username {
NSLog(@"Authenticated with user %@", username);
imageview.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:
[NSString stringWithFormat:@"http://api.twitter.com/1/users/profile_image/%@.json",username]]]];
NSLog(@"http://api.twitter.com/1/users/profile_image/username.json");
recentTweets = [[NSMutableArray alloc] init];
[self updateStream:nil];
}
现在我想登录用户的个人资料图片...有人知道这一点吗?
I am able to get user name and its profile image of twitter in my app.Here is my code
- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username {
NSLog(@"Authenticated with user %@", username);
imageview.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:
[NSString stringWithFormat:@"http://api.twitter.com/1/users/profile_image/%@.json",username]]]];
NSLog(@"http://api.twitter.com/1/users/profile_image/username.json");
recentTweets = [[NSMutableArray alloc] init];
[self updateStream:nil];
}
Now I want to get logged in user's profile image...any one knows about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信您已经得到了这个,但如果没有,我也许可以提供帮助。
取决于您希望图像如何显示,但我假设您正在使用 IBOutlet 到 UIImage 制作视图,以将用户个人资料图像放置在该特定页面上。为此,您已经拥有大部分代码
,然后在您希望它出现的视图中创建 IBOutlet 并将其连接起来,您应该一切都好。只需将其放在 ViewDidLoad 方法中,这样当您的页面加载时,您的图像就不会出现......现在告诉我您如何将该个人资料图像放置在表格单元格中并且均匀! HA 我正在让它们下载,但由于某种原因它们不会加载到表视图中
I am sure you have gotten this already but if not I can maybe help.
depending on how you want the image to show but I assume you are making a view with a IBOutlet to a UIImage to place a users profile image on that specific page. To do so you already have most of the code
then make the IBOutlet within the View you want it to appear on and connect it up and you should be all good. Just place that in a ViewDidLoad Method so when your page loads so wont your image..... Now Tell me how you placed that profile image in a table cell and were even! HA I am getting them to download but for some reason they wont load in the table view