因为我的xmpp掉线会输出
Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo={NSLocalizedDescription=Socket closed by remote peer}
namespace warning : xmlns: URI vcard-temp is not absolute
<vCard xmlns="vcard-temp"/>
在这方法里我自己重连了xmpp
在联系人的类里从原来的类的初始化 改成了下面
- (void)viewDidLoad {
[super viewDidLoad];
//roster改变的通知
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rosterChange) name:kXMPP_ROSTER_CHAGE object:nil];
//组 组状态数组的初始化
_groups = [[NSMutableArray alloc]init];
_SectionStates = [[NSMutableArray alloc]init];
self.tableView.frame = CGRectMake(0, 0, ScreenViewW, ScreenViewWH-100);
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.delegate = self;
self.tableView.dataSource = self;
//获取联系人
[self getGroups];
}
-(instancetype)init{
if (self) {
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rosterChange) name:kXMPP_ROSTER_CHAGE object:nil];
_groups = [[NSMutableArray alloc]init];
_SectionStates = [[NSMutableArray alloc]init];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.frame = CGRectMake(0, 0, ScreenViewW, ScreenViewWH-100);
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
[[xmppManager shareInstance]connectToXMMPP];
[self getGroups];
}