自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 收藏
  • 关注

原创 char[]->NSString;char[]->NSData;十六进制和普通字符串互转;NSString转为utf16格式char[]

char[]->NSSrting char name[1008] = 接收到的char数组 //数组大小改为自己的 Byte byte[1008]; memcpy(byte, name,1008); NSData *ndata = [NSData dataWithBytes:byte length:1008]; NSString *str = [[NSString al

2018-02-04 12:16:49 1267

原创 iOS RSA,AES加密(使用openssl)

话不多说直接来。https://github.com/x2on/OpenSSL-for-iPhone下载下来后打开终端cd到这个目录,直接./build-libssl.sh运行脚本。等待个几分钟,当看到 Build library for iOS…Build library for tvOS…Done这里我们就编译好需要的静态文件了。把这两个.a和include

2017-09-12 16:45:07 1378 1

原创 iOS 上架报错:PLA 1.2 The seller and company names associated with your app do not reflect the name “XX"

app属于金融类的,第一次提交被拒:PLA 1.2The seller and company names associated with your app do not reflect the name “Rizhao Tongnan Exchange” in the app or its metadata, as required by section 1.2 of the A

2017-05-27 17:20:18 7411

原创 iOS Duplicate interface definition for class 'AppDelegate' ; Property has a previous declaration

因为要在当前版本基础上修改一个新的版本 所以就复制了原始版本出来修改后再上传分支,可是复制出来的项目打开直接报:我开始以为是导入了相同的文件,BuildPases 下的.m也查看了一遍错误原因:虽然名字更改了,但是编译时路径相同解决:Prefix Header重新更改下路径小技巧:不用自己拼路经,点开Prefix Header直接把pch文件拖进去就好了

2017-05-12 14:42:04 2331

原创 No such file or directory:Failed to chmod /Users/hthy/Library/Developer/CoreSimulator/Devices/125D87

项目更换Bundle identifier后运行模拟器,报错:Failed to chmod /Users/hthy/Library/Developer/CoreSimulator/Devices/125D8718-7FA1-45F9-BDFF-6681ADA88467/data/Library/Caches/com.apple.containermanagerd/Bundle/Applica

2017-05-12 14:19:13 6171

原创 iOS LaunchScreen.storyboard xib加载启动页面不显示问题

使用的LaunchScreen.storyboard 加载启动页面,更换图片后启动页面为空白解决办法:把放在Assets.xcassets的图片资源更换到跟目录下

2017-05-12 13:57:39 4491

原创 Application loader:ERROR ITMS-90168: "The binary you uploaded was invalid."

上架时报错:the binary you uploaded was invalid.  解决方案:更细后需要使用最新的Application loader 3.6 版本上传

2017-04-29 18:52:31 1925 2

原创 iOS:GCDAsyncSocket 的二次封装,粘包处理

因为要做实时数据所以简单的了解了下CocoaAsyncSocket这个库,其中的GCDAsyncSocket就是这个TCP协议通信的,看了一些网上demo之后基于目前使用的自定义协议的版本做了简单分装。这是自定以的协议头,后面拼接了一个json包(目前改为了protobuf,因为这个确实比较好用,体积也小),后面的封装基于这个协议,可供大家做一个参考!!!!#import ty

2017-03-21 19:07:31 7214 3

转载 iOS 集成Protobuf,转换proto文件

原文地址:http://blog.csdn.net/hyq4412/article/details/54891038附加Homebrew安装地址:https://brew.sh/index_zh-cn.htmlProtobuf简介Protocol Buffer是google 的一种数据交换的格式,已经在Github开源,目前最新版本是3.1.0。它独立于语言,独立于平台

2017-03-14 15:55:52 9947 3

转载 The file “xxx” couldn’t be opened because you don’t have permission to view it

Xcode 运行报错 The file “xxx” couldn’t be opened because you don’t have permission to view it,查了有说点击提示信息的方法修改配置的,更改Compiler for C/C++/Objective-C的,试了都没用,看个人情况的。 我的解决方法是info.plist 的 Bundle name As

2016-12-30 19:25:28 1443

原创 Archive upload failed due to the issues listed below. "invalid toolchain.new apps and app updates mu

