Вопрос

i just want to ask about the universal app that i have created a universal app with two different storyboard one for iphone and other for ipad , lets assume i created a viewcontroller in both storyboards called mainview so should i create different classes for the storyboard of iphone and ipad or should i create one class and assign to both mainview iphone and mainview ipad .

ignore the code below

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];

}
Это было полезно?

Решение

Yes you should create one class for both storyboards if you can, so if you have any special treatment for any, you can put some if statements in your code.

You can take a look at Apple's doc here.

Другие советы

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
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top