Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Xcode で MFMailViewController を使用しており、この行で受信者を設定しています。
[mailComposer setToRecipients:emailAddresses];
受信者を NSArray 内の特定のインデックスに設定する必要がありますが、これを行う方法がわかりません。
それでも意味がわからない場合は、ユーザーが入力した内容に応じて、メールアドレスを特定の人にする必要があります。
次のようにする必要があります。
if (useBobsEmail) { [mailComposer setToRecipients:@[@"bob@somewhere.com"]]; } else { [mailComposer setToRecipients:@[@"joe@somewhereelse.com]]; }
知らない場合は、@[]表記を の代わりに使用できます[NSArray arrayWithObjects:]。
@[]
[NSArray arrayWithObjects:]