Я пытаюсь перейти с одного взгляда на другой при нажатии кнопки с помощью iOS 5.0.iOS не удалось загрузить просмотры
код я использую
- (IBAction)Actionlogin:(id)sender {
NSLog(@" login button has been pressed");
NSLog(@"In init");
test_details *aSecondPageController=[[test_details alloc]initWithNibName:@"test_details" bundle:nil];
[self.navigationController pushViewController:aSecondPageController animated:NO];
}
У меня есть два XIb файлы test_details_iPhone.xib
и test_details_iPad.xib
Внутри моей testdetails.m
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
NSLog(@"it is coming here in second view");
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
NSLog(@"it has been returned ");
return self;
}
Logs
2013-04-25 11:06:17.191 app_gototest[3067:207] login button has been pressed
2013-04-25 11:06:17.194 app_gototest[3067:207] In init
2013-04-25 11:06:17.195 app_gototest[3067:207] it is coming here in second view
2013-04-25 11:06:17.196 app_gototest[3067:207] it has been returned
Вид не загружается в представление. Полагаю, что я что-то упускаю.
применения: didFinishLaunchingWithOptions: в appDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
** Я пытаюсь подход Джаспера Блю **
argc int 1
argv char ** 0xbfffed2c
*argv char * 0xbfffee44
В appDeleagte.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UINavigationController* navigationController;
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:_viewController];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:_viewController];
}
self.window.rootViewController = navigationController;
[self.window makeKeyAndVisible];
return YES;
}
вы пытаетесь перейти от XIb iPhone к XIb Ipad в ?? –
нет .. Я пишу приложение для iPhone и iPad. от iPhone 1-й взгляд на iPhone второй от iPad 1-й взгляд на iPad второй – onkar
@onkar: Могу ли я узнать тип шаблона вашего приложения? Находится ли это на основе навигации или Tab? –