Translate

2015年4月14日 星期二

Xcode 6.3 not displaying memory report


I have resolved disabling Memory Guard diagnostic in the Scheme. From Xcode: Menu Product -> Scheme -> Edit Scheme... -> Diagnostic Tab -> uncheck all Guard options

If still doesn't work, try to disable (if enabled) the "Enable Zombie Object" checkbox

solve

2015年3月31日 星期二

Reachability

常常出現這個錯誤
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
*declaration of 'struct sockaddr_in*' will not be visible outside of this function*
看了很討厭後來再找到解決方法
解答在這
import netinet/in.h
import <>打不上去所以請自己<>

2015年3月30日 星期一

UILabel and UITextView

最近遇到一個問題
字串相同字型大小相同
在UILabel跟UITextView呈現的size不一樣
後來在這邊找到了解答


textView.textContainer.lineFragmentPadding = 0; textView.textContainerInset = UIEdgeInsetsZero; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.lineSpacing = -0.38; NSDictionary *attrsDictionary = @{ NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue" size:13.0f], NSParagraphStyleAttributeName: paragraphStyle}; textView.attributedText = [[NSAttributedString alloc] initWithString:textView.text attributes:attrsDictionary];

2014年12月16日 星期二

Objective-C Math functions

常常忘記objective-c的數學運算式
特地寫一下記錄

• pow(x,y) : x 的 y 次方
• sqrt(x) : x的平方根
• floor(x) : 小於 x 的最大整數
• ceil(x) : 大於 x 的最小整數
• exp(x) : e 的 x 次方
• log(x) : 以 e 為底 x 的對數值
• log10(x) : 以10為底 x 的對數值
• abs(x) : 整數 x 的絕對值
• fabs(x) : 浮點數 x 的絕對值
• srand(x), rand() : 產生亂數

參考1
參考2
參考3

2014年10月20日 星期一

轉帖Xcode6中怎么添加空工程模板


把Empty Application.xctemplate 拷贝到
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application下就可以了
但是要保证你的Xcode的路径是正确地。退出Xcode 再打开就可以了
Empty Application.xctemplate