0

私はゲームを持っていて、ユーザーはそこでスコアをTwitterに送信できます。問題は、現在、実際のスコアの代わりに、好きなものを入力できることです。TextFieldを編集不可にすると、スコアを変更できなくなります。

誰もがこれに対する解決策を知っていますか?

コードの抜粋は次のとおりです(明らかにTwitterフレームワークも適用されます)。

-(IBAction)twitter {

float currentTime = [seconds.text floatValue];
float newTime = currentTime;

NSString *twitter = [NSString stringWithFormat:@"I finished level 2 of #TextOff in %.2f seconds! Think you can beat my score? Download it in the App Store now!", newTime];

TWTweetComposeViewController *tweet = [[TWTweetComposeViewController alloc] init];
[tweet setInitialText:twitter];

//am i able to get ride of the textfield here?????

[self presentModalViewController:tweet animated:YES];

}

4

1 に答える 1

0

ユーザーのTwitterアカウントを使用してTwitterに投稿する場合は、ダイアログを表示したり、変更を許可したりせずに、デバイスでセットアップしたユーザーがSocialフレームワークのSLRequestクラスを使用します。これにより、組み込みのTwitter作成ダイアログを使用せずに、Twitterにリクエストを送信できます。

これをAccessのユーザーへのプロンプトでラップする必要がある[ACAccountStore requestAccessToAccountsWithType:options:completion:]ため、アラートプロンプトの前後に何をしているかを少なくともユーザーに示すことをお勧めします。そうしないと、疑わしいと思われます。

于 2013-02-24T23:23:24.833 に答える