在和iOS Today Extension中导入不起作用



我正在尝试将一些库导入到today扩展中(在主应用程序中运行良好)。当我运行应用程序时,我会收到错误:

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"

有什么建议吗?

如果你使用pods并导入一些库,你可以像这样编辑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

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

最新更新