-3

iPhone用とiPad用の2つの異なるストーリーボードを持つユニバーサルアプリを作成したユニバーサルアプリについてお聞きしたいのですが、メインビューと呼ばれる両方のストーリーボードでビューコントローラーを作成したと仮定して、iPhoneのストーリーボード用に異なるクラスを作成する必要がありますと ipad または、1 つのクラスを作成して mainview iphone と mainview ipad の両方に割り当てる必要があります。

以下のコードを無視してください

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"%@",[ApplicationUtility getPlistData:KEY_REGISTER_DATA]] delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];

NSString *str = [NSString stringWithFormat:@"%@",[ApplicationUtility getPlistData:KEY_REGISTER_DATA]];

NSLog(@"%@",str);

if([str isEqualToString:@"Signed up successful"])
{

    username.text = @"";
    firstname.text = @"";
    lastname.text = @"";
    email.text = @"";
    supass.text = @"";
    suconfirmpass.text = @"";
    country.text = @"";
    postal.text = @"";
    dob.text = @"";
    titl.text = @"";
    [priv1 setSelected:NO];
    [priv2 setSelected:NO];

    [male setSelected:NO];
    [female setSelected:NO];

}
4

2 に答える 2

0

はい、できれば両方のストーリーボードに 1 つのクラスを作成する必要があります。そのため、特別な処理がある場合はif、コードにいくつかのステートメントを入れることができます。

Apple のドキュメントはこちらでご覧いただけます

于 2013-09-03T08:15:39.990 に答える
0
in storyboard u should call a ipad storybard on ipad condition and u shoud call iphone storyboard on iphone condition and condition is below...
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)
{
              //for iphone storyboard
}
else
{
              //for ipad storyboard
}
于 2013-09-03T08:50:32.177 に答える