[問題]兩個coding上的小問題
抱歉我又來發問了(汗)
1.
我要設定一個防呆
防呆的內容是當每一個radio button都沒有按到時
會跳出警告視窗而且next page這個按鈕就不會出現(預設值就是hidden)
程式碼如下:
if ([radiobutton1 isSelected]==NO) {
if ([radiobutton2 isSelected]==NO) {
if ([radiobutton3 isSelected]==NO) {
if ([radiobutton4 isSelected]==NO) {
if ([radiobutton5 isSelected]==NO) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You do not choose radio button,it's nessary" message:@"Please choose one at least" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
NextPage.hidden=YES;
}
}
}
}
}
NextPage.hidden=NO;
每次一按下去雖然會跳出警告視窗
可是next page的按鈕也會出現
這樣就跟沒有防呆一樣了(next page是用seguse)
該怎麼解決呢?
2.
我需要讀label裡面的值
然後丟到演算法去對應出一個值
int PostureScoreA;
float LocateUpperArm=[[LocateUpperArmInWristTwist text]intValue];
float LocateLowerArm=[[LocateLowerArmInWristTwist text]intValue];
float LocateWrist=[[LocateWristInWristTwist text]intValue];
float WristTwist=[[WristTwistResult text]intValue];
//範例演算法
if (LocateUpperArm==1) {
if (LocateLowerArm==1) {
if (LocateWrist==1) {
if (WristTwist==1) {
PostureScoreA=1;
}
}
}
} //(1,1,1,1)
PostureA.text = [NSString stringWithFormat:@"%.f",(PostureScoreA)];
可是每次執行都會斷在LocateUpperArm這一行
請問原因在哪裡?
以上兩個問題
謝謝大家~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.114.54.99
※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1413104948.A.079.html
→
10/12 19:31, , 1F
10/12 19:31, 1F
→
10/12 19:33, , 2F
10/12 19:33, 2F
→
10/12 20:00, , 3F
10/12 20:00, 3F
→
10/12 20:02, , 4F
10/12 20:02, 4F
→
10/12 20:09, , 5F
10/12 20:09, 5F
→
10/12 20:10, , 6F
10/12 20:10, 6F
→
10/12 20:11, , 7F
10/12 20:11, 7F
→
10/12 20:12, , 8F
10/12 20:12, 8F
→
10/12 20:12, , 9F
10/12 20:12, 9F
推
10/19 19:12, , 10F
10/19 19:12, 10F
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章