Перейти к содержимому

Thread 1 signal sigabrt swift как исправить

  • автор:

What does "Thread 1: signal SIGABRT" mean?

I’m trying to create a weather app in the Build a Weather App in Swift course, and when I go to run the app in the simulator I get the «Thread 1: signal SIGABRT» error.

The line of code associated with this error is:

class AppDelegate: UIResponder, UIApplicationDelegate <

What can I do about this?

Maximiliano Villa

Maximiliano Villa
Maximiliano Villa

Oh, I figured it out. Check that all your connections are correct.

I was having an issue with the «refreshActivityIndicator» as I had named it something different, then changed the name in the viewcontroller file but didn’t change the connection (it doesn’t update automatically).

You can check that by selecting the object in your storyboard, and clicking on the last button to the right on the right sidebar. That shows its connections.

If you have one with a name that’s different than what you put in code, just delete it. Then drag the outlined circle on the right, to the view controller icon on the top of your view. It should offer you the right connection, and done!

Jeron Artest
Jeron Artest

I just had this problem. For anyone looking this problem up like I did, I noticed I had a label linked to two different referencing outlets. It happened when I switched my variable name. I just deleted the old one and it worked good as new.

6 Answers

dungeonkeeperhf
dungeonkeeperhf

It means the signal between the simulator and your code has been abrupted. Check all your code connections with you UI elements.

Paul Dieter
Paul Dieter

What specific abruptions am I looking for? What are the most common mistakes in this case? I’m really confused right now.

dungeonkeeperhf
dungeonkeeperhf

The most common error is when your uielements are not linked up correctly in the IB.

Ошибка: "Thread 1: signal SIGABRT"

Ошибка: "Thread 1: signal SIGABRT"
Всем привет. Занимаюсь поднятием демо чата QuickBlox для изучения. В целом я достаточно слаб в этом.

ошибка expected expression before "@" token
Не могу понять что неправильно #pragma mark — #pragma mark Actions .

Thread 1: Program received signal "SIGABRT"
Добрый вечер. Использую Кокос2Д. Мне надо чтобы спрайт генерировался каждые 2 секунды с позиции.

Выдаёт предупреждение Thread 1: signal SIGABRT
помогите пожалуйста в 24 строке выдаёт следующую ошибку Thread 1: signal SIGABRT вот сам код .

Thread 1 signal sigabrt swift как исправить

Fixing “Thread 1: signal SIGABRT” error in iOS

Cons Bulaquena

SIGABRT (Signal abort) indicates that the app crash due to failure to access something which is nil or doesn’t exist, usually in my experience it’s Outlets.

  1. In the storyboard, check all your Outlets in each view controller.

2. Make sure you remove the connections with yellow warnings. These are invalid outlets.

3. Check your storyboard ID in the Identity Inspector if the names are correct.

Swift: Thread 1 signal SIGABRT

After upgrading Xcode from 5 to 6 beta, almost every project gives me an unexpected error after running the application. There are some other posts with this title but the error is different.

In AppDelegate.swift, sometimes the simulator goes completely black, without the error, sometimes it gives me the error on this line:

In Xcode 5 I didn’t had this error before, with Deployment Target set to 7.0 or 7.1.

Thanks in advance.

perte's user avatar

7 Answers 7

This error is caused when you have 2 or more of the same IBOutlets or IBActions in your main.storyboard inspector (right arrow key at the very end of your options). Find out where there is double, and delete the one you don’t need! It should work perfectly fine after that.

Seems like there was a bug with iOS 7.1 as target.

Running tests on devices with iOS 7.1 installed now works. (17028705)

Try it again with the beta 2 update

I found this issue happened when I linked @IBOutlet/@IBAction and the linkage broke (renaming for instance). In the main.storyboard inspector, right click (control click) on the elements and delete any bad linkages. Should fix the error if that’s the issue.

  1. Go to deployment info and in «Main interface» select your correct storyboard.
  2. Rerun app.

xhinoda's user avatar

My issues with this started after I installed the legacy simulators (iOS7.1) under ‘More Simulators’ under the simulator build target. Xcode 6 and its native simulator had been running fine until then. What fixed it for me was to close Xcode, delete Derived Data, and under iOS Simulator in the simulator application choose «Reset Content and Settings» then restart the system.

Catherine's user avatar

I’m new to the coding world but resolved the painstacking problem. I was getting the same error by doing something and even though i deleted everything around that i couldn’t resolve it. It was still giving me the same error, which meant that it is not deleting in some file it stores. Took me a while to figure out which file, finally when i opened the Mainstoryboard as source file, and did search on the error key word which i knew i changed, it gave me the lines it was sitting in. After deleting those lines error got fixed. I know basic HTML so i knew which lines to delete.

