
oc
BubuxingBala
这个作者很懒,什么都没留下…
展开
-
蛇和梯子游戏,分别用oc和swift开发
蛇和梯子游戏,分别用oc和swift开发心血来潮想学学swift,看了一下教程和开发文档,发现其实swift的很多类都是基于oc的,比如swift的UIButton是基于oc的UIButton。所以我想其实学过oc再学swift并不是像学新语言一样难,只是把一种方言翻译成另一种方言而已。基于这个思路我试着写了一个oc的蛇和梯子的游戏,然后再一句一句翻译成swift,竟然成功了,仰天大笑先介绍一下这...原创 2018-04-18 14:22:06 · 1199 阅读 · 0 评论 -
苹果设置启动页
打开Assets.xcassets文件夹 新建Launch Image文件夹把启动页图片放进去,尺寸参考https://blog.youkuaiyun.com/weixin_42012181/article/details/89011391 打开工程设置App Icons and Launch ImagesLaunch Images Sourc设置为刚才新建的LaunchImage Launch...原创 2019-04-04 11:12:00 · 355 阅读 · 0 评论 -
苹果LaunchImage启动页尺寸
Portrait iOS 12+iPhone Xs Max 1242 × 2688 iPhone XR 828× 1792Landscape iOS 12+iPhone Xs Max 2688 × 1242 iPhone XR ...原创 2019-04-04 10:27:36 · 1125 阅读 · 0 评论 -
Swift项目使用Objective-C的sdk
以海康威视移动端视频SDK为例将SDK包“HikVideoPlayer.framework”拖入项目中 在“项目名-Bridging-Header.h”文件中引入SDK头文件#import <HikVideoPlayer/HVPConfigure.h>#import <HikVideoPlayer/HVPError.h>#import <HikVideo...原创 2019-03-26 10:49:05 · 1180 阅读 · 0 评论 -
获取AppStore版本号 检查是否需要更新 oc/Swift
Object-C写法: //获取手机程序的版本号 NSString *ver = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; NSString *appId = @"1268501964";//在开发者账号中查看10位数 NSDi...原创 2019-03-11 17:14:36 · 2696 阅读 · 0 评论 -
仿支付宝金额数字滚动的动画效果 oc
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];- (void)timerFireMethod:(NSTimer *)theTimerP{ //根据数值大小判断平均增加值 float ...原创 2019-01-22 12:07:06 · 1014 阅读 · 0 评论 -
iOS打包并发布App到App Store
创建钥匙串:打开mac自带软件 钥匙串访问 —— 证书助理 —— 从证书颁发机构请求证书,存储到磁盘 创建Certificates: 登录苹果开发者网站https://developer.apple.com,选择Account,进入Certificates, Identifiers & Profiles页面 选择Certificates下的All,再点击页面右...原创 2019-01-16 17:20:49 · 462 阅读 · 0 评论 -
仿支付宝金额数字滚动的动画效果 oc
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];- (void)timerFireMethod:(NSTimer *)theTimerP{ //根据数值大小判断平均增加值 float ...原创 2019-01-22 11:39:03 · 1361 阅读 · 0 评论 -
类似头条上下翻页效果 oc
效果图:创建UIScrollView infoScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(imgV.viewX+imgV.viewWidth+Blank*1.5, 0, ViewWeight-(imgV.viewX+imgV.viewWidth+Blank*1.5), CellHeight)]; in...原创 2019-01-22 11:02:19 · 227 阅读 · 0 评论 -
CocoaPods使用 iOS
CocoaPods用来管理第三方sdk非常好用,代码简洁,sdk可以自动更新,不用替换包。下面是在项目里集成CocoaPods的方法:打开终端 找到项目文件夹 命令:cd 文件夹名新建文件 命令:touch Podfile这时候项目文件夹里面就有一个Podfile文件,打开编辑第三方库 命令:pod xxxxx然后安装第三方sdk,在终端输...原创 2019-01-16 13:43:31 · 142 阅读 · 0 评论 -
iOS和html交互:oc调用html方法
比如在手机上点击一个oc按钮要展示后台数据,而html已经做了和后台交互,oc可以直接通知html返回数据html端:定义方法无参数 function getData() {}一个参数 function getDataWithId(id){}多个参数 function getDataWithMsg(id, date){} oc端:用U...原创 2019-01-16 11:16:09 · 818 阅读 · 0 评论 -
iOS和html交互:html调用oc方法
html端调用oc端方法,比如网页端需要支付,但只有oc才能调起支付宝或微信支付,可以这样写:OC端:引入库 #import <JavaScriptCore/JavaScriptCore.h>设置代理 @protocol JSObjectProtocol <JSExport> - (void)callIosPayF...原创 2019-01-16 10:32:36 · 1012 阅读 · 0 评论 -
iOS上架报错
最近用Application Loader上架报错:ERROR ITMS-90035: "Invalid Signature. A sealed resource is missing or invalid. The file at path [***.app/***] is not properly signed. Make sure you have signed your applica...原创 2019-01-16 09:24:37 · 1076 阅读 · 0 评论 -
App Store自动更新App oc
苹果App Store可以帮忙管理版本,只要在登录或起始页面加上下面代码就可以实现自动更新App版本。检查当前版本是否需要更新: //获取手机程序的版本号 NSString *ver = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; NSDi...原创 2019-01-21 09:42:45 · 535 阅读 · 0 评论 -
ios真机报错:The executable was signed with invalid entitlements.
这个报错有很多可能,尝试一下这些方法吧:1.检查Bundle Identifier和开发者账号是否对应,需要先注册bundle id才能在真机环境运行2.新建Scheme3.Build Settings - Signing - Code Signing Entitlements置为空...原创 2018-06-13 17:28:34 · 1123 阅读 · 0 评论 -
极光报错:Not get deviceToken yet
Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed? or there is no APNs register code? Please refer to JPush docs.今天...原创 2019-04-16 11:54:23 · 2957 阅读 · 1 评论