iOS 即时通讯之xmpp

告别Modern Standby噩梦:Win11睡眠断网冻结的根源剖析与S3睡眠回归实战 本文深入剖析了Windows 11中Modern Standby(现代待机)模式导致睡眠后断网、系统冻结等问题的根源,指出其与硬件驱动、后台活动的兼容性矛盾。文章提供了通过修改注册表键值强制系统回归稳定S3睡眠状态的详细实战步骤,帮助用户彻底解决睡眠故障,实现可靠的远程访问与挂机任务。 阅读详情

 

//
//  ViewController.m
//  XMPP_lesson

//

//  Created by  王聪 on 14/8/20.

//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import "ViewController.h"
#import "XMPPHelper.h"

@interface ViewController ()<XMPPStreamDelegate>
@property (weak, nonatomic) IBOutlet UITextField *userTF;//用户名TF
@property (weak, nonatomic) IBOutlet UITextField *passWordTF;//密码TF

@end

@implementation ViewController
//登陆方法
- (IBAction)loginAction:(UIButton *)sender {
    //发起登陆操作
    [[XMPPHelper sharedXMPPHelper]loginServerWithUserName:self.userTF.text password:self.passWordTF.text];
}
#pragma mark  --  密码验证成功回调方法
- (void)xmppStreamDidAuthenticate:(XMPPStream *)sender{
    [self performSegueWithIdentifier:@"segue" sender:nil];
}

//注册方法
- (IBAction)registerAction:(UIButton *)sender {
    [[XMPPHelper sharedXMPPHelper] registerServerWithUserName:self.userTF.text password:self.passWordTF.text];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    //再把当前的对象添加为xmppStream的代理
    [[XMPPHelper sharedXMPPHelper].xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
   
   
   
   
   
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 

@end

 

//
//  FriendListViewController.m
//  XMPP_lesson
//
//  Created by 王聪 on 15/8/21.
//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import "FriendListViewController.h"
#import "XMPPHelper.h"
#import "ChatTableViewController.h"
@interface FriendListViewController ()<UITableViewDelegate, UITableViewDataSource, XMPPRosterDelegate, UIAlertViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
//shujvyuan shuxing ,laizhanshixinxi
@property (strong, nonatomic)NSMutableArray *dataSource;
@end

@implementation FriendListViewController
//添加好友
- (IBAction)addFriend:(UIBarButtonItem *)sender {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"添加好友" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    //设置alerView的样式, 带一个输入框
    alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
    [alertView show];
   
   
}
#pragma mark - alertView的代理方法
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    //如果点击的时确定
    if (buttonIndex) {
        //获取alertView上面输入框的值
        UITextField *alerTF = [alertView textFieldAtIndex:0];
        NSString *userName = alerTF.text;
        //封装成XMPPJID
        XMPPJID *friendJID = [XMPPJID jidWithUser:userName domain:kDomin resource:kResource];
        //添加好友
        [[XMPPHelper sharedXMPPHelper].xmppRoster addUser:friendJID withNickname:nil];
       
    }
}




#pragma mark  -- tableView代理方法和dataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
   
    return self.dataSource.count;
   
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
   
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    XMPPJID *jid = self.dataSource[indexPath.row];
    cell.textLabel.text = jid.user;
    return cell;
   
   
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    // 初始化数组
    self.dataSource = [NSMutableArray array];
   
    //添加当前对象为xmppRoster的代理对象
    [[XMPPHelper sharedXMPPHelper].xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()];
    //调整视图的边距, 这个是ios7之后的方法, ios6不能用
    self.edgesForExtendedLayout = UIRectEdgeNone;
}
#pragma mark -- xmppRosterdelegate 的代理方法
//好友花名册开始检索好友的代理方法
-(void)xmppRosterDidBeginPopulating:(XMPPRoster *)sender{
   
   
}
//检索到好友信息的代理方法
- (void)xmppRoster:(XMPPRoster *)sender didReceiveRosterItem:(DDXMLElement *)item{
    //xml解析中获取节点中的属性
    NSString *jidStr = [[item attributeForName:@"jid"] stringValue];
    //xml解析获取节点中的订阅属性
    NSString *subscriptionStatus = [[item attributeForName:@"subscription"] stringValue];
    if ([subscriptionStatus isEqualToString:@"both"]) {
        //封装成JID对象
        XMPPJID *friendJID = [XMPPJID jidWithString:jidStr resource:kResource];
       
        if ([self.dataSource containsObject:friendJID]) {
            return;
        }
       
        //插入数据源数组
        [self.dataSource addObject:friendJID];
       
        //再插单元格
        [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:self.dataSource.count - 1 inSection:0]] withRowAnimation:UITableViewRowAnimationLeft];
        //让tableView滚动
        [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:self.dataSource.count - 1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
    }
}
//xmppRoster结束检索
- (void)xmppRosterDidEndPopulating:(XMPPRoster *)sender{
   
   
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    ChatTableViewController *chatVC = segue.destinationViewController;
    //找到点击的cell
    UITableViewCell *cell = sender;
    //获取点击cell的下标
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    chatVC.friendJID = self.dataSource[indexPath.row];

   
   
   
}

 

