1
我有問題alertview
當我試圖顯示一些文本,如果用戶取消alertivew
。uialertview與條件if語句在ios
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
UIALertView alertview = [[UIAlertView alloc] initWithTitle:@"New Answer"
message:@"Your text"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
[alert show]
if (buttonIndex == 0)
{
NSLog(@"ok");
[[self sectionSelectedDisplay] setText:answerLabel];
}
else
{
NSLog(@"cancel");
}
}
+++++++++++++++++++++++++
誰能幫我解決這個問題?
所以,你要的NSLog的alertview按鈕按下的指數? – Woodstock
該問題尚不清楚。你到底需要什麼幫助? –
@Puneet:我編輯了代碼。那是我的功能。這[[self sectionSelectedDisplay] setText:answerLabel];不在if語句內工作。 – Aragon