NSLog(@"File size is : %.2f MB",(CGFloat)myData.length/1024.0f/1024.0f);
Or for OS X 10.8+ and iOS 6+
NSLog(@"%@",[NSByteCountFormatter stringFromByteCount:myData.length countStyle:NSByteCountFormatterCountStyleFile]);
Translate
2015年6月11日 星期四
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年4月13日 星期一
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 <>打不上去所以請自己<>
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
*declaration of 'struct sockaddr_in*' will not be visible outside of this function*
看了很討厭後來再找到解決方法
解答在這
import netinet/in.himport <>打不上去所以請自己<>
2015年3月30日 星期一
UILabel and UITextView
最近遇到一個問題
字串相同字型大小相同
在UILabel跟UITextView呈現的size不一樣
後來在這邊找到了解答
字串相同字型大小相同
在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];
2015年1月8日 星期四
2014年12月16日 星期二
Objective-C Math functions
訂閱:
文章 (Atom)