▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
กระทู้ที่คุณอาจสนใจ
อ่านกระทู้อื่นที่พูดคุยเกี่ยวกับ
Xcode
iOS
iPhone App
Mobile Application
การพัฒนา Mobile Application
UIAlertView มี 2 Method ต้องเขียนคำสั่งยังไง ครับ
if (...) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Hello" message:@"Please select " delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"1",@"2",nil];
[alert show];
}
-(void) alertView: (UIAlertView * ) alertView clickedButtonAtIndex: (NSInteger)buttonIndex
{
switch (buttonIndex) {
case 0:
{
//Cancel
}
case 1:
{
//Show 1
}
break;
case 2:
{
//Show 2
}
break;
แต่ถ้ามีอีก Method หนึ่ง คือ
if (A > 9) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"AAA" message:@"is" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
ผมต้องการคือ เมื่อ กด OK ให้เรียก Webview ขึ้นมา ผมจะต้องเขียนใน Method
-(void) alertView: (UIAlertView * ) alertView clickedButtonAtIndex: (NSInteger)buttonIndex
ยังไงเหรอครับ ... ถึงจะไม่ให้ซ้ำกับ Method แรก
ขอบคุณครับ (ยาวมากครับ ผมอธิบายไม่ค่อยถูกครับ)