设为首页 加入收藏

TOP

[程序示例]Objective-C中的委托设计模式(牛仔与姑娘)(二)
2015-01-22 21:12:34 来源: 作者: 【 】 浏览:32
Tags:程序 示例 Objective-C 委托 设计模式 牛仔 姑娘
[date dateByAddingTimeInterval:6]]; } return 0; }

一切都准备就绪,现在让我们的牛仔拿起枪,行动起来吧!

编译成功!输出结果如下:

2014-07-16 17:27:10.973 Girl&Cowboy[4055:303] Lucy:My name is Lucy,my dad was taken by the bad guys,can you save him,please?

2014-07-16 17:27:11.012 Girl&Cowboy[4055:303] John Marston:OK,young lady,wait for the good news!


2014-07-16 17:27:13.014 Girl&Cowboy[4055:303] John Marston:There are too many of'em,I'll take all of my men and kill them all!!!Wait for the good news!

2014-07-16 17:27:13.015 Girl&Cowboy[4055:303] Lucy:My heart is so broken,I cant live without him,you must save him please,woo woo.



2014-07-16 17:27:15.014 Girl&Cowboy[4055:303] John Marston and his crew:I killed all the bad guys,and here is your father.

2014-07-16 17:27:15.015 Girl&Cowboy[4055:303] Lucy:Thank you so much,marry me~

Program ended with exit code: 0

我们的英雄把姑娘的父亲救出来了并且杀死了坏人!

这个例子很简单,实际应用中会比这个复杂得多,但是希望通过我这个例子能让不了解的同学对委托设计模式有个初步的认识吧~吐舌头

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇编程算法 - 完全背包问题 代码(C) 下一篇 新人写的通讯录和简短日历

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: