谁能告诉我当按下 UIAlert 标题按钮时如何在 TweetSheet 中添加文本?
目前我正在使用此代码来实现它,但到目前为止失败了。
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init];
if ([title isEqualToString:@"Add custom text"]) {
UIAlertView *alert= [[UIAlertView alloc] initWithTitle:@"Add a template" message:nil delegate:self cancelButtonTitle:@"Hi it was nice meeting you" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
if ([title isEqualToString:@"Hi it was nice meeting you"]) {
[tweetSheet setInitialText:@"hey it was nice meeting you"];
}
}
谁能告诉我这里有什么问题?