views:

167

answers:

2

In a Cocoa-Touch iPhone app, I get this error if I add a class named List to my Xcode project:

objc[25878]: Class List is implemented in both /usr/lib/libobjc.A.dylib and /Users/steve/Library/Application Support/iPhone Simulator/User/Applications/4883BE28-51DA-493C-9D8A-28FD026708F4/Duplicate Classes Test.app/Duplicate Classes Test. One of the two will be used. Which one is undefined.

I haven't even used the List class yet—I've just added it to the project.

The error disappears if the class is renamed. Any idea what might be causing this error? Does Apple have its own List class somewhere?

+4  A: 

It seems that it is the case that Apple has its own List class:

reykjavik:/Users/nall% nm  /usr/lib/libobjc.A.dylib | grep List
00015571 t +[List initialize]
0001552c t +[List newCount:]
000154fc t +[List new]
0001544f t -[List addObject:]
000153f8 t -[List addObjectIfAbsent:]
00015255 t -[List appendList:]
0001510a t -[List capacity]
000155f6 t -[List copyFromZone:]
00015115 t -[List count]
000151bc t -[List empty]
00015485 t -[List freeObjects]
000155aa t -[List free]
...
nall
Ah, I see. Thanks!
Steve Harrison
+4  A: 

List is one of the classes that goes back to the origins of Objective-C. It's a subclass of Object. We don't use it anymore, but it's still there so that legacy code doesn't break.

NSResponder