目前分類:IOS (42)

瀏覽方式: 標題列表 簡短摘要

I suggest that you follow Sprite Kit’s coordinate and rotation conventions. Specifically, your sprite image should be facing right at zero degrees (the default value), and a positive value is a counter-clockwise rotation. That said, here's one way to apply an impulse in the direction a sprite is facing:

// Specify the force to apply to the SKPhysicsBody

pcwiki 發表在 痞客邦 留言(0) 人氣()

#define ARC4RANDOM_MAX 0x100000000

 

Your code means this:

pcwiki 發表在 痞客邦 留言(0) 人氣()

上传快照的时候提示“无法载入文件,请再试一次”,图片尺寸和格式都是没有问题的

A:文件名或路径中含有中文 

pcwiki 發表在 痞客邦 留言(0) 人氣()

everything is the quite similar to what was before, but here is the procedure in Xcode6 beta6:

#1

choose the New and File... or press ⌘N on keyboard:

pcwiki 發表在 痞客邦 留言(0) 人氣()

主要操作:(用來io7以下)

1. 视图1(ViewController1)中添加以下代码

pcwiki 發表在 痞客邦 留言(0) 人氣()

There are two seemingly similar functions that take a parameter kSystemSoundID_Vibrate:

1)AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);2)AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Both the functions vibrate the iPhone. But when you use the first function on devices that don’t support vibration, it plays a beep sound. The second function on the other hand does nothing on unsupported devices. So if you are going to vibrate the device continuously, as a alert, common sense says, use function 2.

pcwiki 發表在 痞客邦 留言(0) 人氣()

123456789101112131415161718192021222324252627282930313233343536373839
// 定義名稱 define key
#define kIsActive @"isActive"

pcwiki 發表在 痞客邦 留言(0) 人氣()

[UIView animateWithDuration:0.5
                          delay:1.0
                        options: UIViewAnimationCurveEaseOut
                     animations:^{
                         self.basketTop.frame = basketTopFrame;
                         self.basketBottom.frame = basketBottomFrame;
                     } 
                     completion:^(BOOL finished){
                         NSLog(@"Done!");
                     }];

pcwiki 發表在 痞客邦 留言(0) 人氣()

http://0922267152.blogspot.tw/2011/04/blog-post_13.html

 

Math functions

double pow ( double, double ) - power of

pcwiki 發表在 痞客邦 留言(0) 人氣()

來源:http://blog.csdn.net/baidu_21172753/article/details/42678487

 

pcwiki 發表在 痞客邦 留言(0) 人氣()

When you tap a row in a UITableView, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?

 

pcwiki 發表在 痞客邦 留言(0) 人氣()

並發的意思就是同時運行多個任務,這些任務可以在單核CPU上以分時(時間共享)的形式同時運行,或者在多核CPU上以真正的並行來運行多任務。



pcwiki 發表在 痞客邦 留言(0) 人氣()

Documentation says that parent SKView object has a paused property. Set it to YES to pause the scene.

Paused

pcwiki 發表在 痞客邦 留言(0) 人氣()

Have you tried exit(0)?

Alternatively, [[NSThread mainThread] exit], although I have not tried that it seems like the more appropriate solution.

pcwiki 發表在 痞客邦 留言(0) 人氣()

Lets say that you have a particle already created called MyParticle.sks.

First, you have to create a SKEmitterNode with your particle:

pcwiki 發表在 痞客邦 留言(0) 人氣()

You can use this code to flip among x-axis:

spriteNode.xScale = spriteNode.xScale *-1;

but be careful you can lose some of physicsbody's property, I highly suggest u to use xScale in this way:

pcwiki 發表在 痞客邦 留言(0) 人氣()

Maybe queuing the contacts and handle then in -update is what you need. For example:

Declare an instance variable called NSMutableArray *_contactQueue; Add the contacts to the array:

pcwiki 發表在 痞客邦 留言(0) 人氣()

今天尝试着在一个ViewController上面调用:

 

pcwiki 發表在 痞客邦 留言(0) 人氣()

You are using :

[self.navigationController popToRootViewControllerAnimated:TRUE];

This will bring you back to root view controller. If you want to navigate back to previous view controller,you should implement :

pcwiki 發表在 痞客邦 留言(0) 人氣()

如何调整这个模拟器的大小。 command + R  模拟器运行后, 再按 command +1、 command+2、 command+3, 试试看。 你会发现 模拟器的大小发生了变化。


pcwiki 發表在 痞客邦 留言(0) 人氣()

«12 3