如题。
解决方案 »
- vmware虚拟机中装了雪豹10.6 MAC系统, XCode4安装不了, 各位有什么解决办法吗?
- [新手急问] 一个关于UIButton的问题
- IOS越狱开发Hello World
- 关于IOS中 MVC模式和 回调通知的问题
- textfield 键盘处理
- 不懂ios软件发布,想问问怎样免越狱安装app打包好的软件
- http请求 同名参数
- 在pickerView中选择省市区三级联动的时候如何防止数组越界?
- ios问题,哪位大神来帮我看看block的问题
- 在iOS开发中最多调用的API服务是什么?
- 如何实现图片放大后逐渐清晰
- 【史上最给力】哈工大WI输入法现在发布啦!!!!!!!!!!!!!!! 安装新版本后请重启。之前安装过公测版的用户请务必先卸载后再安装。
{
// Since this will be launched in a separate thread, we need
// an autorelease pool
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:
[NSURL URLWithString:@"http://TWITTER_ACCOUNT:[email protected]/statuses/update.xml"]
cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
// The text to post
NSString *msg = @"testing";
// Set the HTTP request method
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg]
dataUsingEncoding:NSASCIIStringEncoding]];
NSURLResponse *response;
NSError *error;
if ([NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:&error] != nil)
NSLog(@"Posted to Twitter successfully.");
else
NSLog(@"Error posting to Twitter.");
// Release pool
[pool release];
}