@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

通过前面的学习后,准备开始正式自己写一个项目

开发时间:五天(工作时间)

开发工具:xcode6

开发平台:iOS8

XMPP框架:XMPPFramework

git clone https://github.com/robbiehanson/XMPPFramework.git

界面设计:使用StoryBoard

github地址:https://github.com/hjandyz/XMPP

第一天基本完成了“其他登陆”界面,这里只将注意点做笔记

1.枚举和block的定义并用于回调

typedef enum {

XMPPResultTypeLoginSuccess,

XMPPResultTypeLoginFailure,

XMPPResultTypeNetErr

}XMPPResultType;

typedef void (^XMPPRresultBlock)(XMPPResultType type);

if (error && _resultBlock) {

_resultBlock(XMPPResultTypeNetErr);

}

if (_resultBlock) {

_resultBlock(XMPPResultTypeLoginSuccess);

}

2.block内要把self设置成弱指针

__weak typeof (self) weekSelf = self;

[delegate xmppUserLogin:^(XMPPResultType type) {

[weekSelf handleResultTye:type];

}];

3.切换rootViewComtroller时记得dismiss模态窗口,不然会造成内存泄漏

//隐藏模态窗口

[self dismissViewControllerAnimated:YES completion:nil];

4.建立新连接前如果已经建立过连接要断开

//如果以前连接过要断开

[_XMPPStream disconnect];

//连接主机

[self connentToHost];

5.MBProgressHUD如果view为nil会显示到window上面去

[MBProgressHUD showHUDAddedTo:view animated:YES]

6.自定义Log的方法

//自定义log

#ifdef DEBUG

#define HJLog(...) NSLog(@"%s %@",__func__,[NSString stringWithFormat:__VA_ARGS__])

#else

#define HJLog(...)

#endif

最新文章

  1. java 中Session 持久化问题
  2. php导入excel
  3. My Package
  4. 顺序执行到来的消息 actor
  5. Java-ArrayList和Vector的区别
  6. eclupse启动报 Failed to load JavaHL Library.错
  7. eclips中增加对jar包的引用
  8. 解决 MVC 用户上线下线状态问题
  9. UITableViewCell和UITableViewHeaderFooterView的重用
  10. javaFile循环列出指定目录下的所有文件(源代码)
  11. 一、Django的基本用法
  12. 使用reflector对.NET反编译
  13. win10 python27pyhton36共存
  14. spark-sql(spark sql cli)客户端集成hive
  15. SpringMvc 文件下载 详解
  16. 【待补】splay 模板
  17. string 常量池 栈 堆
  18. bzoj 4034: [HAOI2015]树上操作 (树剖+线段树 子树操作)
  19. opencv在同一窗口打印多张图片
  20. iptables简单规则记录

热门文章

  1. js实现选项卡切换的三种方式
  2. win7 下的open live writer代码插件
  3. Codeforces Round #276 (Div. 2) 解题报告
  4. layout_weight
  5. 2015北大夏令营day1 B:An Idea of Mr. A
  6. VS2010中使用QtOpenGL出现 unresolved external symbol __imp__glClear@4 referenced in function之类的错误
  7. Roman numerals
  8. Binary Search Tree BST Template
  9. UVA1218--树形DP
  10. 【BBST 之伸展树 (Splay Tree)】