まーのすけRoom

忘れると後で困りそうなことをMemoしておきます…

NSLogのフォーマット

2011-11-30 00:15:27 | iPhoneアプリ
size_tをNSLogで確認しようと思ったら
NSLog(@"%*");←この「%*」にどう書いたら良いか分からなくて調べたら、NSLogのフォーマットの一覧を見つけた。

%@     Object
%d, %i signed int
%u     unsigned int
%f     float/double

%x, %X hexadecimal int
%o     octal int
%zu    size_t
%p     pointer
%e     float/double (in scientific notation)
%g     float/double (as %f or %e, depending on value)
%s     C string (bytes)
%S     C string (unichar)
%.*s   Pascal string (requires two arguments, 
            pass pstr[0] as the first, pstr+1 as the second)
%c     character
%C     unichar

%lld   long long
%llu   unsigned long long
%Lf    long double

UIWebViewのバウンスの影を消す方法

2011-11-28 11:26:41 | iPhoneアプリ
UIWebViewをスクロースした時に、上下ではね返りのアニメーション(bounce)をするけど、そこに自動的に半透明の影が入る。
その影を消せないかと調べたところ、影はUIWebViewのsubviewの中の画像だそうで、以下のようにすると消すことができた。

for(UIView *wview in [[[webView subviews] objectAtIndex:0] subviews]) {
if([wview isKindOfClass:[UIImageView class]]) { wview.hidden = YES; }
}