Assertion Failed in Objective-C

I get the error message "Assertion failed: (cls), function getName, file / SourceCache / objc4_Sim / objc4-427.1.1 / runtime / objc-runtime-new.m, line 3939." whenever i run the following code.

NSLog(@"Hello: %@\n", [NSMutableString stringWithString:@"Whatever"]); 

It also gets about a thousand errors above when I run this:

 NSMutableString* urlCopy = [[NSMutableString alloc] initWithString:url]; 

and mouse over the urlCopy variable in the debugger. Is this my version of Xcode? What the hell is going on? I am running 3.2.4 64 bit. I have a complete loss to explain this, and I cannot create a single String type without this problem. I wrote programs where this is the only line in the program, and it still creates this error. Please, help!

+4
source share
2 answers

I also use 3.2.4 64-bit code, and your code (calling NSLog) works fine for me. If this happens with every project, it looks like there should be something wrong with your environment. Have you tried reinstalling Xcode?

+2
source

This function:

 /*********************************************************************** * getName * fixme * Locking: runtimeLock must be held by the caller **********************************************************************/ static const char * getName(struct class_t *cls) { // fixme hack rwlock_assert_writing(&runtimeLock); assert(cls); if (isRealized(cls)) { return cls->data->ro->name; } else { return ((const struct class_ro_t *)cls->data)->name; } } 

... if someone can make something out of this :)

0
source

All Articles