lundi 23 mars 2015

Tweets through ios simulator through my iphone app does not show up on my twtitter feed.


I connected a tweeting option in my iphone app (really simple one) but even though I connected my account when ever i tweet something it sends but doesnt show up in my twiiter feed.


This is my .h file.



#import <UIKit/UIKit.h>

@interface XYZViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextField *maintitle;

@property (weak, nonatomic) IBOutlet UITextField *numberone;

@property (weak, nonatomic) IBOutlet UITextField *dos;

@property (weak, nonatomic) IBOutlet UITextField *tres;

- (IBAction)tweetTapped:(id)sender;

@property (weak, nonatomic) IBOutlet UITextField *cutro;

@property (weak, nonatomic) IBOutlet UITextField *cindo;

@property (weak, nonatomic) IBOutlet UITextField *seis;

@property (weak, nonatomic) IBOutlet UITextField *seba;

@end


This is my .m file



#import "XYZViewController.h"
#import <Social/Social.h>

@interface XYZViewController ()
@end

@implementation XYZViewController

@synthesize numberone, dos, tres, cutro, cindo, seis, seba, maintitle;

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (IBAction)tweetTapped:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Tweeting from my own app! :)"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Sorry"
message:@"You can't send a tweet right now, make
sure your device has an internet connection and you have at least one
Twitter account setup"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}



@end




Aucun commentaire:

Enregistrer un commentaire