任何人都可以告訴我如何在按下UIAlert標題按鈕時在TweetSheet中添加文本?當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"];
}
}
有誰能告訴我這裏有什麼問題嗎?