@end

 

 

//
//  ChatTableViewController.h
//  XMPP_lesson
//
//  Created by 王聪 on 15/8/21.
//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import <UIKit/UIKit.h>
@class XMPPJID;
@interface ChatTableViewController : UITableViewController
//声明当前聊天好友的JID属性
@property (nonatomic, strong)XMPPJID *friendJID;

@end

 

//
//  ChatTableViewController.m
//  XMPP_lesson
//
//  Created by lanouhn on 15/8/21.
//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import "ChatTableViewController.h"
#import "XMPPHelper.h"

@interface ChatTableViewController ()<XMPPStreamDelegate>
@property (strong, nonatomic)NSMutableArray *dataSource;
@end

@implementation ChatTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //添加当前为xmppStream的代理对象
    [[XMPPHelper sharedXMPPHelper].xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
   
    //初始化数组
    self.dataSource = [NSMutableArray array];
    //调用检索本地聊天记录的方法
    [self seacherMessageBetweenFriend];
   
   
   
   
}
//检索本地聊天记录
- (void)seacherMessageBetweenFriend{
    NSManagedObjectContext *context = [XMPPHelper sharedXMPPHelper].managedContext;
   
    //创建查询请求对象
    NSFetchRequest *request = [[NSFetchRequest alloc] initWithEntityName:@"XMPPMessageArchiving_Message_CoreDataObject"];
    //设置检索条件
    //1.创建谓词
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"bareJidStr == %@ and streamBareJidStr == %@", self.friendJID.bare, [XMPPHelper sharedXMPPHelper].xmppStream.myJID.bare];
    request.predicate = predicate;
    //2.设置排序
    NSSortDescriptor *description = [[NSSortDescriptor alloc] initWithKey:@"timestamp" ascending:YES];
    request.sortDescriptors = @[description];
    //执行这个查询请求
    NSArray *resultArray = [context executeFetchRequest:request error:nil];
   
    //加入数据源
    [self.dataSource addObjectsFromArray:resultArray];
    //刷新单元格
    [self.tableView reloadData];
   
   
   
}






//发送消息的方法
- (IBAction)sendMessage:(UIBarButtonItem *)sender {
   
   
    //创建消息对象
    XMPPMessage *message = [XMPPMessage messageWithType:@"chat" to:self.friendJID];
    //给消息添加内容
    [message addBody:@"你懂得http://cl.ttum.pw/htm_data/7/1508/1607032.html"];
    //3. *发送消息
    [[XMPPHelper sharedXMPPHelper].xmppStream sendElement:message];
   
}



- (void)showNewMessage:(XMPPMessage *)message{
    //插入数据源
    [self.dataSource addObject:message];
    //插入单元格
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.dataSource.count - 1 inSection:0];
    [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft];
    //tableView
    [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
#pragma mark -- 与聊天相关的xmppStream的代理回调方法
//收到消息的代理回调
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message{
    //判断消息发送者
    XMPPJID *friendJID = message.from;
    if ([self.friendJID isEqualToJID:friendJID]) {
        [self showNewMessage:message];
    }
   
   
}
//发送消息成功的代理回调方法
- (void)xmppStream:(XMPPStream *)sender didSendMessage:(XMPPMessage *)message{
   
    [self showNewMessage:message];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
   
    return self.dataSource.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cells" forIndexPath:indexPath];
    XMPPMessage *message = self.dataSource[indexPath.row];
   
    if ([message isKindOfClass:[XMPPMessage class]]) {
        if ([message.from isEqualToJID:self.friendJID]) {
            cell.textLabel.textColor = [UIColor redColor];
        }else{
            cell.textLabel.textColor = [UIColor blackColor];
        }
        cell.textLabel.text = message.body;
         return cell;
    }
    else{
       
        XMPPMessageArchiving_Message_CoreDataObject *message = self.dataSource[indexPath.row];
        //判断消息是不是登录用户发送的(isOutdoing是自己发送的)
        if (![message isOutgoing]) {
            cell.textLabel.textColor = [UIColor redColor];
        }else{
            cell.textLabel.textColor = [UIColor blackColor];
        }
        cell.textLabel.text = message.body;
        return cell;

       
    }
    }
   
   
   
   
   
   
   
   
  
  



/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */


/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source
 [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
 } else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
 }
 }
 */


