Линкер не может найти _objc_msgSend и многие другие символы - PullRequest
6 голосов
/ 02 декабря 2011

Итак, у меня две проблемы с Xcode.Я новичок в разработке приложений для iPhone, так что любая помощь будет полезна.Я создаю приложение с mapView, поэтому сначала я сделал все, как должно быть.Декларация, просмотр, загрузка, делегаты и так далее.После этого я подключил это свойство к представлению карты, и оказалось 28 ошибок .. На симуляторе он работает, в том числе и на карте, но на телефоне он всегда ломается.И после этого я удалил весь код для представления карты, он остался прежним.

Некоторые идеи, что бы это могло быть?как сделать вид карты для iPhone?

"_OBJC_CLASS_$_NSBundle", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_NSFileManager", referenced from:
      objc-class-ref in AppDelegate.o
  "_objc_msgSendSuper2", referenced from:
      -[AppDelegate dealloc] in AppDelegate.o
      -[MainViewController didReceiveMemoryWarning] in MainViewController.o
      -[MainViewController viewDidLoad] in MainViewController.o
      -[MainViewController viewDidUnload] in MainViewController.o
      -[MainViewController viewWillAppear:] in MainViewController.o
      -[MainViewController viewDidAppear:] in MainViewController.o
      -[MainViewController viewWillDisappear:] in MainViewController.o
      ...
  "_objc_setProperty", referenced from:
      -[AppDelegate setWindow:] in AppDelegate.o
      -[MainViewController setManagedObjectContext:] in MainViewController.o
      -[MainViewController setOdaberiTaxi:] in MainViewController.o
      -[MainViewController setIzbornik:] in MainViewController.o
      -[MainViewController setTaxiPicker:] in MainViewController.o
      -[MainViewController setListaTaxiZG:] in MainViewController.o
      -[MainViewController setToolbar:] in MainViewController.o
      ...
  "__objc_empty_vtable", referenced from:
      _OBJC_CLASS_$_AppDelegate in AppDelegate.o
      _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
      _OBJC_CLASS_$_FlipsideViewController in FlipsideViewController.o
      _OBJC_METACLASS_$_FlipsideViewController in FlipsideViewController.o
  "_OBJC_CLASS_$_UIResponder", referenced from:
      _OBJC_CLASS_$_AppDelegate in AppDelegate.o
  "_objc_msgSend", referenced from:
      _main in main.o
      -[AppDelegate dealloc] in AppDelegate.o
      -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
      -[AppDelegate applicationWillTerminate:] in AppDelegate.o
      -[AppDelegate saveContext] in AppDelegate.o
      -[AppDelegate managedObjectContext] in AppDelegate.o
      -[AppDelegate managedObjectModel] in AppDelegate.o
      ...
  "_OBJC_CLASS_$_UIActionSheet", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_CLASS_$_UIViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      _OBJC_CLASS_$_FlipsideViewController in FlipsideViewController.o
  "_objc_autoreleasePoolPop", referenced from:
      _main in main.o
  "__objc_empty_cache", referenced from:
      _OBJC_CLASS_$_AppDelegate in AppDelegate.o
      _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
      _OBJC_CLASS_$_FlipsideViewController in FlipsideViewController.o
      _OBJC_METACLASS_$_FlipsideViewController in FlipsideViewController.o
  "_UIApplicationMain", referenced from:
      _main in main.o
  "_OBJC_METACLASS_$_UIResponder", referenced from:
      _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
  "_OBJC_CLASS_$_UIView", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_CLASS_$_UIApplication", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_CLASS_$_NSArray", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
      objc-class-ref in AppDelegate.o
  "___CFConstantStringClassReference", referenced from:
      CFString in AppDelegate.o
      CFString in AppDelegate.o
      CFString in AppDelegate.o
      CFString in AppDelegate.o
      CFString in MainViewController.o
      CFString in MainViewController.o
      CFString in MainViewController.o
      ...
  "_OBJC_CLASS_$_UIAlertView", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_METACLASS_$_UIViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
      _OBJC_METACLASS_$_FlipsideViewController in FlipsideViewController.o
  "_NSSQLiteStoreType", referenced from:
      -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  "_objc_autoreleasePoolPush", referenced from:
      _main in main.o
  "_NSStringFromClass", referenced from:
      _main in main.o
  "_NSLog", referenced from:
      -[AppDelegate saveContext] in AppDelegate.o
      -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  "_OBJC_CLASS_$_NSManagedObjectModel", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_NSURL", referenced from:
      objc-class-ref in MainViewController.o
  "_OBJC_METACLASS_$_NSObject", referenced from:
      _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
      _OBJC_METACLASS_$_FlipsideViewController in FlipsideViewController.o
  "_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ответы [ 2 ]

39 голосов
/ 06 июня 2012

У меня была похожая ошибка, и это решило мою проблему: Нажмите «ЦЕЛИ»> Фазы сборки> Связать двоичные файлы с библиотеками> Нажмите «+»> CoreData.framework.> Добавить.

0 голосов
/ 02 декабря 2011

Вам не хватает таких символов, как __objc_msgSend, которые являются фундаментальными частями среды выполнения Objective-C.Эти символы находятся в libobjc.dylib, с которым Xcode должен связываться автоматически для любого проекта Objective-C.Кроме того, вам не хватает символов из основы Foundation (например, _OBJC_CLASS_$_NSBundle) и UIKit (например, _OBJC_CLASS_$_UIView).Эти структуры автоматически включаются, когда вы создаете новый проект Objective C в XCode.

Тот факт, что вы получаете эти ошибки, указывает на то, что ваш проект серьезно испорчен.Хотя эксперт, возможно, сможет решить вашу проблему, у вас, вероятно, нет эксперта.

Поэтому самое простое решение для вас - просто создать новый проект в Xcode и скопировать исходные файлы поверх него.в новый проект.И в новом проекте будьте осторожны, чтобы не изменять и не удалять настройки сборки, если вы не понимаете, для чего они нужны.Легко случайно изменить настройку сборки, даже не осознавая этого, и начать получать непостижимые сообщения об ошибках.

Если это не решит вашу проблему, то возможно, что ваша установка Xcode повреждена, и вывозможно, придется переустановить Xcode.

...