代码之家  ›  专栏  ›  技术社区  ›  TheLearner

如何对整个应用程序识别的一条导入语句进行编码

  •  4
  • TheLearner  · 技术社区  · 14 年前

    我记得在某个地方读过,但我记不清我需要在哪里写导入语句,这样整个应用程序就可以访问它。我有一个AppHelper类,我希望整个应用程序都能看到,而不必在每个类文件中导入它。

    因此,我尝试将其添加到.pch文件中,但收到以下错误消息:

    “_kgtmhttpfetcherstatusDomain”,引用自:_kgtmhttpfetcherstatusDomain$non_lazy_ptr in gtmhtpfetcher.o(也许您的意思是:_kgtmhttpfetcherstatusDomain$non_lazy_ptr)”中的“_kgtmhttpfetcherrydelaystartednotification”,引用自:_kgtmhttpfetcherrydelaystartednotification$non_lazy_ptr in”gtmhttpfetcher.o(也许你的意思是:_kgtmhttpfetcherrydelaystartednotification$non_lazy_ptr)

    这是我的.pcb文件:

    //
    // Prefix header for all source files of the 'SplitView' target in the 'SplitView' project
    //
    #import <Availability.h>
    
    
    #ifndef __IPHONE_3_2
    #warning "This project uses features only available in iPhone SDK 3.2 and later."
    #endif
    
    
    #ifdef __OBJC__
        #import <Foundation/Foundation.h>
        #import <UIKit/UIKit.h>
    
    #endif
    
    #import "AppCache.h"
    
    1 回复  |  直到 14 年前
        1
  •  4
  •   Vladimir    14 年前

    您可以将该导入添加到应用程序预编译头(例如yourapapplication.pch)