- 5月 20 週三 201510:59
How can I disable the UITableView selection highlighting? 關閉 UITableView 點擊 高亮 使失效
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?
- 5月 20 週三 201510:51
[轉]iOS並發編程NSThread、Grand Central Dispatch、Operation Queue 多執行續
並發的意思就是同時運行多個任務,這些任務可以在單核CPU上以分時(時間共享)的形式同時運行,或者在多核CPU上以真正的並行來運行多任務。
在移動和桌面操作系統中,蘋果提供了相同的並發編程API。 NSThread、Grand Central Dispatch(GCD)、NSOperationQueue
在移動和桌面操作系統中,蘋果提供了相同的並發編程API。 NSThread、Grand Central Dispatch(GCD)、NSOperationQueue
- 5月 20 週三 201510:49
Is there a way to pause SKActions? 暫停 SKScreen 遊戲 IOS Spritekit
Documentation says that parent SKView object has a paused property. Set it to YES to pause the scene.
Paused
A
@property(getter=isPaused, nonatomic) BOOL paused
Discussion If the value is YES, then the scene’s content is fixed on screen. No actions are executed and no physics simulation is performed."
Paused
A
Boolean value that indicates whether the view’s scene animations are paused.@property(getter=isPaused, nonatomic) BOOL paused
Discussion If the value is YES, then the scene’s content is fixed on screen. No actions are executed and no physics simulation is performed."
- 5月 20 週三 201509:50
Proper way to exit iPhone application? 離開 iphone app 關閉app
Have you tried exit(0)?
Alternatively, [[NSThread mainThread] exit], although I have not tried that it seems like the more appropriate solution.
On the iPhone there is no concept of quitting an app. The only action that should cause an app to quit is touching the Home button on the phone, and that's not something developers have access to.
According to Apple, your app should not terminate on its own. Since the user did not hit the Home button, any return to the Home screen gives the user the impression that your app crashed. This is confusing, non-standard behavior and should be avoided.
After some tests, I can say the following:
- using the private interface :
[UIApplication sharedApplication]will cause the app looking like it crashed, BUT it will call- (void)applicationWillTerminate:(UIApplication *)applicationbefore doing so; - using
exit(0);will also terminate the application, but it will look "normal" (the springboard's icons appears like expected, with the zoom out effect), BUT it won't call the- (void)applicationWillTerminate:(UIApplication *)applicationdelegate method.
My advice:
- Manually call the
- (void)applicationWillTerminate:(UIApplication *)applicationon the delegate. - Call
exit(0);.
Apple says not to use exit due to "Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen"developer.apple.com/library/ios/#qa/qa2008/qa1561.html – Micky Duncan Sep 5 '12 at 22:20 |
- 5月 20 週三 201509:48
how to add particles using SpriteKit in iOS7 加入 粒子 IOS SpriteKit
Lets say that you have a particle already created called MyParticle.sks.
First, you have to create a SKEmitterNode with your particle:
NSString *myParticlePath = [[NSBundle mainBundle] pathForResource:@"MyParticle" ofType:@"sks"];
SKEmitterNode *myParticle = [NSKeyedUnarchiver unarchiveObjectWithFile:myParticlePath];
First, you have to create a SKEmitterNode with your particle:
NSString *myParticlePath = [[NSBundle mainBundle] pathForResource:@"MyParticle" ofType:@"sks"];
SKEmitterNode *myParticle = [NSKeyedUnarchiver unarchiveObjectWithFile:myParticlePath];
- 4月 17 週五 201516:35
Horizontally mirror a SKSpriteNode texture 鏡像 圖片 左右相反
You can use this code to flip among x-axis:
spriteNode.xScale = spriteNode.xScale *-1;
spriteNode.xScale = spriteNode.xScale *-1;
- 4月 17 週五 201516:30
Two or more collisions at same time in Sprite Kit 同時多個碰撞
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:
-(void) didBeginContact:(SKPhysicsContact*)contact
{[_contactQueue addObject:contact];}
Declare an instance variable called NSMutableArray *_contactQueue; Add the contacts to the array:
-(void) didBeginContact:(SKPhysicsContact*)contact
{[_contactQueue addObject:contact];}
- 4月 17 週五 201516:28
在iOS上present一个半透明的viewController 透明view controller
今天尝试着在一个ViewController上面调用:
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
- 4月 17 週五 201516:25
IOS Navigate Back to previous view controller 返回上一頁 返回 view controller
You are using :
[self.navigationController popToRootViewControllerAnimated:TRUE];
[self.navigationController popToRootViewControllerAnimated:TRUE];
- 4月 17 週五 201516:24
ios 模擬器 大小 調整
如何调整这个模拟器的大小。 command + R 模拟器运行后, 再按 command +1、 command+2、 command+3, 试试看。 你会发现 模拟器的大小发生了变化。
