在iPhone/iPad工程中设置常量

来源:互联网 发布:淘宝中老年女装夏装 编辑:程序博客网 时间:2024/04/27 01:08

 

以下方式设置的常量,在工程中import constant.h后,可直接使用

 

//  constant.h

//  Created by  vincentlh on 10-12-21.

//  Copyright [lhanlyliang@gmail.com].

 

#import <Foundation/Foundation.h>

 

//端口URL

extern NSString *const URLSTRING;

//RC4 key

extern NSString *const KEY;

@interface constant : NSObject {}

@end

 

 

//  constant.m

//  Created by  vincentlh on 10-12-21.

//  Copyright [lhanlyliang@gmail.com].

#import "constant.h"

@implementation constant

 

NSString *const URLSTRING = @"http://localhost:8080/wx/serviceservlet";

NSString *const KEY = @"abcde";

@end

 

原创粉丝点击