当我点击一个UIButton时,我遇到了一个奇怪的问题,它在UItableview的标题中包含的UItableview上触发了UIActionSheet。当我点击它时,会调用cellForRowAtIndexPath和willDisplayCell! UIButton函数中的代码如下:
UIActionSheet *popupQuery2 = [[UIActionSheet alloc] initWithTitle:@"Choose" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Reset search results" otherButtonTitles:@"Show all friends", nil];
popupQuery2.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery2 setDelegate:self];
popupQuery2.tag=1;
[popupQuery2 showInView:self.view];
[popupQuery2 release];
当触发showInView时,会调用cellForRowAtIndexPath和willDisplayCell!通话结束后弹出窗口显示!
忘了说只有在第一次按下按钮时才会发生这种情况。然后不调用cellForRowAtIndexPath和willDisplayCell。