Runtime errors with Xcode 4 & iOS 4.3


#1

I originally wrote the code for Whereami in Xcode 3, but decided to get a dev license and got Xcode 4 with it. After this it no longer runs properly in the simulator or on my iPhone.

Frequently I get errors where something is sending a ‘length’ message to a class in program, but it’s not consistent which, usually it’s MapPoint but other times it’s been various UI* elements or NSMethodSignature and sometimes just a hex number (this one comes over as +[length] instead of -[ClassName length]).

These usually result in a unhandled exception.

The failed class method causes a SIGABRT and sometimes it just dies with an EXC_BAD_ACCESS.

Did I do something wrong transitioning to Xcode 4?

Here’s a couple of examples of the errors:

2011-05-04 17:03:42.318 Whereami[2990:707] -[NSMethodSignature length]: unrecognized selector sent to instance 0x1ed80850 2011-05-04 17:03:42.333 Whereami[2990:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSMethodSignature length]: unrecognized selector sent to instance 0x1ed80850' *** Call stack at first throw: ( 0 CoreFoundation 0x3092d64f __exceptionPreprocess + 114 1 libobjc.A.dylib 0x3408ec5d objc_exception_throw + 24 2 CoreFoundation 0x309311bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102 3 CoreFoundation 0x30930649 ___forwarding___ + 508 4 CoreFoundation 0x308a7180 _CF_forwarding_prep_0 + 48 5 MapKit 0x309b0029 -[MKAnnotationContainerView _addViewForAnnotation:] + 424 6 MapKit 0x309afde1 -[MKAnnotationContainerView _addViewsForAnnotations:animated:] + 208 7 MapKit 0x309a3f8b -[MKAnnotationContainerView _displayAnnotationsInMapRect:includePending:animated:removeOffscreenAnnotations:] + 642 8 MapKit 0x309afccb -[MKAnnotationContainerView showAddedAnnotationsAnimated:] + 110 9 MapKit 0x309afbfb -[MKMapView _showAddedAnnotationsAndRouteAnimated:] + 54 10 MapKit 0x3099a891 -[MKMapView mapTileViewDidFinishRendering:] + 36 11 MapKit 0x30a10393 __-[MKMapTileView _didFinishRendering]_block_invoke_2 + 74 12 libdispatch.dylib 0x342788e7 _dispatch_call_block_and_release + 10 13 libdispatch.dylib 0x342741f5 _dispatch_main_queue_callback_4CF$VARIANT$up + 312 14 CoreFoundation 0x3090793b __CFRunLoopRun + 1334 15 CoreFoundation 0x30897ec3 CFRunLoopRunSpecific + 230 16 CoreFoundation 0x30897dcb CFRunLoopRunInMode + 58 17 GraphicsServices 0x35ad941f GSEventRunModal + 114 18 GraphicsServices 0x35ad94cb GSEventRun + 62 19 UIKit 0x35e2fd69 -[UIApplication _run] + 404 20 UIKit 0x35e2d807 UIApplicationMain + 670 21 Whereami 0x0008a65d main + 92 22 Whereami 0x0008a5fc start + 40 ) terminate called after throwing an instance of 'NSException'
and [code]2011-05-04 17:17:26.587 Whereami[3004:707] annotation views called
(gdb) c
Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x6c69576e
0x3408cc9a in ?? ()
[/code]


#2

Managed to get it to work by simply starting over with the whole “Whereami” project. Accomplished everything but changing the name of the product.