小编stu*_*art的帖子

使用TWrequest在IOS5中将带有文本的图像发送到Twitter

根据苹果示例,我可以使用TWRequest轻松发送推文,

 ACAccountStore *account = [[ACAccountStore alloc] init];
 ACAccountType *accountType = [accountaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

// Request access from the user to access their Twitter account
[account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) 
 {
     // Did user allow us access?
     if (granted == YES)
     {
         // Populate array with all available Twitter accounts
         NSArray *arrayOfAccounts = [account accountsWithAccountType:accountType];

         // Sanity check
         if ([arrayOfAccounts count] > 0) 
         {
             // Keep it simple, use the first account available
             ACAccount *acct = [arrayOfAccounts objectAtIndex:0];

             // Build a twitter …
Run Code Online (Sandbox Code Playgroud)

twitter ios5

8
推荐指数
1
解决办法
4261
查看次数

Eclipse Gradle Wizard 使用 SubFolder -lib 创建项目

当我在 Eclipse 中创建 Gradle 项目时,结果是一个嵌套项目,其中包含一个自动创建的 -lib 文件夹。关于为什么要创建它的任何想法?

在此处输入图片说明

java eclipse gradle

8
推荐指数
1
解决办法
856
查看次数

Swift 2.0和Parse - 'init()'不可用:使用'init(domain:code:userInfo :)'

在升级到swift 2.0并经历了一系列错误后,我最终得到了这个错误,我不知道如何解决:

init() 不可用:使用 init(domain:code:userInfo:)

这是代码:

override func objectsDidLoad(error: NSError?) {
 self.actInd.startAnimating()
    for var i = 0; i < (objects!.count); i++ { 
     let countObject = (objects?[i] as! PFObject)
      print( (countObject.objectId)! )
     let queryT = PFQuery(className:"Transactions")
      queryT.whereKey("eventID", equalTo:(countObject.objectId)!)
      print( queryT.countObjects() )
      self.countedEvents.append(countEvents(objectId: (countObject.objectId)!, count:  queryT.countObjects() ))
    print( (countObject.objectId)! )

    self.actInd.stopAnimating()
}
super.objectsDidLoad(NSError())
}
Run Code Online (Sandbox Code Playgroud)

此处出现错误 - super.objectsDidLoad(NSError())

谢谢,斯图尔特

nserror parse-platform swift2

2
推荐指数
1
解决办法
704
查看次数

filteredArrayUsingPredicate不工作

我正在尝试使用filteredArrayUsingPredicate与从.plist文件中的数据构建的数组.不知怎的,它似乎永远不会过滤我的数组.

这就是我的数组的构建方式:

    DrillDownAppAppDelegate *AppDelegate = (DrillDownAppAppDelegate *)[[UIApplication sharedApplication] delegate];
    self.tableDataSource = [AppDelegate.data objectForKey:@"Rows"];
    copyDataSource = [ tableDataSource mutableCopy];
Run Code Online (Sandbox Code Playgroud)

然后我的谓词是这样的,

NSString *searchFor = search.text;
[tableDataSource release];
tableDataSource = [copyDataSource mutableCopy];
if ([searchFor length] > 0) {
NSLog(@"array = %@",tableDataSource);
NSPredicate *pred = [NSPredicate predicateWithFormat:@"Self beginswith[c] %@",searchFor];
    [tableDataSource filteredArrayUsingPredicate:pred];
}
Run Code Online (Sandbox Code Playgroud)

iphone nsmutablearray nspredicate

1
推荐指数
1
解决办法
2859
查看次数