コメントからの更新:
ええ、私のために働いています。ばかげた間違いを犯していました :-( viewDidLoad では、showDeleteActionSheet の代わりに削除ボタンの backAction メソッドを呼び出しています。それが原因でこの問題が発生しました。どうもありがとうございました
複数のUIViewが追加されたUIScrollViewがあります。UIActionSheet を使用して、UIScrollView から特定のビューを削除したいと考えています。しかし、それは機能していません..
.h file
-------
@interface myScrollViewController : UIViewController <UIScrollViewDelegate,UIActionSheetDelegate>
{
UIScrollView *holdSlideScrollView;
UIImageView *editPaperView;
}
@property (nonatomic, strong) UIScrollView *holdSlideScrollView;
@property (nonatomic, strong) UIScrollView *holdSlideScrollView;
- (void) showDeleteActionSheet;
@end
.m file
———
@implementation SlideViewController
- (void) loadView
{
[super loadView];
for (int i= 0; i < 2; i++)
{
UIImageView *editPaperView = [[UIImageView alloc] initWithFrame:CGRectMake(6.0f+i*320, 4.0f, 307.0f, 409.0f)];
[editPaperView setImage:[UIImage imageNamed:@"paper.png"]];
editPaperView.userInteractionEnabled = YES;
editPaperView.tag = i;
UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
[deleteButton setAlpha:0.8f];
[deleteButton setFrame:CGRectMake(265.0f, 378.0f, 30.0f, 30.0f)];
[deleteButton setImage:[UIImage imageNamed:@"ps_delete.png"] forState:UIControlStateNormal];
//[deleteButton setImage:[UIImage imageNamed:@“delete_bplushigh.png"] forState:UIControlStateHighlighted];
[deleteButton addTarget:self action:@selector(showDeleteActionSheet) forControlEvents:UIControlEventTouchUpInside];
[editPaperView addSubview:deleteButton];
[holdSlideScrollView addSubview:editPaperView];
}
[self.view addSubview:holdSlideScrollView];
}
- (void) showDeleteActionSheet
{
UIActionSheet *popupDeleteActionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:nil];
popupDeleteActionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupDeleteActionSheet showInView:self.view];
//popupDeleteActionSheet = nil;
}
@end
これの何が問題なのですか?私を助けてください!