まず、これはおそらくやや簡単な/ noobishの質問をお詫び申し上げます。 しかし、私はかなりの間このエラーをデバッグしようとしていました。残念ながら運がなければ、私は最近Xcodeで作業を始め、Swiftを使い始めました。signal sigabrt delegate - > AppDelegate.swift
私はオンラインコースであるUdemyからのチュートリアルに従っています。 はしかし、コードを挿入した後、私はこのエラーを取得しておくん:ですが、何ができるか
Thread1: Signal SIGABRT
ませアイデア。私はGoogleの にhttps://teamtreehouse.com/community/error-message-thread-1-signal-sigabrt-in-class-appdelegate
を探してきた。しかし、これは私の問題を解決しませんでした:(
また、起こっている正確に理解することは非常に困難であるので、私はグーグルを通じて良い解決策を見つけることができません。たぶん、あなたは私を助けることができる
class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
@IBOutlet weak var statePicker: UIPickerView!
@IBOutlet weak var statePickerBtn: UIButton!
let states = ["Alaska","Arkansas","Alabama","California","New York"]
override func viewDidLoad() {
super.viewDidLoad()
self.statePicker.dataSource = self
statePicker.delegate = self
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func stateBtnPressed(_ sender: AnyObject) {
statePickerBtn.isHidden = false
}
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return states.count
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return states[row]
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
statePickerBtn.setTitle(states[row], for: UIControlState.application)
statePicker.isHidden = true
}
を私が行うには何をしようとしています:。 私は隠された上ピッカーを持って、ユーザー押しボタンが、私はそれがピッカーを明らかにしたいときに、ユーザーがイベントをクリックすると。 、彼らは配列を持つピッカーを見るでしょう。まあ、あなたは私が何を意味するか知っています。しかし、私がそれを構築すると、彼はシミュレータを白のままにし、Xcodeはこの特定のエラーでAppDelegate.Swiftに私にプロンプトを出します。
TNX
Print screen of the error after I pressed Run. + Output, sorry for messy prnt scrn :)
コンソール出力:
2017-03-01 18:03:39.717795 myPillsNoob[969:17168] subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2017-03-01 18:03:39.725996 myPillsNoob[969:17168] subsystem: com.apple.UIKit, category: HIDEventIncoming, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2017-03-01 18:03:39.738908 myPillsNoob[969:17165] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
2017-03-01 18:03:39.760737 myPillsNoob[969:17069] subsystem: com.apple.UIKit, category: StatusBar, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2017-03-01 18:03:39.849 myPillsNoob[969:17069] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<myPillsNoob.ViewController 0x7fa24ce09160> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key stateButtonPressed.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001132e234b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000011038f21e objc_exception_throw + 48
2 CoreFoundation 0x00000001132e2299 -[NSException raise] + 9
3 Foundation 0x000000010fe9f2ff -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x00000001109f88c3 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x0000000110c6cbe6 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000113287590 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x0000000110c6b56a -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x00000001109feff5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x00000001109ff917 -[UIViewController loadView] + 177
10 UIKit 0x00000001109ffc4c -[UIViewController loadViewIfRequired] + 201
11 UIKit 0x0000000110a004a0 -[UIViewController view] + 27
12 UIKit 0x00000001108ca045 -[UIWindow addRootViewControllerViewIfPossible] + 71
13 UIKit 0x00000001108ca796 -[UIWindow _setHidden:forced:] + 293
14 UIKit 0x00000001108de0a9 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x0000000110857259 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4818
16 UIKit 0x000000011085d3b9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
17 UIKit 0x000000011085a539 -[UIApplication workspaceDidEndTransaction:] + 188
18 FrontBoardServices 0x000000011477b76b __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
19 FrontBoardServices 0x000000011477b5e4 -[FBSSerialQueue _performNext] + 189
20 FrontBoardServices 0x000000011477b96d -[FBSSerialQueue _performNextFromRunLoopSource] + 45
21 CoreFoundation 0x0000000113287311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000011326c59c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x000000011326ba86 __CFRunLoopRun + 918
24 CoreFoundation 0x000000011326b494 CFRunLoopRunSpecific + 420
25 UIKit 0x0000000110858db6 -[UIApplication _run] + 434
26 UIKit 0x000000011085ef34 UIApplicationMain + 159
27 myPillsNoob 0x000000010fdb071f main + 111
28 libdyld.dylib 0x0000000113fe568d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
コンソールやXcodeは何かありますか?それは非常に一般的なエラーです。しかし、エラーの詳細は、この問題をかなり指摘するはずです。 – dfd
どこに必要なものを正確に見つけることができますか?コンソールは空のままです。私はVisual Studioでソフトウェアを書くのに慣れていて、2日前にXcodeを始めました。混乱しちゃった – Niklaus
私はVSに2015年まで約15年間書いていたので、あなたの痛みを理解しています。私はXcodeがコード行で "停止"しないと仮定しています。 (そうであれば、どのラインを指しているかを指摘してください。)それを超えて、2つのこと:(1)メニューオプション表示|デバッグエリア|コンソールをアクティブにします。 (2)左側の列のSIGABRTエラーを直接クリックします。 (あなたは非常に乱雑なダンプが表示されますが、それは助けになります。) – dfd