/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
 }
 */


/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */


/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

 

@end

 

 

 

//
//  XMPPHelper.h
//  XMPP_lesson
//
//  Created by lanouhn on 15/8/20.
//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMPPFramework.h"
@interface XMPPHelper : NSObject<XMPPStreamDelegate, XMPPRosterDelegate>

//通信介质(管道对象), 在整个xmpp框架中非常重要, 所有的服务都是建立在它之上
@property (nonatomic, strong)XMPPStream *xmppStream;
//声明好友花名册属性 (负责所有与好友相关的操作)
@property (nonatomic, strong) XMPPRoster *xmppRoster;
//声明消息归档对象 (这个对象负责消息的归档)
@property (nonatomic, strong)XMPPMessageArchiving *messageArchiving;
//声明被管理对象上下文, 方便外界查询 (因为我们要查询聊天记录)
@property (strong , nonatomic)NSManagedObjectContext *managedContext;

+ (XMPPHelper *)sharedXMPPHelper;
//1.登陆方法
- (void)loginServerWithUserName:(NSString *)userName password:(NSString *)password;

//2.注册方法
- (void)registerServerWithUserName:(NSString *)userName password:(NSString *)password;

 

 

@end

 

 

//
//  XMPPHelper.m
//  XMPP_lesson
//
//  Created by 王聪 on 15/8/20.
//  Copyright (c) 2015年 Congwang. All rights reserved.
//

#import "XMPPHelper.h"
#import "FriendListViewController.h"

//定义枚举
typedef NS_ENUM(NSInteger, ThePurposeOfLinkServer)
{
    LoginPurpose = 0,
    RegisterPurpose = 1
};

//延展
@interface XMPPHelper ()
//声明密码属性, 用于验证密码的验证
@property (nonatomic, copy)NSString *password;
//声明枚举属性来区分登陆和注册
@property (nonatomic, assign)ThePurposeOfLinkServer purpose;

@end



@implementation XMPPHelper
//xmpp服务助手
+ (XMPPHelper *)sharedXMPPHelper{
    static XMPPHelper *xmppHelper = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        xmppHelper = [[XMPPHelper alloc] init];
    });
    return xmppHelper;
}
//重写init方法, 在该方法中完成一些xmpp中一些类的基本设置
-(instancetype)init{
    self = [super init];
    if (self) {
        //1.xmppStream的设置
        //1.1创建xmppStream对象
        self.xmppStream = [[XMPPStream alloc] init];
        //指定xmppStream链接的服务器的地址
        self.xmppStream.hostName = kHostName;
        //指定xmppStream链接服务器的端口号
        self.xmppStream.hostPort = kHostPort;
        //添加xmppStream的代理对象
        //1.指定代理对象
        //2.指定GCD队列, 我们选择主线程
        [self.xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
       
       
        //完成xmppRoster的一些基本配置
       
        //1.创建好友存储对象
        XMPPRosterCoreDataStorage *storage = [XMPPRosterCoreDataStorage sharedInstance];
        //2.创建好友花名册管理对象
        self.xmppRoster = [[XMPPRoster alloc] initWithRosterStorage:storage dispatchQueue:dispatch_get_main_queue()];
        //3.添加代理
        [self.xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()];
        //4.* 打开xmppRoster服务
        [self.xmppRoster activate:self.xmppStream];
       
        //创建消息存储对象
        XMPPMessageArchivingCoreDataStorage *archivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
        //给数据管理器属性赋值, 方便外界的访问
        self.managedContext =  archivingStorage.mainThreadManagedObjectContext;
        //创建信息归档对象
        self.messageArchiving = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:archivingStorage dispatchQueue:dispatch_get_main_queue()];
        //添加代理, 不用遵守代理协议
        [self.messageArchiving addDelegate:self delegateQueue:dispatch_get_main_queue()];
        //**启动该服务
        [self.messageArchiving activate:self.xmppStream];
       
   
       
       
    }return self;
   
}

