小编phi*_*530的帖子

CFURLCopyResourcePropertyForKey失败,因为它传递了这个没有方案的URL:

我知道这是一个xcode警告/错误,但是,当我尝试从命令行运行时会发生这种情况gitk --all.

YuFei-Zhus-MacBook-Pro:test phil88530$ gitk --all
2012-08-02 21:14:49.246 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.252 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.293 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.295 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme: 
2012-08-02 21:14:49.474 Wish[33464:707] CFURLCopyResourcePropertyForKey failed because it was passed this URL which …
Run Code Online (Sandbox Code Playgroud)

git macos terminal xcode command-line

39
推荐指数
5
解决办法
9637
查看次数

MySQL添加列(如果不存在)

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = 'email_subscription' AND COLUMN_NAME = 'subscribe_all')
  THEN 
  ALTER TABLE email_subscription
  ADD COLUMN subscribe_all TINYINT(1) DEFAULT 1,
  ADD COLUMN subscribe_category varchar(512) DEFAULT NULL;
Run Code Online (Sandbox Code Playgroud)

我看了很多例子.但是这个查询不起作用,我得到的错误是:

错误1064(42000):您的SQL语法有错误; 查看与您的MySQL服务器版本对应的手册,以便在'IF NOT EXISTS(SELECT*FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =')第1行附近使用正确的语法

mysql sql

29
推荐指数
2
解决办法
6万
查看次数

IOS 6屏幕旋转而不使用故事板

任何尝试最新iOS 6测试版(版本2或3)的人都有相同的自动旋转体验吗?

我不是使用故事板而是纯粹的导航控件:

self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];
Run Code Online (Sandbox Code Playgroud)

并有:

- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
    return YES;
}
}

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
Run Code Online (Sandbox Code Playgroud)

但IOS根本没有任何支持,适用于所有以前的iOS 3GS/4S和4.3,5.0.5.1模拟器,但iOS 6似乎只是马车

iphone rotation ios

7
推荐指数
3
解决办法
1万
查看次数

当url包含http时,在设置WebViewCore之前不支持Android:removeMessages(int what = 107)

我写了一个简单的程序,它将网页加载到Web视图中.

该URL包含http://并且Web视图效果很好,除了它仍然通过这个恼人的107错误,大多数人说这是因为你的网址不包含http标头.

我搜索了整个网络,找不到像我的情况

06-13 09:12:25.259: W/webcore(656): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
06-13 09:12:25.259: W/webcore(656):     at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
06-13 09:12:25.259: W/webcore(656):     at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
06-13 09:12:25.259: W/webcore(656):     at android.os.Handler.handleCallback(Handler.java:605)
06-13 09:12:25.259: W/webcore(656):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-13 09:12:25.259: W/webcore(656):     at android.os.Looper.loop(Looper.java:137)
06-13 09:12:25.259: W/webcore(656):     at android.app.ActivityThread.main(ActivityThread.java:4424)
06-13 09:12:25.259: W/webcore(656):     at java.lang.reflect.Method.invokeNative(Native …
Run Code Online (Sandbox Code Playgroud)

java android exception view web

5
推荐指数
1
解决办法
6705
查看次数

IOS6轮换问题

我知道你必须为IOS6使用新的旋转方法,但似乎我写的方法不起作用.

我设置我的plist文件以允许所有旋转但不允许portraitUpsideDown

然后我在appDelegate中有以下内容:

self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window setRootViewController:navController];  //add nav controller to be the root view
Run Code Online (Sandbox Code Playgroud)

然后在我的rootView中,推送到另一个控制器,我有:

WebViewViewController *webController = [[JBWebViewViewController alloc] init];
webController.urlString =   urlName;
[self.navigationController pushViewController:webController animated:YES];
Run Code Online (Sandbox Code Playgroud)

在网络控制器中,我有:

#pragma mark - System Rotation Methods
//for any version before 6.0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
//only allow landscape
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

/for 6.0+
- (BOOL)shouldAutorotate{
return NO;
}

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)

我想要做的是,在根视图中允许3次旋转,但是当切换到Web视图时(注意我确实推导航,不添加子视图),我只想允许纵向视图.

请有人帮帮我

-------更新----------

我已经创建了自己的UINavigationController的navController子类,我有一个BOOL landscapeModeOn,我可以设置它来告诉自动旋转规格

#pragma mark - System Rotation Methods …
Run Code Online (Sandbox Code Playgroud)

iphone rotation uinavigationcontroller ios ios6

5
推荐指数
2
解决办法
7746
查看次数

SKPhysicsContactDelegate 不工作

我有以下代码:

在我的场景中:

static const uint32_t enermyCategory    =  0x1 << 0;
static const uint32_t fatherCategory    =  0x1 << 1;

self.physicsWorld.contactDelegate = self;

    //init ship
Ship *ship = [Ship getFather];
ship.position = CGPointMake(CGRectGetMaxX(self.frame) - ship.frame.size.width , ship.frame.size.height);
[self addChild: ship];

    //init enermy
    Enermy *ene = [[Enermy alloc] initWithImageNamed:enermyName gameScene:self];
ene.position = ship.position;
[self addChild:ene];

#pragma mark - Physics Delegate Methods
- (void)didBeginContact:(SKPhysicsContact *)contact{
    NSLog(@"contact detected");
}
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,我一开始就将飞船和能量设置在同一位置,因此它们总是会发生碰撞。

对于这两个类,我在其 init 方法中有以下代码:

//setup physics body
self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.size];
self.physicsBody.dynamic = NO; …
Run Code Online (Sandbox Code Playgroud)

collision-detection ios sprite-kit skphysicsbody skphysicsworld

2
推荐指数
1
解决办法
3207
查看次数