Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I find out what object is "instance 0xfc78f70"

At the point of, or after an exception, the debugger tells me there is a problem, such as:


-[__NSCFArray length]: unrecognized selector sent to instance 0xfc78f70

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray length]: unrecognized selector sent to instance 0xfc78f70'


Given that this might be an NSArray, I've put code *Everywhere* all around my NSArray items such as....

element = [m_UserDetail objectForKey:@"education"];

if ( [element isKindOfClass:[NSString class]] ) {

if ( [element length] || [element1 length] )

return 20.0f;

else

return 0.0f;

}

else if ( [element isKindOfClass:[NSArray class]] ) {

if ( [element count] )

return 20.0f;

else

return 0.0f;

}


And I still get the error.


Analyse tells me there are no memory leaks, so I am expecting that no objects are going out of scope, as fixing things for Analyse has usually resolved problems like that in the past.


How do I determine what object, or what module this is in. BT tells me nothing useful:

*** First throw call stack:

(0x32a818bf 0x368eb1e5 0x32a84acb 0x32a83945 0x329de680 0x3148cadd 0x42309 0x5686b 0x37c0c50f 0x32a4d577 0x329d90cf 0x37b803fb 0x16ebb 0x3ad79 0x37c43c39 0x37b9b6e9 0x37b9b6b3 0x37b9b5d5 0x33ab6901 0x33aab5a1 0x33aab695 0x33aab29f 0x33aab1d5 0x32a55b03 0x32a552cf 0x32a54075 0x329d74dd 0x329d73a5 0x38118fed 0x31322743 0x13055 0x13014)

terminate called throwing an exception(lldb) bt

* thread #1: tid = 0x1c03, 0x32c7e32c libsystem_kernel.dylib`__pthread_kill + 8, stop reason = signal SIGABRT

frame #0: 0x32c7e32c libsystem_kernel.dylib`__pthread_kill + 8

frame #1: 0x36feaf5a libsystem_c.dylib`pthread_kill + 54

frame #2: 0x36fe3fea libsystem_c.dylib`abort + 94

frame #3: 0x37f47f6a libc++abi.dylib`abort_message + 46

frame #4: 0x37f4534c libc++abi.dylib`_ZL17default_terminatev + 24

frame #5: 0x368eb2e2 libobjc.A.dylib`_objc_terminate + 146

frame #6: 0x37f453c4 libc++abi.dylib`_ZL19safe_handler_callerPFvvE + 76

frame #7: 0x37f45450 libc++abi.dylib`std::terminate() + 20

frame #8: 0x37f46824 libc++abi.dylib`__cxa_rethrow + 88

frame #9: 0x368eb234 libobjc.A.dylib`objc_exception_rethrow + 12

frame #10: 0x329d7544 CoreFoundation`CFRunLoopRunSpecific + 404

frame #11: 0x329d73a4 CoreFoundation`CFRunLoopRunInMode + 104

frame #12: 0x38118fec GraphicsServices`GSEventRunModal + 156

frame #13: 0x31322742 UIKit`UIApplicationMain + 1090

frame #14: 0x00013054 Iris3D`main + 60 at main.m:13

(lldb)


This reason, "'-[__NSCFArray length]: unrecognized selector sent to instance " in other web postings at stack-overflow suggest checking NSLog statements, and I've also done that as well.


I've checked every "length" statement in my program (126) occurrances, and every NSLog statement (110) occurrances, making sure they all begin with a string format, @" .." and everything looks good.


====

Background

=========

I'm merging information from 3 individual tab-bar tableViewControllers into a single tab-bar item with a single TVC using 3 sections, and everything LOOKS clean, but when I introduce the module with the merged tab, to the tab-bar, I get this error, even when I select a tab that was previously working and then select a table element in the WORKING module, I get the crash.


It is a fairly complicated app, and I go through the same routines multiple times where everything works, and then "Nth" time through the same code, it crashes. If I can identify what object is getting the erroneous message, I can probably figure out where to add additional checks to the data to make sure I really have an adday, dictionary or string element.


Thanks!

Posted on Jun 25, 2012 5:14 PM

Reply
Question marked as Best reply

Posted on Jun 25, 2012 5:27 PM

Use the '+' at the bottom left of the Breakpoint Navigator to add an Exception breakpoint. This should stop your program in the debugger when the error happens.


User uploaded file

2 replies

Jun 26, 2012 12:36 AM in response to xnav

Thanks xnav!

That will certainly help. As soon as I get to test it, I'll confirm if it solves the problem.


While I was waiting, I found another section where I checked for an NSArray, but only if the routine to populate the data arrays was one of two display types. Apparently, even though I'm calling it with the same display types, one of them must have been missing the check. Updating that seems to have fixed the issue.


Now, I just have to find out where my data went ;-)

How do I find out what object is "instance 0xfc78f70"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.