开发者

How to use addRecipient method from Three20?

I use the TTMessageController from Three20 to display a view that开发者_如何学编程 is similar to the iPhone SMS application containing a recipient picker.

Currently I am able to autosearch contacts and to browse them by clicking on the + button:

How to use addRecipient method from Three20?

However I have a problem to apply the selected contact to the recipient field. TTMessageController implements the addRecipient method but I am not sure how to use it.

In my controller class that extends TTMessageController I have following method which is triggered when a contact is selected, so addRecipient has to go here somewhere:

- (BOOL)peoplePickerNavigationController: 
                (ABPeoplePickerNavigationController *)peoplePicker
                shouldContinueAfterSelectingPerson:(ABRecordRef)person{
    //dismiss the contact selector
    [self dismissModalViewControllerAnimated:NO];
    return NO;
}

Any idea how to add the recipient in that method?


Add a single item from your datasource to the recipient field. So if your datasource has an array of strings (names) you call addRecipient: with a string. The index is where you want to insert the recipient in the field.

Post your datasource implementation and I will completely your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