真机编译错误:Command /usr/bin/codesign failed with exit code 1 解决方法

来源:互联网 发布:android之淘宝购物车 编辑:程序博客网 时间:2024/05/16 17:18
在终端里输入:
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin

并回车,则可解决


在iphone程序中实现截屏的一种方法:


//导入头文件

#import <QuartzCore/QuartzCore.h>


//将整个self.view大小的图层内容创建一张图片image

  1. UIGraphicsBeginImageContext(self.view.bounds.size);

  2. [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; 

  3. UIImage *image= UIGraphicsGetImageFromCurrentImageContext();

  4. UIGraphicsEndImageContext();
复制代码
//然后将该图片保存到图片图

UIImageWriteToSavedPhotosAlbum(image, self, nil, nil);