Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 仅在执行产品时出错-->;带有语义问题的归档_Ios_Objective C_Xcode4_Archiving - Fatal编程技术网

Ios 仅在执行产品时出错-->;带有语义问题的归档

Ios 仅在执行产品时出错-->;带有语义问题的归档,ios,objective-c,xcode4,archiving,Ios,Objective C,Xcode4,Archiving,如果我把它编译成设备或模拟器,它工作得很好。但当我进行产品-->归档时,会出现以下错误: Login.m ! Semantic Issue Use of undeclared identifier 'kLogin_URL' 但这在模拟器和设备上是可行的 我使用的是Xcode版本4.6(4H127)。这是常量文件 #ifndef MyMobileApp_AllUrls_h #define MyMobileApp_AllUrls_h #ifdef QA #de

如果我把它编译成设备或模拟器,它工作得很好。但当我进行产品-->归档时,会出现以下错误:

Login.m
! Semantic Issue
  Use of undeclared identifier 'kLogin_URL'
但这在模拟器和设备上是可行的

我使用的是Xcode版本4.6(4H127)。这是常量文件

#ifndef MyMobileApp_AllUrls_h
    #define MyMobileApp_AllUrls_h

    #ifdef QA
        #define kLogin_URL              @"https://b2bgateway.qa.mycompany.com/authenticate"
        #define ktran_URL               @"https://b2bgateway.qa.mycompany.com/.../lookup"

        #define LOGIN_REQUEST_TIMEOUT   15.0f
        #define TRAN_REQ_TIMEOUT        60.0f
    #endif

    #ifdef PROD
        #define kLogin_URL              @"https://b2bgateway.mycompany.com/authenticate"
        #define ktran_URL               @"https://b2bgateway.mycompany.com/.../lookup"

        #define LOGIN_REQUEST_TIMEOUT   15.0f
        #define TRAN_REQ_TIMEOUT        30.0f
    #endif
#endif
-prefix.pch的内容为

#import <Availability.h>

#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import "AllUrls.h"
#endif
#导入
#ifndef\uuu IPHONE\u5\u0
#警告“此项目使用仅在iOS SDK 5.0及更高版本中可用的功能。”
#恩迪夫
#ifdef__OBJC__
#进口
#进口
#导入“AllUrls.h”
#恩迪夫
感谢您的投入


谢谢

请确保您的生成设置预处理器宏在发布配置下包含
PROD

根据你的评论,我只是想确定这就是你所做的

#ifdef QA
    #define kLogin_URL              @"https://b2bgateway.qa.mycompany.com/authenticate"
    #define ktran_URL               @"https://b2bgateway.qa.mycompany.com/.../lookup"

    #define LOGIN_REQUEST_TIMEOUT   15.0f
    #define TRAN_REQ_TIMEOUT        60.0f
#else
    #define kLogin_URL              @"https://b2bgateway.mycompany.com/authenticate"
    #define ktran_URL               @"https://b2bgateway.mycompany.com/.../lookup"

    #define LOGIN_REQUEST_TIMEOUT   15.0f
    #define TRAN_REQ_TIMEOUT        30.0f
#endif

我假设您已经仔细检查了生成配置,以确保正确定义了PROD?我的生成设置预处理器宏当前设置为QA=1 DEBUG=1。好的,我应该同时拥有QA和prodYep,
QA
与发布部分中的
DEBUG
PROD
位于同一位置。或者您可以取消
PROD
并将
#ifdef
更改为
#否则
您是对的。我到了别处,错误消失了。在我接受答案之前,还有一个问题。如果我保持原样,发布区在哪里。我在我的答案中添加了一些代码,以确保我们在同一页上。