摘要: 全局变量历来就是很好的东西,能够在开发中带来很多方便,下面来介绍一下iPhone中软件开发时全局变量的使用方法:1.使用extern关键字在AppDelegate.m或AppDelegate.h中写入你需要的全局变量名,例如:int name;NSString *url;注意定义全局变量时候不能初始化,否则报错。#import @class ViewController;int name ;NSString *url;@interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window;@prop 阅读全文
posted @ 2013-01-16 10:46 superchao 阅读(249) 评论(0) 推荐(0) 编辑