Mako Shan

Mako 是一名密码朋克爱好者
这里是我记录生活和成长的地方

联系我的微信号
👏欢迎一起交流学习

报错信息:failed to get the task for process XXX

原因:

证书问题,project和targets的证书都必须是开发证书,ADHOC的证书会出现此问题。

解决方案:

project和targets的证书使用开发证书。

其他:

failed to get the task for process XXX

This error happens when you have set Distribution Provisioning profile in code signing. Change it to Developer Provisioning Profile, then it will work. Worked for me f......

0

iOS修改字间距

var paragraphStyle =NSParagraphStyle.defaultParagraphStyle().mutableCopy() as NSMutableParagraphStyle

paragraphStyle.lineSpacing = 4.0

var attributes = [NSParagraphStyleAttributeName: paragraphStyle]

0

UIActivityViewController callback

//保存图片

func savePhoto(){

itemsToShare=[AnyObject]()

let imageData=UIImagePNGRepresentation(self.phoneImageView.image!)

self.itemsToShare.append(UIImage(data: imageData!)!)

let activityViewController = UIActivityViewController(activityItems: itemsToShare, applicationActivities: nil)

let completionIte......

0

自定义UINavigationController的 back 按钮

A视图进入B视图,如下,self指的A,bView指的B。

[self.navigationController pushViewController:self.bView animated:YES];

一开始想当然的,在B视图的viewDidLoad里直接使用:

self.navigationItem.backBarButtonItem.title = @"back";

来更改后退按钮标题,结果后退后,发现A视图的导航栏标题也变成“back”了。

于是网上搜了一下,别人推荐在B视图的viewDidLoad/viewWillAppear里使用:

UIBarBut......

0

OC Tip

判断Iphone5

([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : 0)

隐藏键盘,可以调用textfield的endediting事件

[[UIApplication sharedApplication].keyWindow endEditing:YES];

NSNotification发布监听

[[NSNotificationCenter ......

0

Swift Tip

在safari打开网页

if let url = NSURL(string: "http://sspai.com") {

UIApplication.sharedApplication().openURL(url)

}

NSURLConnection 网路连接

var url = NSURL(string: "http://sspai.com")

var request = NSURLRequest(URL: url)

NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue(), completion......

0

iOS程序卡在安装中

之前在手机上用FIR调试iOS程序,不知道什么原因,卡住了,重启也无效,用XCode也看不到安装的程序,百般搜索后终于解决。

只要 断网 重启 就好.

0

iOS9调用系统邮箱,发邮件

首先导入 import MessageUI

然后要继承 MFMailComposeViewControllerDelegate

@IBAction func email(sender: AnyObject) {

UIApplication.sharedApplication().keyWindow?.endEditing(true)

var configuredMailComposeViewController = MailComposeViewController()

if canSendMail() {

presentViewController(configuredMailCo......

0

iOS8强制竖屏

修改info.plist文件

<string>UIInterfaceOrientationPortrait</string>

0