0
以下は、Facebookのモバイルアプリで実装され、ユーザーの壁に公開するコードです。代わりにパブリッシュウォールの値をTextview.textに変更するには、ユーザーが入力する必要があります。このObjective-Cコードスニペットを理解する助けが必要
- (IBAction)publishStream:(id)sender {
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: @"Always Running", @"text", @"http://itsti.me/", @"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_facebook dialog:@"feed" andParams:params andDelegate:self];
}
私はそれを知っています。私はすでにそれを持っていた。上のコードはサンプルの権利ですか?どこでTextView.textに変更する必要がありますか – Noob
あなたが望むものを明確にしたので、私の答えを編集します –
私はこのようなコードを変更します。パブリッシュ・ウォールは、依然としてユーザーにテキスト・ボックスを埋めるよう要求します。 NSDictionaryの*添付ファイル= [NSDictionaryのをdictionaryWithObjectsAndKeys: "マイアプリ名" @ 、 "名前" @、 "マイアプリのタイトル"、@ "キャプション"、 TextView.text、@ "説明"、 @ "@のhttp ://myurl.net "、@" href "、nil]; – Noob