导入和iOS今天扩展无法正常工作

时间:2014-10-29 20:00:11

标签: ios objective-c import ios8-today-widget

我正在尝试将一些库导入到今天的扩展中(在主应用程序中正常工作)。当我运行应用程序时,我收到错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Budget", referenced from:
      objc-class-ref in TodayViewController.o
  "_OBJC_CLASS_$_JBBarChartView", referenced from:
      objc-class-ref in TodayViewController.o
  "_OBJC_CLASS_$_Users", referenced from:
      objc-class-ref in TodayViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

以下是导入:

#import "JBBarChartView.h"
#import "JBChartView.h"
#import "Users.h"
#import "Budget.h"

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

如果您使用pod并导入一些库,则可以像这样编辑Podfile:

target 'MyApp' do
  pod 'GoogleAnalytics', '~> 3.1'

  # Has its own copy of OCMock
  # and has access to GoogleAnalytics via the app
  # that hosts the today target

  target 'MyAppToday' do
    inherit! :search_paths
    pod 'OCMock', '~> 2.0.1'
  end
end

如果您想使用自己的类,请单击此文件并检查目标成员资格。您还可以将这些文件打包为框架。