I cannot start my project all over again everytime i have this error so i had to find the solution and there was no solution i could find. So i had to do it myself with common sense, as i said i have no knowledge of coding.

I know there’s already plenty of answers but just to note what happened in my case:

I created the ViewController on the storyboard first and then I created the class, I don’t know why this was an error because both class names where identical, but by rewriting the class name on the storyboard helped to «link» correctly the view controller and its file. First create file then ViewController on storyboard to prevent this error.

    The Overflow Blog
Linked
Related
Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.6.15.43499

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Swift error : signal SIGABRT how to solve it

I’m just a beginner in Swift coding. My idea is quite simple which is an app with two buttons. When clicked, a textfield will change its text. In the Main.StoryBoard, I add a textfield and two buttons. In ViewController.swift file. I write as this:

It is supposed to be all right. However, an error appears which shows:

in file AppDelegate.swift line:

What is wrong with my code?

saurabh's user avatar

14 Answers 14

You get a SIGABRT error whenever you have a disconnected outlet. Click on your view controller in the storyboard and go to connections in the side panel (the arrow symbol). See if you have an extra outlet there, a duplicate, or an extra one that’s not connected. If it’s not that then maybe you haven’t connected your outlets to your code correctly.

Just remember that SIGABRT happens when you are trying to call an outlet (button, view, textfield, etc) that isn’t there.

For me it wasn’t an outlet. I solved the problem by going to the error And reading what it said. (Also Noob..)

This was the error:

enter image description here

And The solution was here: enter image description here

Just scroll up in the output and the error will be revealed.

dangalg's user avatar

To solve the problem, first clean the project and then rebuild.

To clean the project, go to MenuBar: Product -> Clean

Then to rebuild the project, just click the Run button as usual.

Marwan Salim's user avatar

A common reason for this type of error is that you might have changed the name of your IBOutlet or IBAction you can simply check this by going to source code.

Click on the main.storyboard and then select open as and then select source code enter image description here

source code will open

and then check whether there is the name of the iboutlet or ibaction that you have changed , if there is then select the part and delete it and then again create iboutlet or ibaction. This should resolve your problem

signal sigabrt error?

I do not understand what the error is And after doing some research I still confused. What does this error mean and how do I solve it? Thank you, help appreciated.

Replies

A SIGABRT (signal abort) error means that the app was deliberately crashed due to some really bad problem, like a runtime error during the start-up sequence or a bad or unreadable user interface file. The reason you see the instruction pointer over the class declaration is that the problem is not directly related to any line of code you've written, so Xcode has nothing relevant to show you. Instead, the error is being triggered deep within the Cocoa software, meaning you probably have some sort of configuration issue in your app's info or a problem with the storyboard.

Usually, an informational message is printed in the debugger console when this error occurs. If you can retrieve that and post it here, I'll help you figure out what's wrong.

Ok thank you. Here is the error message.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IOTAlertSwift.AppDelegate reachabilityChanged]: unrecognized selector sent to instance 0x7f9231512f60'

*** First throw call stack:

0 CoreFoundation 0x000000010629be65 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x0000000105d14deb objc_exception_throw + 48

2 CoreFoundation 0x00000001062a448d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation 0x00000001061f190a ___forwarding___ + 970

4 CoreFoundation 0x00000001061f14b8 _CF_forwarding_prep_0 + 120

5 CoreFoundation 0x000000010626869c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

6 CoreFoundation 0x00000001062683db _CFXRegistrationPost + 427

7 CoreFoundation 0x0000000106268142 ___CFXNotificationPost_block_invoke + 50

8 CoreFoundation 0x00000001062ad972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986

9 CoreFoundation 0x0000000106163279 _CFXNotificationPost + 633

10 Foundation 0x00000001058a3109 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

11 IOTAlertSwift 0x00000001052612f3 ReachabilityCallback + 979

12 SystemConfiguration 0x0000000106f33c95 reachPerformAndUnlock + 255

13 CoreFoundation 0x00000001061c7a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

14 CoreFoundation 0x00000001061bd95c __CFRunLoopDoSources0 + 556

15 CoreFoundation 0x00000001061bce13 __CFRunLoopRun + 867

16 CoreFoundation 0x00000001061bc828 CFRunLoopRunSpecific + 488

17 GraphicsServices 0x000000010a099ad2 GSEventRunModal + 161