//发起请求方法
- (void)connectToServer{
    if (self.xmppStream.isConnected || self.xmppStream.isConnecting) {
        //告诉服务器我们xia线了
        //1.创建XMPPPresence对象,unavailable就是xia线了
        XMPPPresence *presence = [XMPPPresence presenceWithType:@"unavailable"];
        //2.发送xia线状态
        [self.xmppStream sendElement:presence];
        //断开链接
        [self.xmppStream disconnect];
    }
    //发起链接请求
    [self.xmppStream connectWithTimeout:-1 error:nil];
}





/**
 * 
 登陆方法的实现
 */
- (void)loginServerWithUserName:(NSString *)userName password:(NSString *)password{
    //给密码属性赋值
    self.password = password;
    //geimudi meijv fuzhi
    self.purpose = LoginPurpose;
    // 登陆方法
    //1.创建登陆方
    XMPPJID *userJID = [XMPPJID jidWithUser:userName domain:kDomin resource:kResource];
    //2.告诉xmppStream登陆方是谁
    self.xmppStream.myJID = userJID;
   
    //发起链接请求
    [self connectToServer];
   
}
/**
 * 
 注册方法的实现
 */

- (void)registerServerWithUserName:(NSString *)userName password:(NSString *)password{
    //给密码赋值
    self.password = password;
    //给目的属性赋值
    self.purpose = RegisterPurpose;
   
   
    //注册第一步
    //1.创建注册方法
    XMPPJID *registerUser = [XMPPJID jidWithUser:userName domain:kDomin resource:kResource];
    //2.谁在注册
    self.xmppStream.myJID = registerUser;
    //3.发起注册
    [self connectToServer];
   
}
#pragma mark  -- xmppStream的代理方法
//管道对象将要链接的时候出发
- (void)xmppStreamWillConnect:(XMPPStream *)sender{
   
    NSLog(@"%s, %d",__FUNCTION__, __LINE__ );
   
}
//xmppStream基于的socket管道链接上的时候触发
- (void)xmppStream:(XMPPStream *)sender socketDidConnect:(GCDAsyncSocket *)socket{
   
    NSLog(@"%s, %d",__FUNCTION__, __LINE__ );
}
//管道对象已经链接上出发的方法
- (void)xmppStreamDidConnect:(XMPPStream *)sender{
   
   
    if (!self.purpose) {
        //验证密码
        [self.xmppStream authenticateWithPassword:self.password error:nil];
    }else{
        //注册账号
        [self.xmppStream registerWithPassword:self.password error:nil];
    }
    NSLog(@"%s, %d",__FUNCTION__, __LINE__ );
}

//对该账号进行验证

//验证成功的方法
- (void)xmppStreamDidAuthenticate:(XMPPStream *)sender{
    //告诉服务器我们上线了
    //1.创建XMPPPresence对象,available就是上线了
    XMPPPresence *presence = [XMPPPresence presenceWithType:@"available"];
    //2.发送上线状态
    [self.xmppStream sendElement:presence];
   
    //提示框
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"登陆成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [alertView show];
    NSLog(@"成功");
   
   
   
   
   
   
   
}
//验证失败的方法
- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(DDXMLElement *)error{
    //提示框
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"登陆失败" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [alertView show];
    NSLog(@"失败");
}

//注册账号的方法
//注册成功的方法
- (void)xmppStreamDidRegister:(XMPPStream *)sender{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"注册成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [alertView show];
}
//注册失败的方法
- (void)xmppStream:(XMPPStream *)sender didNotRegister:(DDXMLElement *)error{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"注册失败" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [alertView show];
}

