2013-11-24 16 views
0

在Xcode 5.0.2中,我創建了一個新的主 - 細節應用程序 - 它在iPhone和iPad模擬器上運行良好。如何在Xcode中刪除「用戶定義的運行時屬性」,它們是什麼?

但後來不小心在用戶自定義運行時Attribites在Xcode的右側面板中,我點擊(三次)加和補充「的keyPath」項(不真正瞭解它們是什麼):

enter image description here

我該如何刪除它們?點擊一個減號不會改變任何東西,現在在模擬器中運行失敗:

2013-11-24 21:02:53.003 MDExample[23132:a0b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITableView 0xab26000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0173c5e4 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x014bf8b6 objc_exception_throw + 44 
    2 CoreFoundation      0x017cc6a1 -[NSException raise] + 17 
    3 Foundation       0x011809ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 
    4 Foundation       0x010eccfb _NSSetUsingKeyValueSetter + 88 
    5 Foundation       0x010ec253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 
    6 UIKit        0x00297e0b -[UIView(CALayerDelegate) setValue:forKey:] + 168 
    7 Foundation       0x0114e70a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 
    8 UIKit        0x007aa0c5 -[UINibKeyValuePair apply] + 70 
    9 libobjc.A.dylib      0x014d17d2 -[NSObject performSelector:] + 62 
    10 CoreFoundation      0x01737b6a -[NSArray makeObjectsPerformSelector:] + 314 
    11 UIKit        0x004ce552 -[UINib instantiateWithOwner:options:] + 1389 
    12 UIKit        0x00340605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 
    13 UIKit        0x00340dad -[UIViewController loadView] + 302 
    14 UIKit        0x004e911e -[UITableViewController loadView] + 80 
    15 UIKit        0x003410ae -[UIViewController loadViewIfRequired] + 78 
    16 UIKit        0x003415b4 -[UIViewController view] + 35 
    17 UIKit        0x0036bca9 -[UINavigationController rotatingSnapshotViewForWindow:] + 52 
    18 UIKit        0x00695a60 -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 420 
    19 UIKit        0x002712f2 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1495 
    20 UIKit        0x00270d16 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82 
    21 UIKit        0x00270be8 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117 
    22 UIKit        0x00270c70 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67 
    23 UIKit        0x0026fd0a __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120 
    24 UIKit        0x0026fc6c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400 
    25 UIKit        0x002709c3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870 
    26 UIKit        0x00273fb6 -[UIWindow setDelegate:] + 449 
    27 UIKit        0x00345737 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180 
    28 UIKit        0x00269c1c -[UIWindow addRootViewControllerViewIfPossible] + 609 
    29 UIKit        0x00269d97 -[UIWindow _setHidden:forced:] + 312 
    30 UIKit        0x0026a02d -[UIWindow _orderFrontWithoutMakingKey] + 49 
    31 UIKit        0x0027489a -[UIWindow makeKeyAndVisible] + 65 
    32 UIKit        0x00227cd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851 
    33 UIKit        0x0022c3a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 
    34 UIKit        0x0024087c -[UIApplication handleEvent:withNewEvent:] + 3447 
    35 UIKit        0x00240de9 -[UIApplication sendEvent:] + 85 
    36 UIKit        0x0022e025 _UIApplicationHandleEvent + 736 
    37 GraphicsServices     0x036932f6 _PurpleEventCallback + 776 
    38 GraphicsServices     0x03692e01 PurpleEventCallback + 46 
    39 CoreFoundation      0x016b7d65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 
    40 CoreFoundation      0x016b7a9b __CFRunLoopDoSource1 + 523 
    41 CoreFoundation      0x016e277c __CFRunLoopRun + 2156 
    42 CoreFoundation      0x016e1ac3 CFRunLoopRunSpecific + 467 
    43 CoreFoundation      0x016e18db CFRunLoopRunInMode + 123 
    44 UIKit        0x0022badd -[UIApplication _run] + 840 
    45 UIKit        0x0022dd3b UIApplicationMain + 1225 
    46 MDExample       0x00003b3d main + 141 
    47 libdyld.dylib      0x01d78725 start + 0 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 
+0

選擇一個條目並單擊減號不會執行任何操作嗎?當然,文件上的錯誤。 –

+0

等待 - _did_您**在嘗試刪除之前選擇**條目?這在那裏有效。 –

回答

1

用戶定義的屬性運行只是:用戶自定義keypaths,可能無法在標準界面生成器編輯器可用於給定類/控制。當您點擊添加一個,您指示NIB除霜器撥打setValue:forKey:,在這種情況下,使用鍵路徑keyPath和值NO(或更確切地說,@NO)。當然,由於UITableView沒有名爲keyPath的keypath或屬性,因此KVC機制會崩潰。

要刪除一個,但必須強調的,那麼無論是刪除鍵或「減鍵」將工作:

enter image description here

如果問題仍然存在,file a bug report

+0

什麼是「@ NO」?我只知道'NO' sofar - 這與其他語言的'FALSE'類似 –

+1

這是一個NSNumber字面值。 KVC只處理對象,並在適當的情況下處理標量。 – CodaFi

+0

@其次,適合在一個NSNumber的值是 「語法糖」 - 打字的快捷'[NSNumber的numberWith *類型*:FOO];'所以,例如:'@YES,@(YES),@ 17 ,@(100 + SQRT(3))',轉換爲'... numberWithBool:YES'(2×),'... numberWithInt:17'和'numberWithFloat:101.73205080756888' – Olie

相關問題