Tag: mgtwitterengine

TARGET_OS_IPHONE和ApplicationTests

为什么在编译ApplicationTestsunit testing包时这个代码不工作? #if TARGET_OS_IPHONE #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #else #import <Cocoa/Cocoa.h> #endif 我的一个依赖项有这个检查,并且在我的主应用程序包中编译得很好,但是它在编译我的ApplicationTests包时试图加载<Cocoa/Cocoa.h> 。 这可能只是我对XCode的理解不足,但是当我的testing包不能构build时,我会感到紧张。 有什么build议么?

如何使用twitter api v1.1获取用户详细信息(Twitter错误215)

我已经使用twitter提供的twitter API来获取详细信息,但无法执行它,甚至试图传递消费者密钥,消费者密钥,令牌等身份validation数据,但结果是一样的。 我能够login并接收Twitter身份validation令牌,但无法获取用户详细信息。 下面的代码是我使用的(我正在使用MGtwitter引擎): NSMutableURLRequest *request =[[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1.1/users/show.json?screen_name=%@",username]]]; NSData *returnData = [ NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ]; NSString *returnString = [[NSString alloc]initWithData:returnData encoding:NSUTF8StringEncoding]; NSError *err = nil; twitterLogin = [NSJSONSerialization JSONObjectWithData:[returnString dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:&err]; 错误如下所示: errors = ( { code = 215; message = "Bad Authentication data"; } );