上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 109 下一页

2015年7月4日

1039. Course List for Student (25)

摘要: 题目如下: Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to ... 阅读全文

posted @ 2015-07-04 17:43 张大大123 阅读(128) 评论(0) 推荐(0) 编辑

2015年6月23日

(六十八)使用XMPPFramework登录

摘要: 按照XMPPFramework的官方样例,应该把登录代码放置在AppDelegate中,并且让注销成为私有方法。 XMPPFramework进行登录的步骤如下: ①连接主机,并且发送JID ②如果连接成功,则发送密码进行授权 ③授权成功后,发送上线消息 ④如果要注销,发送下线消息,并且断开连接。... 阅读全文

posted @ 2015-06-23 21:28 张大大123 阅读(176) 评论(0) 推荐(0) 编辑

(六十七)Xcode导入XMPPFramework框架

摘要: 首先下载XMPPFramework框架,将Vendor内容导入到工程中,其中KissXML需要额外的框架,需要通过Xcode设置。 选择工程选项中TARGETS的General标签,最下侧有Linked Frameworks and Libraries,导入libxml2.dylib: 接着选... 阅读全文

posted @ 2015-06-23 21:12 张大大123 阅读(128) 评论(0) 推荐(0) 编辑

2015年6月22日

(六十六)TableView内容超过一屏时滚动到屏幕底部的方法

摘要: 假设数据放置在self.chatMessage数组内,只需要让tableView滚动到最后一条数据底部即可,调用scrollToRowAtIndexPath方法: [_tableView reloadData];// 实现数据超过一屏时滚动到底部。NSIndexPath *lastPath = ... 阅读全文

posted @ 2015-06-22 19:46 张大大123 阅读(183) 评论(0) 推荐(0) 编辑

(六十五)iOS的socket实现(GCDAsyncSocket)

摘要: 本文介绍使用GCDAsyncSocket来实现iOS端的socket,有关简易服务端的代码已经在上一篇文章中提到,这里不再赘述,将直接介绍如何实现客户端。 首先下载CocoaAsyncSocket框架,如果下载过iOS的XMPP框架,在Vendor中有这个框架,将框架导入工程,并包含其头文件GC... 阅读全文

posted @ 2015-06-22 19:27 张大大123 阅读(550) 评论(0) 推荐(0) 编辑

(六十四)iOS的socket实现(C+OC混合实现)

摘要: 对于微博、微信朋友圈之类的网络通信,使用JSON完全可以满足需求,但是如果要制作网络游戏,就需要建立一个持久连接,这时候就要考虑使用socket。 在iOS上实现socket大体有两种方法,一是借助自带的输入输出流和C语言socket相结合,二是利用第三方类库CocoaAsyncSocket,本... 阅读全文

posted @ 2015-06-22 19:00 张大大123 阅读(232) 评论(0) 推荐(0) 编辑

2015年6月12日

1035. Password (20)

摘要: 题目如下: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing ... 阅读全文

posted @ 2015-06-12 16:58 张大大123 阅读(180) 评论(0) 推荐(0) 编辑

1036. Boys vs Girls (25)

摘要: 题目如下: This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female stu... 阅读全文

posted @ 2015-06-12 16:54 张大大123 阅读(145) 评论(0) 推荐(0) 编辑

1037. Magic Coupon (25)

摘要: 题目如下: The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon wit... 阅读全文

posted @ 2015-06-12 16:49 张大大123 阅读(135) 评论(0) 推荐(0) 编辑

1038. Recover the Smallest Number (30) - 字符串排序

摘要: 题目如下: Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given {32, 321, 3214, 0229, 8... 阅读全文

posted @ 2015-06-12 16:37 张大大123 阅读(403) 评论(1) 推荐(0) 编辑

上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 109 下一页

导航