今天用Xcode8.2bete版本上架时,出现了这以前我用xcode7.0测试版时出现过一次,这次记录下来。原因:信息都说的很清楚了,工具链无效。新 App 和 App 更新必须使用公共(正式)版 Xcode 6 或更高版本以及 iOS 8 SDK 或更高版本来构建。请勿提交 Beta 版软件构建的 App。 方法:1.下载一个正式版的Xcode上传(xcode8地

2016-12-23 12:02:43 1752

原创 iOS 控制器A上添加控制器B导致上面的控制器B点击事件失效

今天犯了一个低级的错误,我新建了一个控制器A ,又新建了控制器B,然后直接把控制器B的view添加在了控制器A的view上 [self.view addSubview:[[控制器B alloc]init].view];等我全部布好局之后,去做事件处理的时候发现控制器B怎么点击,方法都不会触发.开始以为是允许用户交互userInteractionEnabled没打开,然后在控制器A和

2016-12-19 15:33:52 1699

原创 iOS:调用 Web services 接口

  使用AFNetworking 调用 Web services 接口: + (void)POST:(NSString *)url soapBody:(NSString *)soapBody success:(void (^)(id responseObject))success failure:(void(^)(NSError *error))failure { ...

2016-12-14 11:06:51 1556

原创 iOS 微信分享不能app跳转和判断是否安装微信有误

1.先按官方流程走一遍,这时会报一个老掉牙的错误Undefined symbols for architecture arm64:"_OBJC_CLASS_$_CAEAGLLayer", referenced from:objc-class-ref in libWeChatSDK.a(ExGsGLES2LocalContextImpl.mm.o)ld: symbol(s) not

2016-11-11 09:23:10 3550 3

原创 Xcode真机沙盒下载错误:Failed to download application container An error occured while attempting to download

真机沙盒查看内容下载时出现Failed to download application containerAn error occured while attempting to download the container from application "app" on "“XXX”的 iPhone" to "/Users/duanjichao/Documents/xxxx.xc

2016-11-04 09:06:54 3613 3

原创 iOS 点击UITableViewCell上的按钮获取当前cell和行数

根据cell的搭建结构向上查找父试图得到cell,从右边的视图树可分析出.UIView *v = [sender superview]; HZFilemTableViewCell *cell = (HZFilemTableViewCell *)[v superview];如果在cell里面有UITableview的话,可通过indexPathForCell获取到NSIndexPath

2016-11-03 16:23:23 3595 1

原创 xib:*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x1

在使用xib过程中出现 *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key topRound.'开始检查了File

2016-10-25 09:35:20 2870

原创 iOS在pushViewController的过程中闪动,卡顿

造成的原因:1.跳转的控制器在主线程做了过多了消耗动作。2.跳转的控制器透明度和颜色是空, 给人的一种重叠的视觉效果决解办法:1.耗时操作放到异步线程2.跳转时设置下跳转控制器的背景色其实一个图片的透明度,剪切的方式,多次渲染以及机身与版本的兼容等等都会引起这种现象,只不过这种情况出现的几率很小

2016-10-22 15:50:02 3848

原创 iOS播放自定义提示音和震动

@implementation LKVibrate{ SystemSoundID soundID;}void soundCompleteCallback(SystemSoundID sound,void * clientData) { AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); AudioServices

2016-10-22 11:34:28 1240

原创 邮件数据格式

Received: from unknown (HELO localhost)([122.97.176.1]) by sina.cn with ESMTP 6 Jul 2016 15:23:58 +0800 (CST)//本地主机号,协议格式,时间Date: Wed, 06 Jul 2016 15:23:52 +0800//时间From: //发送方To: //接收方Subject:

2016-10-21 18:40:58 16164

原创 iOS:“warning:comparison between pointer and integer”

if (num == 0) { //提示 Comparison between pointer and integer ('id _Nullable' and 'int')    转换下就好了 if ([num intValue] == 0) {

2016-10-14 16:25:24 24593 1

转载 AFNetworking打印请求失败信息

NSError *underError = error.userInfo[@"NSUnderlyingError"]; NSData *responseData = underError.userInfo[@"com.alamofire.serialization.response.error.data"]; NSString *result = [[NSStrin

2016-10-13 17:07:35 1465

原创 iOS上传服务器数据乱码以及报错:NSLocalizedDescription=Request failed: unacceptable content-type: text/plain;

使用的是AFNetworking3.0,只是多封装了一层,以前都是好好的,但是今天POST就郁闷了,我也不知道是后台改了还是怎么,第一次报:content-type: text/plain}NSErrorFailingURLKey=http://www.138tg.com:8080/smart/user/login, com.alamofire.serialization.response.e

2016-10-13 10:52:36 8540

原创 iOS查看真机沙盒内容

做数据保存时一般都需要查看真机沙盒里的数据进行验证.步骤:然后选择自己的手机后可看见安装的应用,选择相应应用DownLoad下载后显示包内容.

2016-10-10 11:21:39 595

原创 iOS运行错误:Command /Applications/Xcode 2.app/Contents/Developer/usr/bin/actool failed with exit code 25

今天早上一打开电脑运行程序时突然抱Command /Applications/Xcode 2.app/Contents/Developer/usr/bin/actool failed with exit code 255。想到的第一方式就是clean一遍,但是没有效果.然后阅读上面文字感觉是库的问题。进入给出的目录,删掉全部文件后重新复制进去就好了

2016-10-10 09:28:07 5452

原创 UIAlertController更改内容样式及插入自定义View

iOS8 之后系统把UIActionSheet和UIAlertView合并为了UIAlertController,使用就不比多说了,但在使用的过程中发现样式是固定的,点进去也未发现可以提供更改多样式的属性,所以只能使用KVC在运行时动态访问和修改对象的属性。但在使用过程中需要知道属性类型对应的key值,这里提供两个方法,是别人写好的,借用一下。原文链接:帅气的链接//获得所有变量-

2016-10-07 14:34:16 11202

转载 iOS直播-实现后台录音并推流

对于我们的app要求后台也实时录音并推流主要要注意两点:保证app进入后台后实时录音保证app进入后台后实时推流1.设置应用为voip应用打开-info.plist文件,加入如下的keyRequired background modes,追加//保证app进入后台后实时录音App plays audio or streams audio/video using

2016-10-06 16:42:24 1772 1

原创 iOS国际化-多语言适配

网上很多这类的介绍,不过一般的都是说到一半就突然没有了潦草结尾,或者是无配图的全文字介绍。 所以写这篇文章,希望看了这篇文章的人可以省了到处扒资料的时间。1.适配storyboard项目->PROJECT->info->Localizations 点击加号 选择需要适配的语言添加完之后时候我们可以看见storyboard文件下会多出来一个.strings(Chinese(Simplif

2016-10-05 11:11:53 6897

原创 iOS富文本设置样式,插入图片,设置指定文字的点击事件

富文本:NSMutableAttributedString 它与普通文本之间最大的区别是可以设置不同字段范围的字体,颜色, 大小,样式等.字体大小 NSMutableAttributedString *attributed = [[NSMutableAttributedString alloc]initWithString:@"今天的添加非常不错"]; [attributed add

2016-09-29 19:06:23 5141

原创 模拟器运行错误: invalid device state

程序编译完成后出现invalid device state.可以试下方法:  1.点击模拟器->Simulator->Reste Content and Setting.  2.换另外一个模拟器运行成功后,再次运行。  3.检查下版本号.  4.重启后重新运行(有时候是喜欢这么抽风)

2016-09-29 16:54:25 3095

原创 用于音频对讲: 解g711u数据流和压缩pcm的数据流的方法

//g711u2pcmint UlawCodec_decode(int16_t *samples, int count, void *payload, int length){int8_t *ulaws = (int8_t *)payload;if (length > count) {length = count;}for (int i = 0; i int ula

2016-09-29 11:48:23 3336 1

原创 UITextField的左右图片,内容位置调整,解决输入框输入时上下抖动

写输入界面时UITextField左边一般都会插入一个图片,以前直接约束一个UIImageView上去,今天看到了苹果原来已经提供了属性(你们这些愚蠢的人类)。@property(nullable, nonatomic,strong) UIView *leftView;//左视图@property(nonatomic) UITextFieldViewMode leftViewMode; /

2016-09-29 11:15:30 1177

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除