0
我使用Three20的TTMessageController來顯示與包含收件人選取器的iPhone SMS應用程序類似的視圖。如何使用Three20的addRecipient方法?
目前我能夠自動搜索聯繫人和通過點擊+按鈕來瀏覽他們:
但是我有一個問題,以應用選定的接觸到收件人字段。 TTMessageController實現了addRecipient方法,但我不確定如何使用它。
在擴展TTMessageController我有以下時選擇的聯繫被觸發方法我的控制器類,所以addRecipient就到這裏找個地方:
- (BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person{
//dismiss the contact selector
[self dismissModalViewControllerAnimated:NO];
return NO;
}
任何想法如何添加收件人在方法?
http://pastebin.com/eS6EgShL這是我的TTMessageController實現。在代碼中搜索@test,到目前爲止,test已被添加到選擇器字段中,但我希望添加選定的人員。我只希望只添加一個收件人,因此當用戶點擊添加時,應刪除舊收件人 – 2011-04-02 15:29:22
AddressBookDataSource是相關的類。我認爲你需要重寫TTMessageController的addRecipient並在TTPickerTextField上調用removeAllCells來清除它。 – ssteinberg 2011-04-02 15:43:44
AddressBookDataSource實現是從這個問題的答案http://stackoverflow.com/questions/5374684/how-to-use-three20-ttmessagecontroller – 2011-04-02 15:46:41