码迷,mamicode.com
首页 > 其他好文 > 详细

同种类型不同名字的变量在for循环中操作

时间:2015-10-21 09:19:37      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

InfoViewController * info = [[InfoViewController alloc] init];

HeroViewController * hero = [[HeroViewController alloc] init];

MeViewController * me = [[MeViewController alloc] init];

FindViewController * find = [[FindViewController alloc] init];

NSMutableArray * viewArr = [[NSMutableArray alloc] initWithObjects:info,hero,find,me, nil];

for (int i = 0; i < 4; i++) {

 UIViewController * vc = viewArr[i];

   vc.title = titleArray[i];

}

同种类型不同名字的变量在for循环中操作

标签:

原文地址:http://www.cnblogs.com/block123/p/4896790.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!