SIGABRT Error in Ch 5


#1

I keep getting a SIGABRT error (page 158 on my nook app "Interface Properties in large bold text)

Error Text Below

More Details on Problem:
If I remove all object from the view in the xib file (and the connections they had), but have the outlets made in the ViewController.h and Run I get the SIGABRT
I have gone through all the steps until the next time the book says to build and run and that is when I first got the error.
I removed all the code added since the start of Ch 5 and worked forward running each step and found that is where I get the error.
I have quadruple checked and cant find anything wrong with my code. I am using the latest version of xcode for iOS 5.1

Error Text:
2012-04-14 19:24:18.610 WhereAmI[2692:f803] *** Terminating app due to uncaught exception ‘NSInvalidUnarchiveOperationException’, reason: ‘Could not instantiate class named MKMapView’
*** First throw call stack:
(0x14b6022 0x12d6cd6 0x145ea48 0x145e9b9 0x3be4a3 0x3be383 0x2bec76 0x3bec6e 0x3be67b 0x3be383 0x2be105 0x1641fc 0x164779 0x16499b 0xc3401 0xc3670 0xc3836 0xd0a1dd8 0xca72a 0x28a5 0x9b386 0x9c274 0xab183 0xabc38 0x9f634 0x12b9ef5 0x148a195 0x13eeff2 0x13ed8da 0x13ecd84 0x13ecc9b 0x9bc65 0x9d626 0x25dd 0x2545)
terminate called throwing an exception

UPDATE:
This morning I took the WhereAmI project code from the end of ch 4 and went through the few steps taken before the first build in ch5 where i ran into the error earlier. Same Exact Problem, so it cant be any code from ch 4 missing, and it is so little code added before that first build that I am baffled and have no idea what the issue is, I have tried running it on both iOS 5 and 5.1 versions of XCode/iOS Sim

But the final project from the end of ch5 provided by BNR does run correctly.

Ay suggestions would really be appreciated this is strange and pretty frustrating since there shouldnt be a problem


#2

Another Update on the problem:

I have further narrowed down the cause to exactly what breaks the program.

I have all code in place, as well as the UITextField and the UIActivityIndicatorView

At this point everything works fine.

BUT the second I add the MKMapView with or without IBOutlet and Delegate connected I get the SIGABRT

As far as I can tell there is no reason this error should even be popping up since all I did was add the MKMapView to the xib file


#3

Hi there,

I had the same problem; it turns out that I had forgotten to add the MapKit framework to my project. Give that a shot and see if it resolves your issue.


#4

[quote=“vitaminh”]Hi there,

I had the same problem; it turns out that I had forgotten to add the MapKit framework to my project. Give that a shot and see if it resolves your issue.[/quote]

If you are talking about #import <MapKit/MapKit.h> in the viewcontroller.h I have that.

If I was supposed to add the MapKit framework to the main or something else and missed that, let me know


#5

[quote=“infinityends”]
If you are talking about #import <MapKit/MapKit.h> in the viewcontroller.h I have that.

If I was supposed to add the MapKit framework to the main or something else and missed that, let me know[/quote]

No, it’s not an import issue; check out the “Projects, Targets, and Frameworks” section of Chapter 4 (specifically, figure 4.3 solved my problem) for a better explanation of what I mean.


#6

[quote=“vitaminh”][quote=“infinityends”]
If you are talking about #import <MapKit/MapKit.h> in the viewcontroller.h I have that.

If I was supposed to add the MapKit framework to the main or something else and missed that, let me know[/quote]

No, it’s not an import issue; check out the “Projects, Targets, and Frameworks” section of Chapter 4 (specifically, figure 4.3 solved my problem) for a better explanation of what I mean.[/quote]

THIS WAS THE SOLUTION

Thanks for your help.


#7

No problem. Glad it worked for you! :slight_smile:


#8

I think that I was having the same problem, namely I needed to add the MK Framework to my project, but why wouldn’t there be a link error in that case?


#9

I was wondering this too, it seems like it should be an easy error to detect and point out instead of the SIGABRT which really is useless for finding the problem


#10

It’s not a linker error because your code didn’t actually link to the MapKit library. Instead, at runtime when the XIB is loaded, the XIB loading class noticed the MKMapView object in the XIB file. At this point, the XIB loading class only sees a string “MKMapView.” Then it goes on to try and find a class with this name and create an instance of that class… this is where it fails, because there is no MKMapView class available.


#11

So why can’t Apple make a more concise error for this type of problem? If it looks for a class and cant find it, it should report that, not give a generic error.


#12

I was getting the same error. Where in the book did it mention to add the MapKit framework?

Edit
; Ok I wasn’t looking that hard. it was right before it said to add #import <MapKit/MapKit.h>


#13

It has been a while I believe it was towards the beginning of the chapter, or section, it is a little glossed over in the book in my opinion. What matters more is that it resolved the issue. I know my reply wasn’t a ton of help. Let me know if you have trouble finding it and I can try and track down the page. There is another example of importing a framework in an earlier chapter (forget which).

But the error is essentially being thrown because you are trying to reference a framework that hasn’t been imported into the project. Hope that helps.


#14

I had same problem, finally made MKmapView work adding the MapKit.framework to the project itself:

Whereami>targets ->building Phase ->link binary with library
-> click on + sign ->select mapKit.framework ->click add

Now I run and the interface shows the map with no issues.