XMPP iOS聊天軟體學習筆記 三

2022-09-20 07:57:12 字數 1263 閱讀 3352

今天做了好友介面,其實xmpp內部已經寫好很多擴充套件模組,所以使用起來還是很方便的

開發工具:xcode6

開發平台:ios8

xmpp框架:xmppframework

git clone

介面設計:使用storyboard 

1.每乙個模組建立以後都需要啟用,比如自動連線模組

//自動連線模組

_reconnect= [[xmppreconnect

alloc

] init];[

_reconnect

activate

:_xmppstream

];2.coredata 的用法

- (void)loadfriends

3.銷毀的方法也很重要

#pragma mark 銷毀

- (void)teardownxmpp

4.新增好友的方法

- (bool)textfieldshouldreturn:(uitextfield *)textfield

//判斷是否自己或者好友已經存在

if ([user isequaltostring:[hjuserinfo

sharedhjuserinfo].user])

xmppjid *friendjid = [xmppjid

jidwithstring:[nsstring

stringwithformat:@"%@%@", user, domainkey]];

if([[

hjxmpptool

sharedhjxmpptool].

rostersrorage

userexistswithjid:friendjid xmppstream:[

hjxmpptool

sharedhjxmpptool].

xmppstream

])[[

hjxmpptool

sharedhjxmpptool].

roster

subscribepresencetouser:friendjid];

returnyes;

}5.刪除好友的方法

- (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath

}剩下的就不一一講了,具體可以看** 

XMPP iOS聊天軟體學習筆記 一

通過前面的學習後,準備開始正式自己寫乙個專案 開發工具 xcode6 開發平台 ios8 xmpp框架 xmppframework git clone 介面設計 使用storyboard 第一天基本完成了 其他登陸 介面,這裡只將注意點做筆記 1.列舉和block的定義並用於 typedef enu...

QT聊天軟體

該程式實現的是每個使用者登入既是客戶端又是伺服器端,這就需要看你站在哪個角度看問題了。簡單的說,當使用者傳送資訊給別人時就是客戶端,當接收別人的資訊是就可以看做是伺服器端。下面分伺服器端和客戶端2部分來介紹。伺服器端 建立乙個udp socket並繫結在固定埠後,用訊號與槽的方式進行監聽是否有資料來...

golang 聊天室學習筆記

1聊天室伺服器端 package main import fmt net strings time 定義的此結構體為全域性map的value值,包括每乙個使用者的姓名,ip位址和私人管道 type client struct 這個函式是將私人管道中的內容傳送給使用者,配合全域性管道message使用...