PIXNET Logo登入

pcwiki的部落格

跳到主文

歡迎光臨pcwiki在痞客邦的小天地

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 6月 14 週日 201513:44
  • Sprite Kit rotation angle

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
CGFloat r =5;
// Create a vector in the direction the sprite is facing
CGFloat dx = r * cos (sprite.zRotation);
CGFloat dy = r * sin (sprite.zRotation);
// Apply impulse to physics body
[sprite.physicsBody applyImpulse:CGVectorMake(dx,dy)];
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 6月 14 週日 201513:42
  • Random float between two numbers? ios 隨機 浮點數 小數

#define ARC4RANDOM_MAX 0x100000000
 
Your code means this:
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 6月 14 週日 201513:40
  • itunes connect上传截图提示无法载入文件问题

上传快照的时候提示“无法载入文件,请再试一次”,图片尺寸和格式都是没有问题的
A:文件名或路径中含有中文 
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201512:29
  • Xcode 6: create new Objective C file messed up? xcode6 新建 objc 檔案

new
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:



#2
choose iOS, Source then Cocoa Touch Class:



#3
type the name of your new class (e.g. HelloWorldClass), it is a subset of the NSObject, and you need to choose the Language as well:

#4
after you saved the files, you can find them in the Project Navigator like I did:

 
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201512:06
  • 半透明UIViewController 半透明頁面 ios UIViewController 推出另外一个半透明的UIViewController

主要操作:(用來io7以下)
1. 视图1(ViewController1)中添加以下代码
ViewController2 *lagerPicVC = [[ViewController2 alloc]init];
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201512:04
  • [轉]Making the iPhone vibrate ios 震動 實現

There are two seemingly similar functions that take a parameter kSystemSoundID_Vibrate:
1)AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);2)AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201512:01
  • [轉][iOS Dev] NSUserDefaults Save/Read/Clear 儲存/讀取/清除 速記 使用者記錄 使用者設定 SharedPreferences












123456789101112131415161718192021222324252627282930313233343536373839
// 定義名稱 define key

#define kIsActive @"isActive"

#define kUserName @"userName"

 

// 讀取資料

-(void)loadInfo {

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSLog(@"Name : %@", [defaults stringForKey:kUserName]);

NSLog(@"isActive : %@", ([defaults boolForKey:kIsActive] ? @"YES" : @"NO"));

}

 

// 儲存資料

-(void)saveInfo {

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSString *userName = @"Hank";

BOOL isActive = YES;

[defaults setObject:userName forKey:kUserName];

[defaults setBool:isActive forKey:kIsActive];

}

 

// 清除資料

-(void)clearInfo {

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

 

[defaults removeObjectForKey:kUserName];

[defaults removeObjectForKey:kIsActive];

}

 

// 執行

- (void)viewDidLoad

{

[super viewDidLoad];

 

[self saveInfo];

[self loadInfo];

 

[self clearInfo];

[self loadInfo];

}




view rawNSUserDefaultsSample.m hosted with ❤ by GitHub


(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201511:54
  • ios uiview animate frame

[UIView animateWithDuration:0.5
delay:1.0
options: UIViewAnimationCurveEaseOut
animations:^{
self.basketTop.frame = basketTopFrame;
self.basketBottom.frame = basketBottomFrame;
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
[UIView animateWithDuration:0.6f
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201511:50
  • 常用數學函數 (轉貼) ios objc

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


Math functions


double pow ( double, double ) - power of



NSLog(@"%.f", pow(3,2) ); //result 9
NSLog(@"%.f", pow(3,3) ); //result 27


double sqrt( double ) - square root



NSLog(@"%.f", sqrt(16) ); //result 4
NSLog(@"%.f", sqrt(81) ); //result 9


double ceil ( double ) - if the argument has any decimal part, returns the next bigger integer



NSLog(@"res: %.f", ceil(3.000000000001)); //result 4
NSLog(@"res: %.f", ceil(3.00)); //result 3


double floor ( double ) - removes the decimal part of the argument



NSLog(@"res: %.f", floor(3.000000000001)); //result 3
NSLog(@"res: %.f", floor(3.9999999)); //result 3


double round ( double ) - rounds the argument



NSLog(@"res: %.f", round(3.5)); //result 4
NSLog(@"res: %.f", round(3.46)); //result 3
NSLog(@"res: %.f", round(-3.5)); //NB: this one returns -4


double fmin ( double, double ) - returns the smaller argument



NSLog(@"res: %.f", fmin(5,10)); //result 5


double fmax ( double, double ) - returns the bigger argument



NSLog(@"res: %.f", fmax(5,10)); //result 10


double fabs( double ) - returns the absolute value of the argument



NSLog(@"res: %.f", fabs(10)); //result 10
NSLog(@"res: %.f", fabs(-10)); //result 10


 


Few math constants


As found in the math.h



#define M_E 2.71828182845904523536028747135266250 /* e */
#define M_LOG2E 1.44269504088896340735992468100189214 /* log 2e */
#define M_LOG10E 0.434294481903251827651128918916605082 /* log 10e */
#define M_LN2 0.693147180559945309417232121458176568 /* log e2 */
#define M_LN10 2.30258509299404568401799145468436421 /* log e10 */
#define M_PI 3.14159265358979323846264338327950288 /* pi */
#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
#define MAXFLOAT ((float)3.40282346638528860e+38)



(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
  • 5月 30 週六 201511:48
  • [轉] 2015最新AppStore上架流程 ios

來源:http://blog.csdn.net/baidu_21172753/article/details/42678487
 
1.进入 https://developer.apple.com,选择Member Center,进去后点击iTunes Connect,输入账号密码。进去后,点击我的APP,然后点击左侧的加号,就可以创建应用了
2.创建应用需要填写必要信息
(繼續閱讀...)
文章標籤

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

  • 個人分類:IOS
▲top
«1...34521»

個人資訊

pcwiki
暱稱:
pcwiki
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (1,893)Android 新手上路 安裝系統(linux, Android, eclipse, ADT)
  • (4,214)IBM DB2 Oracle MS SQL 的比較
  • (1,023)0707(3)_java輸出入與迴圈
  • (266)[轉][mysql]can't connect to MySQL Server
  • (11,457)[轉]解決javac編譯時中文編碼警告的問題
  • (221)[轉] WampServer php mysql 集成包 多國語
  • (18,128)[轉] WampServer 用自已電腦架站
  • (660)[轉] Android - 取得WIFI相關資訊
  • (8,715)[轉] Java - String.getBytes()的中文編碼問題 亂碼 中文
  • (1,043)[轉] 解决Excel数据导入sqlite中的中文乱码问题 亂碼 execl sql

文章分類

toggle IOS (1)
  • IOS (42)
  • 伺服器+資料庫 (7)
  • SCJP 6.0 (5)
  • Android軟體 (9)
  • Android影片教學 (5)
  • Android新聞 (8)
  • Android教學 (104)
  • linux (1)
  • 未分類文章 (1)

最新文章

  • [旅遊] 日本-大阪
  • [旅遊] 台中
  • [旅遊] 高雄
  • [旅遊] 苗栗
  • 工程師心得
  • ios core data database sample 範本 加入core data
  • 類似 Observer Pattern 的 NSNotificationCenter ios 訊息處理 觀察者模式
  • ios in-app purchase flow 流程 程式內購買 開發 詳細 教程
  • ios iRate 第三方 投票 評等 評分 評價 開發 應用程式 app
  • ios 更改 顯示名稱 本地化 多國語言

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: