无法在xcode检查器上找到派生类

时间:2014-01-07 16:20:34

标签: ios objective-c xcode

我是xcode和objective-c的新手,我创建了一个基类UIViewController。我们称之为A.

我还创建了一个继承类B

现在我尝试使用我的故事板并将其连接到相关的B文件,

但它不会在检查器上显示,只有A文件会显示。

以下是头文件:

A:

#import <UIKit/UIKit.h>
#import "Deck.h"

@interface CardGameViewController : UIViewController

// for subclasses
- (Deck*)createDeck; //abstract

@end

B:

#import "CardGameViewController.h"

@interface PlayingCardViewController : CardGameViewController

@end

有没有办法通过?或B实际上应该在检查员身上?

修改

这是强制检查员使用PlayingCardViewController

后得到的错误
2014-01-07 18:24:09.874 Matchismo[80975:70b] Unknown class PlayingCardGameViewController in Interface Builder file.
2014-01-07 18:24:09.893 Matchismo[80975:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x8d841e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cardButtons.'
*** First throw call stack:
(
    0   CoreFoundation                      0x017415e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x014c48b6 objc_exception_throw + 44
    2   CoreFoundation                      0x017d16a1 -[NSException raise] + 17
    3   Foundation                          0x011859ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
    4   Foundation                          0x010f1cfb _NSSetUsingKeyValueSetter + 88
    5   Foundation                          0x010f1253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    6   Foundation                          0x0115370a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
    7   UIKit                               0x0071fe3a -[UIRuntimeOutletCollectionConnection performConnect] + 690
    8   UIKit                               0x0071fe75 -[UIRuntimeOutletCollectionConnection connect] + 33
    9   libobjc.A.dylib                     0x014d67d2 -[NSObject performSelector:] + 62
    10  CoreFoundation                      0x0173cb6a -[NSArray makeObjectsPerformSelector:] + 314
    11  UIKit                               0x004d356e -[UINib instantiateWithOwner:options:] + 1417
    12  UIKit                               0x00345605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
    13  UIKit                               0x00345dad -[UIViewController loadView] + 302
    14  UIKit                               0x003460ae -[UIViewController loadViewIfRequired] + 78
    15  UIKit                               0x003465b4 -[UIViewController view] + 35
    16  UIKit                               0x0026e9fd -[UIWindow addRootViewControllerViewIfPossible] + 66
    17  UIKit                               0x0026ed97 -[UIWindow _setHidden:forced:] + 312
    18  UIKit                               0x0026f02d -[UIWindow _orderFrontWithoutMakingKey] + 49
    19  UIKit                               0x0027989a -[UIWindow makeKeyAndVisible] + 65
    20  UIKit                               0x0022ccd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
    21  UIKit                               0x002313a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
    22  UIKit                               0x0024587c -[UIApplication handleEvent:withNewEvent:] + 3447
    23  UIKit                               0x00245de9 -[UIApplication sendEvent:] + 85
    24  UIKit                               0x00233025 _UIApplicationHandleEvent + 736
    25  GraphicsServices                    0x036e82f6 _PurpleEventCallback + 776
    26  GraphicsServices                    0x036e7e01 PurpleEventCallback + 46
    27  CoreFoundation                      0x016bcd65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    28  CoreFoundation                      0x016bca9b __CFRunLoopDoSource1 + 523
    29  CoreFoundation                      0x016e777c __CFRunLoopRun + 2156
    30  CoreFoundation                      0x016e6ac3 CFRunLoopRunSpecific + 467
    31  CoreFoundation                      0x016e68db CFRunLoopRunInMode + 123
    32  UIKit                               0x00230add -[UIApplication _run] + 840
    33  UIKit                               0x00232d3b UIApplicationMain + 1225
    34  Matchismo                           0x000038dd main + 141
    35  libdyld.dylib                       0x01d7f70d start + 1
    36  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

1 个答案:

答案 0 :(得分:0)

转到Xcode中的“产品”菜单,然后选择“清洁”。有时这会解决像这样的奇怪问题。