Универсальное приложение вылетает на симуляторе iPad каждый раз - PullRequest
2 голосов
/ 09 февраля 2011

Мое приложение падает на симуляторе iPad в альтернативных сборках, сбой, затем запуск, затем сбой и т. Д.

objc[1116]: Class Protocol is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libobjc.A.dylib and /Users/NGA24iMAC3/Library/Application Support/iPhone Simulator/4.2/Applications/C0FFA7D7-7684-4854-B641-62BD11CFD226/Innovations.app/Innovations. One of the two will be used. Which one is undefined.
2011-02-09 11:53:01.446 Innovations[1116:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PadLoginScreen" nib but the view outlet was not set.'

*** Call stack at first throw:
(
    0   CoreFoundation                      0x01286be9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x013db5c2 objc_exception_throw + 47
    2   CoreFoundation                      0x0123f628 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x0123f59a +[NSException raise:format:] + 58
    4   UIKit                               0x004a2b75 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
    5   UIKit                               0x004a0709 -[UIViewController loadView] + 120
    6   UIKit                               0x004a05e3 -[UIViewController view] + 56
    7   UIKit                               0x0049ea57 -[UIViewController contentScrollView] + 42
    8   UIKit                               0x004af201 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
    9   UIKit                               0x004ad831 -[UINavigationController _layoutViewController:] + 43
    10  UIKit                               0x004aeb4c -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
    11  UIKit                               0x004a9606 -[UINavigationController _startDeferredTransitionIfNeeded] + 266
    12  UIKit                               0x004b083e -[UINavigationController pushViewController:transition:forceImmediate:] + 932
    13  UIKit                               0x004a94a0 -[UINavigationController pushViewController:animated:] + 62
    14  Innovations                         0x00006172 -[SplashScreenController switchView] + 303
    15  Foundation                          0x001887a5 __NSFireTimer + 125
    16  CoreFoundation                      0x01267fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    17  CoreFoundation                      0x01269594 __CFRunLoopDoTimer + 1220
    18  CoreFoundation                      0x011c5cc9 __CFRunLoopRun + 1817
    19  CoreFoundation                      0x011c5240 CFRunLoopRunSpecific + 208
    20  CoreFoundation                      0x011c5161 CFRunLoopRunInMode + 97
    21  GraphicsServices                    0x01b52268 GSEventRunModal + 217
    22  GraphicsServices                    0x01b5232d GSEventRun + 115
    23  UIKit                               0x0040142e UIApplicationMain + 1160
    24  Innovations                         0x00002e70 main + 102
    25  Innovations                         0x00002e01 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.

Но все выходы настроены правильно в IB. Пожалуйста, помогите мне. Заранее спасибо.

Ответы [ 4 ]

3 голосов
/ 09 февраля 2011

@ Ишу, я думаю, что что-то не так с вашими подключениями в IB. Я знаю, что вы проверили свой IB, но можете ли вы снова создать свой файл .xib.

0 голосов
/ 22 февраля 2011
  1. Откройте наш iPad xib в Интерфейсном Разработчике
  2. Нажмите на владельца файла
  3. В Инспекторе перейдите на четвертую вкладку (Удостоверение)
  4. Записать как классidentity имя класса, который действует как контроллер представления для этой xib.
  5. Ready to go!
0 голосов
/ 09 февраля 2011

Я также столкнулся с той же проблемой в моем приложении Universal.

Я сделал что-то подобное, что решило мою проблему -

- (id)initWithNibName:(NSString *)n bundle:(NSBundle *)b
{
    return [self init];
}


- (id)init
{



    BOOL iPad = NO;
#ifdef UI_USER_INTERFACE_IDIOM
    iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#endif


    if (iPad) 
    {
        // iPad specific code here
        NSLog(@"Device is iPad");
        [super initWithNibName:@"ContactUsViewController~ipad" bundle:nil];

    } else 
    {
        // iPhone/iPod specific code here
        NSLog(@"Device is iPhone");
        [super initWithNibName:@"ContactUsViewController" bundle:nil];

    }

    return self;
}

когда вы добавляете / нажимаете viewController, просто вызываете его метод init, а затем нажимаете viewcontroller.

0 голосов
/ 09 февраля 2011

Я предлагаю очистить ваш проект. Команда + Shift + K

Затем откройте файл XIB и убедитесь, что к вашему представлению подключена точка просмотра «Владелец файла». Из не подключи и его и сохрани.

Перестройте свой проект.

...