iPad的状况不正常

时间:2017-07-28 09:37:31

标签: ios

在我的应用程序中,我有if-else条件问题是这种情况在模拟器(iPhone以及iPad)和iPhone设备上也能正常运行但在ipad设备上表现不正常。是否有可能解决这个问题?

if (_loginForCoDriver ) {
    NSString *name=[[APPDELEGATE.coDeriverDetailArr objectAtIndex:0] objectForKey:@"name"];

    NSString *password=[[APPDELEGATE.coDeriverDetailArr objectAtIndex:0] objectForKey:@"driver_pass"];
    //[[APPDELEGATE.coDeriverDetailArr objectAtIndex:0] objectForKey:@"driver_pass"];

    if ((usernametext.text==name) && (passwordtext.text==password) ) {
         [self logoutAPI];
        //modeStr=@"Logging";
        [ProgressHUD show:@"Please wait..." Interaction:NO];
        //https://mobile.epgsolutions.net/

        //   NSString *strURL =[NSString stringWithFormat:@"http://projects.udaantechnologies.com/epg_services/user_login.php"];
        NSString *strURL =[NSString stringWithFormat:@"%@%@",_baseurl,@"user_login.php"];
        // NSString *strURL =[NSString stringWithFormat:@"https://mobile.epgsolutions.net/user_login.php"];

        ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:strURL]];
        [request setDelegate:self];

        [request setPostValue:usernametex.text forKey:@"number"];
        [request setPostValue:passwordtex.text forKey:@"password"];
        [request setPostValue:@"1" forKey:@"device_type"];
        [request setPostValue:APPDELEGATE.deviceTokenStr forKey:@"access_token"];
        [request setUploadProgressDelegate:self];
        [request setTimeOutSeconds:200000.0];
        [request startAsynchronous];
    }
    else{
        [[[UIAlertView alloc]initWithTitle:@"Alert" message:@"Id/Password doesn't Match !" delegate:self cancelButtonTitle:@"Re-Enter" otherButtonTitles:@"Go Back", nil] show];

                }

   }

1 个答案:

答案 0 :(得分:0)

UIAlertView已弃用。使用UIAlertController而不是UIAlertControllerStyleAlert的preferredStyle。 从iOS8 Apple开始提供新的UIAlertController类,您可以使用它而不是现在已弃用的UIAlertView,它也在折旧消息中说明。

我读了你的代码,它是完美的,除了这个UIAlertView之外什么都没找到。

可能会有效。