我通过ssh访问服务器,我运行vim来编辑文件.当我尝试将文本从vim本地放入我的mac(lion)本地编辑器时,或者使用y或"+ y它不起作用.我最终得到了我在本地复制的文本.如果我只是在内部使用p,它确实有用嗯好吧.
我试图创建一个目录
NSError*error=nil;
NSString* BIDirectory=[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES) objectAtIndex:0] stringByAppendingPathComponent:@"BI"];
BOOL isDir,flag=YES;
//if the directory doesn't exist create it.
if(!([[NSFileManager defaultManager] fileExistsAtPath:BIDirectory isDirectory:&isDir]&& isDir))
flag=[[NSFileManager defaultManager] createDirectoryAtURL:[NSURL URLWithString:BIDirectory] withIntermediateDirectories:YES attributes:nil error:&error];
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
enter code hereError Domain=NSCocoaErrorDomain Code=518 "The operation couldn’t be completed. (Cocoa error 518.)" UserInfo=0x197190 {NSURL=/var/mobile/Applications/55793654-6CDB-4B07-8FBF-553DC37D583D/Library/Caches/BI}
Run Code Online (Sandbox Code Playgroud)
也许网址错了?
所有,
我有一个iphone项目,使用OpenGL-ES为给定的模型视图矩阵和给定的投影矩阵绘制3D模型.我需要用CALayer替换3D模型,所以我将模型视图矩阵的值放入CATransform3D结构并分配给它layer.transform.它运作良好,图层可见并按预期在屏幕上移动,但过了一段时间后我意识到我的图层行为不够精确,我应该考虑投影矩阵.然后出现了一个问题:当我简单地连接两个矩阵时,我的图层看起来很奇怪(它非常小,大约2个像素,而它应该是大约300个,因为它距离很远)或根本不可见.我该如何解决?
这是一段代码:
- (void)adjustImageObjectWithUserInfo:(NSDictionary *)userInfo
{
NSNumber *objectID = [userInfo objectForKey:kObjectIDKey];
CALayer *layer = [self.imageLayers objectForKey:objectID];
if (!layer) { return; }
CATransform3D transform = CATransform3DIdentity;
NSArray *modelViewMatrix = [userInfo objectForKey:kModelViewMatrixKey];
// Get raw model view matrix;
CGFloat *p = (CGFloat *)&transform;
for (int i = 0; i < 16; ++i)
{
*p = [[modelViewMatrix objectAtIndex:i] floatValue];
++p;
}
// Rotate around +z for Pi/2
transform = CATransform3DConcat(transform, CATransform3DMakeRotation(M_PI_2, 0, 0, 1));
// Project with projection matrix
transform …Run Code Online (Sandbox Code Playgroud) 如何使用xcode 8.1为iPhone和iPad设置我的应用程序?
当我转到“目标”->“常规”->“部署信息”->“设备”并选择“通用”时,我再次在下面获得一个标签,分别为iphone和ipad。
这是否意味着单个构建将不会生成同时适用于ipad和iphone的应用程序?
如果我仅将部署设备选择为iphone,则该应用程序在加载到ipad上时不是全屏,并且边框为黑色。如何在iPad和iPhone上构建全屏应用程序?
我有一张桌子,它运作良好。但是我必须在背景上添加渐变。我用viewDidLoad中的这段代码做到了:
gradientLayer.frame = self.view.bounds
let color1 = UIColor.blueColor().CGColor as CGColorRef
let color2 = UIColor.redColor().CGColor as CGColorRef
gradientLayer.colors = [color1, color2]
gradientLayer.locations = [0.0, 1.0]
gradientLayer.startPoint = CGPoint(x: 1, y: 0)
gradientLayer.endPoint = CGPoint(x: 0, y: 0)
self.view.layer.addSublayer(gradientLayer)
self.view.backgroundColor = UIColor.greenColor()
Run Code Online (Sandbox Code Playgroud)
但是现在我看不到表视图的任何内容。
有人可以帮帮我吗?