成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

iOS應用程序 Twitter開發代碼

移動開發 iOS
本文介紹的是iOS應用程序 Twitter開發代碼,主要介紹了Twitter其中的代碼與大家分享,不如先來看內容。

iOS應用程序 Twitter開發代碼是本文要介紹的內容,先來了解一下Twitter,它是國外的一個社交網絡及微博客服務的網站。它利用無線網絡,有線網絡,通信技術,進行即時通訊,是微博客的典型應用。

Twitter允許用戶將自己的***動態和想法以短信形式發送給手機和個性化網站群,而不僅僅是發送給個人。2006年,博客技術先驅blogger.com創始人埃文·威廉姆斯(Evan Williams)創建的新興公司Obvious推出了大圍脖服務。在最初階段,這項服務只是用于向好友的手機發送文本信息。2006年底,Obvious對服務進行了升級,用戶無需輸入自己的手機號碼,而可以通過即時信息服務和個性化Twitter網站接收和發送信息。

Twitter 現在歐美地區極其火爆,如果各位開發者想在應用中增加 Twitter 功能,可以看一下許靖昕先生在博客中分享的代碼。

代碼地址:http://blog.csdn.net/cloudhsu/article/details/6048626

 

  1. - (void) postToTwitter  
  2. {  
  3.   // Since this will be launched in a separate thread, we need  
  4.   // an autorelease pool  
  5.   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
  6.    
  7.   NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:  
  8.     [NSURL URLWithString:@"http://TWITTER_ACCOUNT:PASSWORD@twitter.com/statuses/update.xml"]   
  9.     cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];  
  10.    
  11.   // The text to post  
  12.   NSString *msg = @"testing";  
  13.    
  14.   // Set the HTTP request method  
  15.   [request setHTTPMethod:@"POST"];  
  16.    
  17.   [request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg]   
  18.     dataUsingEncoding:NSASCIIStringEncoding]];  
  19.    
  20.   NSURLResponse *response;  
  21.   NSError *error;  
  22.    
  23.   if ([NSURLConnection sendSynchronousRequest:request   
  24.       returningResponse:&response error:&error] != nil)  
  25.     NSLog(@"Posted to Twitter successfully.");  
  26.   else   
  27.     NSLog(@"Error posting to Twitter.");   
  28.    
  29.   // Release pool  
  30.   [pool release];   
  31. }     
  32. [NSThread detachNewThreadSelector:@selector(postToTwitter)  
  33.    toTarget:self withObject:nil];  
  34. - (void) postToTwitter  
  35. {  
  36.   // Since this will be launched in a separate thread, we need  
  37.   // an autorelease pool  
  38.   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
  39.   NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:  
  40.     [NSURL URLWithString:@"http://TWITTER_ACCOUNT:PASSWORD@twitter.com/statuses/update.xml"]   
  41.     cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];  
  42.   // The text to post  
  43.   NSString *msg = @"testing";  
  44.    
  45.   // Set the HTTP request method  
  46.   [request setHTTPMethod:@"POST"];  
  47.    
  48.   [request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg]   
  49.     dataUsingEncoding:NSASCIIStringEncoding]];  
  50.    
  51.   NSURLResponse *response;  
  52.   NSError *error;  
  53.    
  54.   if ([NSURLConnection sendSynchronousRequest:request   
  55.       returningResponse:&response error:&error] != nil)  
  56.     NSLog(@"Posted to Twitter successfully.");  
  57.   else   
  58.     NSLog(@"Error posting to Twitter.");   
  59.    
  60.   // Release pool  
  61.   [pool release];   
  62. }   
  1. [NSThread detachNewThreadSelector:@selector(postToTwitter)  
  2.    toTarget:self withObject:nil]; 

小結:iOS應用程序 Twitter開發代碼的內容介紹完了,希望本文對你有所幫助。

本文來自:http://www.cocoachina.com/iphonedev/sdk/2010/1202/2431.html

責任編輯:zhaolei 來源: CocoaChina
相關推薦

2011-08-11 16:50:04

iOSTwitter

2011-08-08 13:26:48

iOS開發 Twitter

2009-07-07 00:01:32

Twitter應用

2013-01-11 15:06:13

iOS開發移動應用iPhone

2011-07-18 10:21:04

iOS Visual Stu iphone

2013-01-11 15:24:02

iOS開發移動應用iPhone

2013-01-11 14:45:43

iOS開發移動應用iPhone

2022-08-02 16:33:54

網絡安全密鑰數據泄漏

2012-03-15 15:35:51

iUI框架EclipseiOS Web

2012-02-08 15:06:31

ibmdw

2022-09-19 00:37:13

SaaS云計算開發

2013-02-21 14:15:41

開發Tizen

2013-02-21 14:14:40

開發Tizen

2011-07-18 10:00:47

iPhone iOS Visual Stu

2013-01-11 14:33:14

iOS開發移動應用iPhone

2020-02-20 12:50:47

后端代碼應用程序

2013-11-19 15:35:01

2009-09-24 17:21:17

加速Hibernate

2011-05-31 13:34:22

應用開發iPad

2010-10-15 09:39:22

MeeGoQt
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 伊人久久大香线 | 国产中文字幕亚洲 | 一区在线观看 | 久久综合色综合 | 91成人精品视频 | 亚洲一区欧美 | 97伦理| 91视频在线观看 | 日韩国产在线 | 日韩欧美国产不卡 | 二区在线视频 | 五月激情综合网 | 欧美日韩一区二区在线播放 | 视频在线h | 午夜视频精品 | 亚洲一区二区久久 | 毛片a| 国产日韩欧美中文字幕 | 亚洲顶级毛片 | 91视频在线观看免费 | 日本a视频 | 天天综合天天 | 日韩av最新网址 | 成人福利在线视频 | 午夜精品在线观看 | 国产精品久久久乱弄 | 亚洲综合在线网 | 成人视屏在线观看 | 久久久久国产精品一区二区 | 国产精品一区二区在线播放 | 男女啪啪网址 | 激情a| 日韩国产欧美一区 | 成人综合伊人 | 国产激情在线观看 | 久久久不卡网国产精品一区 | 国产美女一区二区 | 一区二区不卡 | 免费在线黄色av | 久久tv在线观看 | 久久久中文 |