-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{if(![[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]){[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];[[NSUserDefaults standardUserDefaults] synchronize];}return YES;}
- Jul 17 Fri 2015 18:06
How to detect first time app launch on an iPhone 判斷第一次啟動app ios
- Jul 02 Thu 2015 14:05
Can I stop UIImageView Animation at last frame? ios 停在最後一幀 動畫
I just tried this on iOS5 it works. I put animation.image = [myAnimatedView.animationImages lastObject];
right before [myAnimatedView startAnimating];
and the animation stops at the last image.
- Jul 02 Thu 2015 14:02
Cannot send email in app using MFMailComposeViewController 信件 無法開啓 寄信 ios
http://stackoverflow.com/questions/11863527/cannot-send-email-in-app-using-mfmailcomposeviewcontroller
First add and Import the MessageUI Framework
- Jul 02 Thu 2015 14:01
UIImageView animation delay when doing startAnimating ios lag 延遲
I wouldn't normally recommend using imageNamed and relying on the in-built caching mechanisms. You'll find a lot of discussion on this if you search, but also it won't necessarily pre-render your images anyway.
I use the following code to pre-load and pre-render images so there is no delay when animating the first time through.
- Jul 02 Thu 2015 14:00
Clearing purchases from IOS in-app purchase sandbox for a test user 測試 沙盒 清除記錄
http://stackoverflow.com/questions/7747457/clearing-purchases-from-ios-in-app-purchase-sandbox-for-a-test-user
Does anyone have any ideas on how to reset and/or clear the IOS in-app purchase sandbox? I have an app that I'm testing with the sandbox, and I'd like to test new purchases without having to create a new test user every time I purchase something. If I don't do this, then I (of course) always get a message that the in-app purchase item has already been purchased when I click on my app's buy button.
- Jun 15 Mon 2015 11:36
MP3 playing using AVAudioPlayer not working on device 音樂播放
I am testing my app on my 3GS iPhone with iOS 4.2
I am using the following code which plays a sound in my IBAction. It works perfectly in the simulator (both iPad and iPhone) - I hear the sound.
- Jun 15 Mon 2015 11:11
SKAction playSoundFileNamed no audio through iphone speaker playSoundFileNamed 沒有聲音 失敗 錯誤
Has anyone had issues playing audio via the SKAction playSoundFileNamed using iOS Sprite Kit through the external speaker of your iOS device? I have the following code that plays the M4A file with no issue through the headphones; however, no audio is played when I unplug the headphones stepping through code it executes just no sound. I have another app that does not use this method and it plays with no issue.
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event{/* Called when a touch begins */for(UITouch*touch in touches){CGPoint location =[touch locationInNode:self];SKAction*sound =[SKAction playSoundFileNamed:@"blast.m4a" waitForCompletion:NO];[self runAction:sound];}
- Jun 15 Mon 2015 11:04
Pausing certain actions in Sprite Kit 暫停sprite kit skaction
self.view.paused =true;
Worked fine until I needed some animations to happen after somebody hit the pause button. Imagine a new sprite node sliding up from the bottom of the screen that includes some detail about the current score and so on. Using the code above of course all animations would be stopped.
My new idea was to simply stop all nodes that had to be stopped individually. I got that working by using this chunk of code.
- Jun 15 Mon 2015 11:02
iOS多线程编程之Grand Central Dispatch(GCD)介绍和使用 多執行緒
- Jun 15 Mon 2015 11:01
Install Android NDK on MAC
這篇主要講怎麼安裝以及使用Android NDK,
Android NDK簡單地說,就是讓您能夠在你的app當中使用C/C++進行implementation,
它可以把您寫的C/C++ build出一個share object檔案 (*.so) 讓Java call!類似windows中的dll檔!
當然你也可以在JNI call Java method,也就是說是雙向的!
而使用NDK的好處是大概有下面兩個(我只能想到這兩個..)
- 效能較好(depends on situation)
- 可以控制到底層的裝置