我试图显示我与uialertview委托一起展示的自定义警报视图与uialertview一起被解雇。 首先,uialertview出现然后点击uialertview中的按钮自定义alertview将显示。我希望自定义alertview保留,uialertview解雇。
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Options"
message:@""
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Share Book", @"Delete Book", nil];
[alert show];
委托方法:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1)
{
checker = 1;
dispatch_async(dispatch_get_main_queue(), ^
{
NSString *sTitle = @"Your QQ or Weixin share title"; //Only support QQ and Weixin
NSString *sDesc = @"Your share content";
NSString *sUrl = @"http://www.facebook.com";
SMImage *sImage = [[SMImage alloc] initWithImageUrl:@"http://e.hiphotos.baidu.com/image/w%3D310/sign=af410cc1f536afc30e0c39648319eb85/6f061d950a7b0208d7fa7ee060d9f2d3572cc884.jpg"];
[[ShareManager sharedManager] setContentWithTitle:sTitle description:sDesc image:sImage url:sUrl];
[[ShareManager sharedManager] showShareWindow];
});
}