Xcode 7 finding the cause of SIGABRT - swift2

I am using Xcode 7 beta 5 and creating a multiview application. One view has a button that brings you to a second view, but when this button is pressed it crashes with Thread 1: Signal SIGABRT.
I have checked all the connections of things inside the target view, and everything appears to be ok (I also went through and redid them to be sure). I have tried adding an exception breakpoints which stopped for something, but I am unsure how to find the faulty line.
I have also tried adding breakpoints manually, and have found the following:
#IBOutlet weak var wakeTimeLabel: UILabel!
#IBAction func snoozeButton(sender: AnyObject) {
snooze()
}
If I put the breakpoint on the first line there (after all the other outlets), it catches, but when I put it on the function line it throws the SIGABRT. If I remove these two lines completely, the SIGABRT still occurs.
The console contains the following:
* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key whiteSwipe.'
* First throw call stack:
(0x182a2da94 0x197387f80 0x182a2d754 0x1838a3694 0x18829b378 0x1883dd874 0x1829575ac 0x1883dc25c 0x188602fd8 0x1886077c4 0x188607a38 0x188607c94 0x187f755bc 0x187f75538 0x187f5dfa0 0x187f74e50 0x187f74a80 0x187f6dcf0 0x187f3eea4 0x187f3d520 0x1829e50dc 0x1829e4b70 0x1829e2870 0x1829118a0 0x18d96c088 0x187fa60d4 0x1000b4be0 0x197bd68b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Even though you said you redid your connections, Sigabrt is what I recall to be a exception thrown by faulty connections. In particular, your error message is the one that comes out when you change a connection's signature after you've connected it.
For instance, I just got a very similar message after deleting 1 character off an #IBOutlet declaration:
FeedViewCollectionCell 0x7feab0c583b0> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key nameLabel.
I suggest you reconnect your outlets again. Make sure you don't have 2 of the same connections on an item, and make sure you don't change the signature after setting the outlet.

Related

Exception in code from Xcode duplicated target

Got a bit of a quandary which attaches to the following code
var returnCell = PlanetDataCell()
if let dequeuedCell = collectionView.dequeueReusableCell(withReuseIdentifier: "PlanetDataCell", for: indexPath) as? PlanetDataCell {
returnCell = dequeuedCell
}
I have a project/target this works in. I duplicated the target and in the duplicate target this throws an exception. While there is now code change between the two targets around LaunchScreen and Main. This code is buried fairly deeply and has not been touched at all between the two versions.
[<UICollectionViewCell 0x7fab4637c370> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key moreInfoButton.
The PlanetDataCell is defined in storyboard not in a separate xib or by code. As pictured below.
I've tried cleaning the build folder (on both targets) disconnecting the action for the button that connects to moreInfoButton: and reconnecting it. I have also blown away DerivedData and that changed nothing.
It turns out that the module was being automatically assigned to the original target. I had to trigger a rarely used setting (for me) in IB where the Module is inherited from the target. Pictured below.

Application crash on ios6 but working fine in ios5

I have an application for audio/video call using SIP protocol.It working fine when i tried to make a call with ios5 device or used it on ios 5 device but it crash when i tried to call or use it on ios 6. It crash on only when i tried to make a video call with ios6 device to ios5 device. Crash message
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [2.74665e-34 nan]'
Check this answer link
Probably you are calculating the value of some frame and it is a NaN (not a number).
For SIP calls the best is iDoubs, a very easy API
It's hard to know what's wrong without more code, but here are my two cents: If you have a view (something like a UIWebView) in your code, and you are using the plain init method to initialize it, try changing it to initWithFrame to give it a frame right away. The problem might be that you are trying to use the element before a frame is allocated to it, thus resulting in a CALayerInvalidGeometry error.
After analyzing my crash report and my code
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 96]'
I found the bug. I am using a method which is override from another class but somehow it's not working in iOS 6 and that's why it return some zero value because of this zero value it returns nan value and it crashed.

My program crashes due to SIGABRT?

2012-05-31 00:17:51.384 SAMPLEGAME[2901:10703] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SAMPLEGAMEViewController 0x752c140> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key girlHeadView.'
*** First throw call stack:
(0x1460022 0x1a7dcd6 0x145fee1 0xe47022 0xdb8f6b 0xdb8edb 0xdd3d50 0x6bb71a 0x1461dea 0x13cb7f1 0x6ba26e 0x5601fc 0x560779 0x56099b 0x4bf401 0x4bf670 0x4bf836 0x4c672a 0x497596 0x498274 0x4a7183 0x4a7c38 0x49b634 0x3aa1ef5 0x1434195 0x1398ff2 0x13978da 0x1396d84 0x1396c9b 0x497c65 0x499626 0x21fd 0x2165)
terminate called throwing an exception(lldb)
Hi everyone,
I am new to iOS programming and am lost on something.
I renamed my original UIIMAGEVIEW from "yelOrb"... which was inefficient for the real object in the end replacing a yellow orb. So I renamed it to "girlHeadView". (Mind you, this is what I named the UIImageView that you control with arrow keys.)
Now whenever I run the program I get a stink in' SIGABRT telling me this [in the code above].
I even renamed "girlHeadView" back to "yelOrb".
I went through my .h & .m file, no stray word or incorrect spelling is causing this.
How am I able to fix this? I just implemented a button function to change the UIImageView (I even commented it all out to see if that caused it- still SIGABRT issue) and I can't even run the simulator.
Thank you!
Edit: Found my problem, I had to remove and re-add the yelOrb's image on the storyboard. Odd, but it worked. :)
It sounds like there's an outlet in interface builder connecting the UIImageView to the old property name, yelOrb. Then, when the view controller's view loads, it tries to make that connection to yelOrb which no longer exists, so you get that error.

CGContextSetCompositeOperation error for some users when drawing NSWindow

A simple 10.6 Cocoa app I wrote that basically draws a regular window with some buttons and text has been spewing hundreds of console log messages:
<Error>: CGContextSetCompositeOperation: invalid context 0x0
I do not directly call drawRect: and always use setNeedsDisplay:YES when I need to refresh.
Interestingly, this error does not happen on all machines, I'd say about 50% get the error. However, the program works fine in either case!
Anyone got any clue as to what this error means, where it's stemming from, and more importantly, how can I suppress/get rid of it?
Thanks
Try setting a breakpoint on CGPostError. If you can break on the logging, you can hopefully figure out what's going on.
You shouldn't be looking to just suppress it. It means context creation is failing (thus NULL gets passed for some context parameter), and that's not good.

Cocoa NSOutlineView bug - [NSCFTimer copyWithZone:]: unrecognized selector sent to instance

I'm using an NSOutlineView with the function
- (BOOL)outlineView:(NSOutlineView *)outlineView
isGroupItem:(id)item
defined so it gives the group row GUI look. When I add a root item, it works fine. When I add an item to root's child array and expand it, it works fine. If I contract the item though, the following error is logged:
[NSCFTimer copyWithZone:]: unrecognized selector sent to instance
I also get an EXC_BAD_ACCESS error if the app window is deactivated by switching to another app. I used the debugger to try to find where I might have made an error in one of my functions, but the stack trace only shows functions I did not create (RunCurrentEventLoopInMode, CFRunLoopRunSpecific, handleWindowNeedsDisplay, etc.) Does anyone have any idea where my error(s) might be?
Sounds like an object is dying prematurely. You get the “unrecognized selector sent to instance” exception when a new object is allocated later with the same pointer and then something tries to send the old object a message (in the example shown, the reincarnation is an NSTimer and the message something tried to send the previous object was copyWithZone:). You get an EXC_BAD_ACCESS crash when the object is simply garbage memory.
Debug this by running your app under Instruments with the Zombies instrument enabled. The object will, instead of dying, become a zombie object. When something tries to send a zombie a message, the zombie will moan (figuratively speaking), which will show up in Instruments's timeline as a flag. You can click a button in that flag to view the history of the object, including all of its retentions and releases.

Resources