網頁

2020年8月14日 星期五

Xcode舊專案改用Automatic Sign發生〞Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.〞 Error

平時都是用手動指定憑證發布app,但剛好有舊案可以使用自動的,就改成自動,結果一直發生"Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.",查半天,看到升级Xcode 10后遇到的问题提到清空User defined中的PROVISIONING_PROFILE,Target及Project設定都要改。

改完後,最好是Automatically manage signing的勾選取消再勾回,選Team,重開XCode。

參考網址:

升级Xcode 10后遇到的问题

2020年8月3日 星期一

nginx設定轉址

有個網站跟客戶希望能直接轉址到別處,基本上有好幾種做法
  1. 直接php轉
  2. .htaccess寫方式轉
  3. web server(我是用nginx)轉
查了下,最後選了第三個做,直接在nginx.conf或site-enabled/default中的server內最後面加底下這行,oldpage及http://www.domain.com/newpage自行更換
rewrite ^/oldpage$ http://www.domain.com/newpage redirect;

重開機就OK了
#service nginx reload

參考網址:

2020年7月13日 星期一

IE11中使用flex + min-height做垂直置中的問題

前端的人使用bootstrap4切版,套版後覺得不好看,臨時改成有有最小高度,結果發現在IE無法垂直置中,查半天跟flex有關的資料,看到internet-explorer - 在 IE 中,css Flexbox不是垂直居中提到height要設定因為ie的bug,實際設定height設個比min-height小的值,就真的垂直置中了,真的太神奇了 @@

PS. 不確定是否全部ie版本都能用,但ie11可行。

--- 7/16 更新
傻傻的以為能用,這做法不適合高度會變動的版面

參考網址:
internet-explorer - 在 IE 中,css Flexbox不是垂直居中

2020年3月15日 星期日

Xcode 10.1編譯舊專案出現了'sqlite3_key' is invalid in C99的Error

依然是舊專案的問題,出現了'sqlite3_key' is invalid in C99的Error,查了下看到這篇sqlite3_key is invalid in C99 iOS11,看起來在iOS10是正常的,仔細想了下猜測是compiler版本問題,我的Xcode是10.1,就回到Xcode -> Preferences,點擊Locations,找到Command Line Tools,選Xcode 8.3.1,重開再compiler就OK了

參考網址:
sqlite3_key is invalid in C99 iOS11

升級到Xcode 9.3後出現Expected method to read dictionary element not found on object of type 'id'

開啟多年未開的專案想要compile時一直出現Expected method to read dictionary element not found on object of type 'id<NSFastEnumeration,NSObject>'的錯誤訊息,仔細查看,是PromiseKit這個library在xcode 9.3後會有的問題,查半天都是講用cocoapods升級PromiseKit到1.7.2就OK了,打下pod update後,又出現其他專案的Error,仔細一看發現一個根本不能update的Library,問題最後只能是直接解決這error,反過來想,只好去查看這Framework針對這issue的commit,最後找到Fix build on Xcode 9.3,修改如下



有種怎沒想到這樣改的蠢想法,不過又有種這像是workaround的感覺!!

參考網址:
Objective C- Xcode 9.3 - Expected method to read dictionary element not found on object of type
Fix build on Xcode 9.3