18 UIKit 0x0000000106fb8610 UIApplicationMain + 171

19 IOTAlertSwift 0x0000000105293dbd main + 109

20 libdyld.dylib 0x0000000108ba792d start + 1

libc++abi.dylib: terminating with uncaught exception of type NSException

Im guessing its because the unrecognized selector.

Yep, "unrecognized selector" is totally correct. From reading your call stack, I see that the notification mechanism is trying to call your app delegate's reachabilityChanged() function, which apparently doesn't exist. It looks to me like you made a mistake when setting up the notification observer. Since the observer function takes a notification parameter, you need to write the selector as "reachabilityChanged:" instead of "reachabilityChanged" . Once you make that change, it should all work.

By the way, you've run into one of the clumsy vestiges of traditional Cocoa. All the new safety-oriented language features in Swift are nice, but these good old APIs are still really easy to get wrong, as you've discovered. 🙂

hey bob, can i have your email address? I have a similar SIGABRT error during my tutorial. I cant post here due to ' invalid character ' which i have no idea how to get rid of it. Could you please help me on this? Appreciate it much. THANKS

Sorry, but I don't give out my email address. Do keep trying to get it to work, though. You're running into some dumb restrictions intended to keep spammers from posting their phone numbers and other contact information. It's likely complaining about the memory addresses in the call stack. Try posting just the error message and not the call stack.

Oh, and since SIGABRT errors arise for a variety of reasons, you should probably start another thread to keep the topics separate.

Let me give it a try (here's from above):

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IOTAlertSwift.AppDelegate reachabilityChanged]: unrecognized selector sent to instance 0x7f9231512f60'

*** First throw call stack:

0 CoreFoundation __exceptionPreprocess + 165

1 libobjc.A.dylib objc_exception_throw + 48

2 CoreFoundation -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation ___forwarding___ + 970

4 CoreFoundation _CF_forwarding_prep_0 + 120

5 CoreFoundation __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

6 CoreFoundation _CFXRegistrationPost + 427

7 CoreFoundation ___CFXNotificationPost_block_invoke + 50

8 CoreFoundation -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986

9 CoreFoundation _CFXNotificationPost + 633

10 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

11 IOTAlertSwift ReachabilityCallback + 979

12 SystemConfiguration reachPerformAndUnlock + 255

13 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

14 CoreFoundation __CFRunLoopDoSources0 + 556

15 CoreFoundation __CFRunLoopRun + 867

16 CoreFoundation CFRunLoopRunSpecific + 488

17 GraphicsServices GSEventRunModal + 161

18 UIKit UIApplicationMain + 171

19 IOTAlertSwift main + 109

20 libdyld.dylib start + 1

Yeah, it wouldn't let me post either with the 0x00.. pointer addresses in the call stack. Remove those and you should be just fine.

Need a bit of help as well. Got the same thread1 sigabrt error. Hope you can help! Here is my code —

Swift error : signal SIGABRT how to solve it

I’m just a beginner in Swift coding. My idea is quite simple which is an app with two buttons. When clicked, a textfield will change its text. In the Main.StoryBoard, I add a textfield and two buttons. In ViewController.swift file. I write as this:

It is supposed to be all right. However, an error appears which shows:

in file AppDelegate.swift line:

What is wrong with my code?

saurabh's user avatar

14 Answers 14

You get a SIGABRT error whenever you have a disconnected outlet. Click on your view controller in the storyboard and go to connections in the side panel (the arrow symbol). See if you have an extra outlet there, a duplicate, or an extra one that’s not connected. If it’s not that then maybe you haven’t connected your outlets to your code correctly.

Just remember that SIGABRT happens when you are trying to call an outlet (button, view, textfield, etc) that isn’t there.

For me it wasn’t an outlet. I solved the problem by going to the error And reading what it said. (Also Noob..)

This was the error:

enter image description here

And The solution was here: enter image description here

Just scroll up in the output and the error will be revealed.

dangalg's user avatar

To solve the problem, first clean the project and then rebuild.

To clean the project, go to MenuBar: Product -> Clean

Then to rebuild the project, just click the Run button as usual.

Marwan Salim's user avatar

A common reason for this type of error is that you might have changed the name of your IBOutlet or IBAction you can simply check this by going to source code.

Click on the main.storyboard and then select open as and then select source code enter image description here

source code will open

and then check whether there is the name of the iboutlet or ibaction that you have changed , if there is then select the part and delete it and then again create iboutlet or ibaction. This should resolve your problem

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *