本文介绍的是IOS学习利用新浪SDK分享内容,在之前写过利用IOS,发布facebook和Twitter分享应用中的内容,下面主要介绍一下利用新浪的SDK分享相关内容到新浪微波上。主要涉及到之前写过的解析iPhone实现传递FROM表单数据中添加网络部分和新浪的SDK。
下面是我写的demo:
- #import <UIKit/UIKit.h>
- #import “SinaUtil.h”
- @interface iphone_sinaShareViewController : UIViewController {
- SinaUtil *sinaUtil;
- NSData* selectedImgData;
- }
- -(IBAction)onClickbutton:(id)sender;
- @end
- #import “iphone_sinaShareViewController.h”
- @implementation iphone_sinaShareViewController
- -(void)viewWillAppear:(BOOL)animated{
- [super viewWillAppear:animated];
- sinaUtil = [[SinaUtil alloc]init];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- - (void)viewDidUnload {
- }
- - (void)dealloc {
- [super dealloc];
- }
- -(IBAction)onClickbutton:(id)sender
- {
- [[NSUserDefaults standardUserDefaults]setObject:@”wangjun@easymorse.com” forKey:@”userid”];
- [[NSUserDefaults standardUserDefaults]setObject:@”password” forKey:@”userpw”];
- NSURL* url = [sinaUtil getAuthUrlWithData:selectedImgData];
- NSLog(@”11%@”,url);
- [sinaUtil postString:@"王军的测试11" withUrl:url];
- }
- @end
小结:IOS学习利用新浪SDK分享内容的内容介绍完了,希望本文对你有所帮助。
源代码:http://easymorse-iphone.googlecode.com/svn/trunk/iphone.sinaShare/
本文来自:http://wangjun.easymorse.com/?p=1229