月度归档:2017年09月

xcode9 打包报错问题解决

xcodebuild -workspace HuLaVenue.xcworkspace -scheme HLCG -configuration Debug clean -archivePath /目录/HuLaVenue-dev-315 archive CODE_SIGN_IDENTITY=”iPhone Developer: xxxxxxxx” PROVISIONING_PROFILE=”UUIDUUIDUUIDUUIDUUIDUUID”

xcodebuild -exportArchive -archivePath /目录/HuLaVenue-dev-315.xcarchive -exportPath /目录/build -exportOptionsPlist /目录/export-dev.plist

2017-09-21 15:18:04.806 xcodebuild[8273:56611] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path ‘/var/folders/d7/cpr_njpd7_gf29sww6x6k0pc0000gn/T/HLCG_2017-09-21_15-18-04.806.xcdistributionlogs’.
2017-09-21 15:18:05.405 xcodebuild[8273:56611] [MT] IDEDistribution: Step failed: : Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 “Locating signing assets failed.” UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
“Error Domain=IDEProvisioningErrorDomain Code=9 \”\”HLCG.app\” requires a provisioning profile with the Associated Domains and Push Notifications features.\” UserInfo={NSLocalizedDescription=\”HLCG.app\” requires a provisioning profile with the Associated Domains and Push Notifications features., NSLocalizedRecoverySuggestion=Add a profile to the \”provisioningProfiles\” dictionary in your Export Options property list.}”
)}
error: exportArchive: “HLCG.app” requires a provisioning profile with the Associated Domains and Push Notifications features.

Error Domain=IDEProvisioningErrorDomain Code=9 “”HLCG.app” requires a provisioning profile with the Associated Domains and Push Notifications features.” UserInfo={NSLocalizedDescription=”HLCG.app” requires a provisioning profile with the Associated Domains and Push Notifications features., NSLocalizedRecoverySuggestion=Add a profile to the “provisioningProfiles” dictionary in your Export Options property list.}

** EXPORT FAILED **

Build step ‘Execute shell’ marked build as failure
Finished: FAILURE

 

 

解决办法:编辑plist文件 添加
解决办法:编辑plist文件 添加
provisioningProfiles
com.hula.xxxxxx
HulaVenueDev (此处名字获得见下文)

继续阅读

Objective-C Runtime

一、简介

Runtime,Objecive-c运行时,一套底层C语言的API。
我们平常写的OC底层都是基于Runtime来实现的, 例如:

//注意使用以下代码,请在xcode工程设置中找到Enable Strict Checking of objc_msgSend Calls并关闭该选项。
[self tryUpgradeApp];
//其实会转化为
objc_msgSend(self, @selector(tryUpgradeApp));

//如有参数:
[self tryUpgradeApp:arg1...];
//则转为
objc_msgSend(self, @selector(tryUpgradeApp), arg1, ...);

继续阅读

排序算法:归并排序

归并排序的思路是 采用分治法,将一个大的问题拆分成若干个小问题,将一个大数组 拆为多个小数组进行排序 后再进去重组。 入下图锁示

拼合2个数组的思路:因为2个数组其实都是排过序的,只要给2个数组都设置个游标可以跟简单的进行组合。如下图所示



 

实现代码: 继续阅读

排序算法:快速排序 QuickSort

快速排序的的基本思路是: 通过一次排序,将数组分割为   参考值(1个值)、较大(比参考值都大的一群)、较小值(比参考值度小的一群) 3部分。然后将较大的部分和较小的部分视为2个数组进行再次排序,整个排序过程使用递归进行,以此达到整个数组的排列。  如下图:

在排序过程中可以设置任意一个数组元素为参考值,但是为了遍历的方便性 可以采用头尾使代码更简单,上图r(最后一个元素)为参考值。

j指针为每次遍历的下标,i指针则标识分隔符i之前的素组则都比r小,i之后的则都比r大,
每次遍历j都和r比较,如果j < r则进行i 和j的交换然后i的指针+1 , 到最后一轮时,r和i进行交换,则形成一个结果  比 [r小的区域,  r , 比r大的区域]  依次再次对左右2个区域进行相同的处理。

代码如下…
继续阅读