#pragma mark -- xmppRoster代理方法
//接收到好友的添加请求
- (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence{
    //获取请求添加好友的JID
    XMPPJID *friendJID = presence.from;
   
    //我们同意添加为好友
    [self.xmppRoster acceptPresenceSubscriptionRequestFrom:friendJID andAddToRoster:YES];
   
   
//    //拒绝好友的添加请求
//    [self.xmppRoster rejectPresenceSubscriptionRequestFrom:friendJID];
   
   
   
   
}





@end

 

 

 

PCB_Project.PrjPcb 4 Not in version control Altium Designer中PCB项目出现"NOT in version control"错误的解决方法:1. 禁用不需要的版本控制集成(DXP→Preferences→Version Control);2. 清理项目缓存(Projects面板右键→Clean Project);3. 检查文件读写权限;4. 如无效可新建项目重新添加文件。如需使用SVN版本控制,需正确配置SVN客户端路径,创建或连接SVN仓库,并将项目文件提交至版本控制系统。注意新建SVN仓库必须使用空目录,建议使用 阅读详情

相关推荐

随机截距交叉滞后模型RI-CLPM:原理、Mplus实现与结果解读

纵向面板数据分析中,传统交叉滞后模型(CLPM)常被用于探索变量间的时序关系,但其估计结果可能混淆了个体间稳定差异与个体内短期波动,导致交叉滞后路径出现偏差。随机截距交叉滞后模型(RI-CLPM)通过引入随机截距因子,将个体特质层面的差异与个体内动态过程分离,从而提供更纯净的个体内效应估计。该模型在组织心理学、发展心理学、成瘾行为等研究领域迅速普及,并成为顶级期刊审稿时常见的稳健性检验要求。本文从原理出发,系统讲解RI-CLPM的模型构建、识别条件、Mplus实操代码、输出解读及常见陷阱,并结合协变量处理、

weixin_33525298的博客 271

iOS之即时通信 XMPP

如今, 即时通信,支付,是相当火的的软件.而 XMPP 第三方即时通信,是最基础的的技术, 如果你有很高的技术, 你完全可以对其进行封装,就比如才没几年的环信即时通信.他就是继承于 XMPP 来写的. 下面,我来和你说说如何将其添加到你的项目中, 做出相当棒的 即时通信App , // 导入第三方 XMPP,导入头文件 XMPPFrame.h 之后. 1. 首先在助手类中写 XmppStream

qq_32780047的博客 578

手把手教你用nRF52832+RFX2401C设计远距离蓝牙模块(附完整原理图/PCB文件)

本文详细介绍了如何利用nRF52832 SoC与RFX2401C射频前端芯片设计远距离蓝牙模块,涵盖芯片选型、阻抗匹配、PCB布局等关键环节。通过实战指南和完整原理图/PCB文件,帮助工程师实现输出功率可达20dBm的蓝牙模块设计,适用于智能家居、运动追踪等物联网应用。

weixin_29214199的博客 287

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之XMPP入门

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之XMPP入门1.即时通信(Instant Message /IM)的含义即时通信软件发展产品最早的创始人是三个以色列青年,是他们在1996年做出来的,取名叫ICQ。1998年当ICQ注册用户数达到1200万时,被AOL看中,以2.87亿美元的天价买走。ICQ有1亿多用户,主要市场在美洲和欧洲,已成为世界上最大的即时通信系统。即时通讯技术(IM

高级软件开发工程师--周玉的博客 2544

Conda环境创建报错?教你快速解决Solving environment: failed和ResolvePackageNotFound问题

本文深入解析Conda环境创建中常见的'Solving environment: failed'和'ResolvePackageNotFound'报错原因,并提供从基础到高级的系统化解决方案。涵盖渠道配置、版本通配、环境文件编辑等实用技巧,帮助开发者快速解决conda环境创建问题,提升工作效率。

weixin_28677451的博客 258

winget安装提示:执行此命令时发生意外错误: InternetOpenUrl() failed. 0x80072efd

当我们使用Winget包管理器安装应用,提示错误:执行此命令时发生意外错误: InternetOpenUrl() failed. 0x80072efd 该怎么处理呢?请听我娓娓道来。

Linux I Tell U 8136

IOS开发,XMPP实现聊天,即时通讯(一)

原文地址http://blog.youkuaiyun.com/kangx6/article/details/7744304 介绍完了服务器,这篇我们就要介绍重点了,写我们自己的IOS客户端程序 先看一下我们完成的效果图 首先下载xmppframework这个框架,下载 点ZIP下载 接下来,用Xcode新建一个工程 将以下

leewolf 5338

新手必看!用FFmpeg一键合并ts文件的5种方法(含Windows/Mac终端命令)

本文详细介绍了使用FFmpeg合并TS视频文件的5种实用方法,涵盖Windows和Mac终端命令操作。从基础安装到进阶技巧,包括处理音频不同步、批量处理多个视频等场景,帮助用户轻松将m3u8分片视频合并为完整mp4文件,提升视频处理效率。

weixin_29065959的博客 557

ios 即时通讯-xmpp

ios 即时通讯-xmpp相关代码如下: #import #import "XMPPFramework.h" #import "CommunViewController.h" @protocol XMPPManagerDelegate @required -(void)receiveMessage:(XMPPMessage *)message; @end @interface TRXMP

LONG_IOS的博客 1062

innovus中如何设置cts参数

上面是设置cts的一般设置,如果需要对某些skew group或者某些clock tree设置不一样的参数,如需要对clk1这个clock设置不一样的inverter,可以使用。需要查询已经设置过的ccopt参数,可以使用get_ccopt_property去查询,方法和set_ccopt_property一致。言归正传,cts的设置命令是set_ccopt_property,获取命令是get_ccopt_property。另外,set_ccopt_property提供一套命令查询方法。

芯冰乐 544

点云从入门到精通技术详解100篇-基于三维点云的机器人抓取位姿检测(续)

集到的深度信息会存在噪点,因此需要将生成的场景点云进行预处理,获得平滑、降采样处理场景点云,本文设计的预处理操作更能从冗杂的场景点云中提取清晰、平滑的目标点云,便于后续的抓取位姿采样,提高后续算法的处理效率。因此需要对场景点云进行适当的分割,仅保留目标物体的点云,整个过程可以通过。场较小时,空间中的点云密度会更加提高;觉子系统的效率,再保持全局点云几何形状不改变的前提下,通过对目标点云进行。体素降采样可以快速地减少点云数据并同时保持点云的形。个点,由于我们实施抓取的目标物体只占整个场景点云图的一部分,

getusushu的博客 772

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之xmpp环境搭建(数据库/客户端/服务器)

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之xmpp环境搭建(数据库/客户端/服务器)0.XMPP入门点击这里—iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之XMPP入门1.需要的xmpp工具大全1.服务器: openfire_4_0_3.dmg 下载链接—openfire_4_0_3.dmg2.Java环境: JavaForOSX 2015-001.dmg 下载链接—Java

高级软件开发工程师--周玉的博客 1894

利用NLP技术分析爬取的文本数据:Python爬虫与自然语言处理实战

网页爬虫(Web Crawler)是一种自动化脚本,通过模拟人类浏览网页的方式,定期抓取网页内容并进行分析和存储。对于大规模的数据抓取任务,爬虫技术提供了极大的便利。常见的Python爬虫库有requestsSelenium等。在本篇博客中,我们从爬取网页文本数据开始,通过清洗和预处理,最终利用自然语言处理技术(包括情感分析、文本分类等)对数据进行了深度分析。通过该过程,我们展示了如何使用Python爬虫抓取文本数据,并利用NLP技术进行分析和建模。

2201_76125261的博客 627

从零开始利用XMPP做即时通讯ios篇(二)

从零开始利用XMPP做即时通讯ios篇

MoPellet的武林秘籍 618

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

iOS开发即时通讯环境搭建-XMPP

iOS开发即时通讯环境搭建-XMPP

qq_33777090的博客 990

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

ios 即时通讯 xmpp

[iPhone高级] 基于XMPP的IOS聊天客户端程序(XMPP服务器架构) http://blog.youkuaiyun.com/kangx6/article/details/7739828 [iPhone高级] 基于XMPP的IOS聊天客户端程序(IOS端一) http://blog.youkuaiyun.com/kangx6/article/details/7740135 [iPhone高级] 基于XMP...

weixin_30505225的博客 107

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

iOS 即时通讯XMPP

现在很多社交软件都很火,FaceBook、易信、陌陌等,QQ、微信当然依然是中文社交最大霸主。除此之外伙星也很火。除了社交软件用到即时通讯,商城类的软件也会涉及到买家与卖家的商谈,还有美食类软件,一般都会有评论,有用户之间的交流等等,几乎有用户资源的软件都会有即时通讯的需求。因此,即时通讯也是很重要的,不管目前所在的公司是否重视,但作为一个开发者不得小视。今天给大家聊一下即时通讯相关的内容。大家可

软工官博 1118

IOS开发,XMPP实现聊天,即时通讯(二)

原文地址http://blog.youkuaiyun.com/kangx6/article/details/7744304 接上一章的,这一章我们着重介绍XMPP 为了方便程序调用,我们把XMPP的一些主要方法写在AppDelegate中 在AppDelegate.m下这几个方法为: [java] view plaincopy

leewolf 2222

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之Core data详解

cocoa认知 Core Data是iOS5之后才出现的一个框架,它提供了对象-关系映射(ORM)的功能,即能够将OC对象转化成数据,保存在SQLite数据库文件中,也能够将保存在数据库中的数据还原成OC对象。 CoreData本质是一个ORM框架 ORM Objective-Relational Mapping 这个映射就是我们的模型文件,一般ORM框架都用XML格式来映射 实体Entity+属性

高级软件开发工程师--周玉的博客 1851

iOS中 XMPP即时通讯实现的主要步骤

这里只是列出实现的只要步骤,不是全部代码。 首先导入XMPPFramework,及相关配置,完成后开始。 创建一个XMPPHelper 类来管理要进行的操作。 XMPPHelper.h文件如下 1 typedef void(^loginSuccessBlock)(void); 2 typedef void(^loginFailBlock)(NSString *info...

derekgao2013的博客 196

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之openfire服务器失败问题

iOS 开发 XMPP即时通讯项目开发(仿微信)-详解之openfire服务器失败问题点击这里—xmpp入门点击这里—xmpp环境搭建(数据库/客户端/服务器)1.问题:安装好之后,第一次是可以启动openfire服务器的,但是电脑重启后,就再也不能启动服务器了,每次一点击“Start Openfire”,然后加载一下,状态还是“Start Openfire”没变化,有时甚至还会跳出错误提示框,提示

高级软件开发工程师--周玉的博客 1288

iOS开发拓展篇- 即时通讯XMPP简单介绍

一、即时通讯简单介绍 1、简单说明 即时通讯技术(IM)支持用户在线实时交谈。如果要发送一条信息,用户需要打开一个小窗口,以便让用户及其朋友在其中输入信息并让交谈双方都看到交谈的内容 有许多的IM系统,如AOL IM、Yahoo IM、 MSN以及QQ,它们最大的区别在于各自通讯协议的实现,所以即时通讯技术的核心在于它的传输协议 协议用来说明信息在网络上如何传输,如果有了统一的传输协议,那

越越博客 1055

XMPP与Openfire搭建的iOS即时通讯问题

我按网上的教程使用openfire搭建了一个后台服务器。然后再iOS客户端利用第三方XMPP框架写了一个即时通讯的demo,一切顺利。 我的问题是,我发现只需要知道后台服务器的地址和通讯的端口便能在服务器上进行相关操作,这样安全吗?或者有没有什么方法在能在服务器端对客户端来源进行判断,再确定是否响应。 说的有点乱,简单说就是,我写了一个程序可以连接到我的服务器。然后不小心服务器地址泄露出去了,

bangju6522的博客 403

IOS XMPP(即时通讯的框架)

#import "AppDelegate.h" #import "XMPPFramework.h" /* * 在AppDelegate实现登录 1. 初始化XMPPStream 2. 连接到服务器[传一个JID] 3. 连接到服务成功后,再发送密码授权 4. 授权成功后,发送"在线" 消息 */ @interface AppDelegate ()&lt...

weixin_30680385的博客 129

iOS基于XMPP实现即时通讯之一、环境的搭建

移动端访问不佳,请访问我的个人博客 使用XMPP已经有一段时间了,但是一直都没深入研究过,只是使用SDK做一些简单的操作,看了许多大神的博客,自己总结一下,准备写一系列关于XMPP的使用博客,以便于自己更加深入学习~ IM协议及服务器选型http://liudanking.me/arch/xmpp%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%80%89%E5%9E%8B/ 协议

W_C__L的博客 6724
上一篇: 自己封装图片请求,好于SDWebImage,优化了UItableView(上)
下一篇: iOS 警告收录及科学快速的消除方法
王_聪
博客等级 码龄11年 1粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值