CGRectNull,CGRectZero
複数の矩形の和を求めていくとき、初期値には CGRectNull
CGRect v = CGRectNull
CGRectZero
CGRectUnio
CGRectUnio

複数の矩形の和を求めていくとき、初期値には CGRectNull
CGRect v = CGRectNull
CGRectZero
CGRectUnio
CGRectUnio
applicatio
デバッガで実行していると、GCD でバックグラウンドジョブを投入した場合はちゃんと終了させられてしまうのだが、performSel
ちなみに1秒毎にログを出力してスリープするような軽いジョブを投入したらタイムアウトでサスペンドに移行した。 また延々素数を計算するようなジョブを投入するとタイムアウトで Kill された。
アプリケーションがバックグラウンドに入ったときアプリケーションのbackground
Thu Nov 25 11:30:01 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
Thu Nov 25 11:30:02 xxxxx-no-i
自分の view が表示される前に別のタブで回転されている可能性があるので、回転に対応する処理をプログラムで行う場合は viewWillAp
1 @implementation SomeViewCo ntroller 2 3 - (BOOL) 4 shouldAuto rotateToIn terfaceOri entation:(UIInterfac eOrientati on)interfaceO rientation { 5 return YES; 6 } 7 8 - (void) 9 AdjustHV { 10 switch ( self.interfaceO rientation ) { 11 case UIInterfac eOrientati onPortrait : 12 case UIInterfac eOrientati onPortrait UpsideDown : 13 oV1.frame = CGRectMake ( 14 0 15 , 0 16 , self.view.frame.size.width 17 , self.view.frame.size.height / 2 18 ); 19 oV2.frame = CGRectMake ( 20 0 21 , self.view.frame.size.height / 2 22 , self.view.frame.size.width 23 , self.view.frame.size.height / 2 24 ); 25 break; 26 case UIInterfac eOrientati onLandscap eLeft: 27 case UIInterfac eOrientati onLandscap eRight: 28 oV1.frame = CGRectMake ( 29 0 30 , 0 31 , self.view.frame.size.width / 2 32 , self.view.frame.size.height 33 ); 34 oV2.frame = CGRectMake ( 35 self.view.frame.size.width / 2 36 , 0 37 , self.view.frame.size.width / 2 38 , self.view.frame.size.height 39 ); 40 break; 41 } 42 } 43 44 - (void) 45 viewWillAp pear:(BOOL)p { 46 [ super viewWillAp pear:p ]; 47 [ self AdjustHV ]; 48 } 49 50 - (void) 51 willAnimat eRotationT oInterface Orientatio n:(UIInterfac eOrientati on)p 52 duration:(NSTimeInte rval)pDuration { 53 [ super willAnimat eRotationT oInterface Orientatio n:p duration:pDuration ]; 54 [ self AdjustHV ]; 55 } 56 @end
UITabBarCo
11/22 加筆
moreNaviga
1 - (BOOL) 2 tabBarController:(UITabBarCo ntroller*)pTBC 3 shouldSele ctViewCont roller:(UIViewCont roller*)p { 4 return pTBC.selectedIn dex < pTBC.viewContro llers.count 5 ? [ pTBC.viewContro llers objectAtIn dex:pTBC.selectedIn dex ] != p 6 : YES 7 ; 8 }
NSOperatio
1 @interface Operation : NSOperation { 2 } 3 @end 4 @implementa tion Operation 5 - (void) 6 Sub { 7 NSLog( @"Sub:%@", [ NSThread currentThr ead ] ); 8 // UIKit を使う処理 9 } 10 11 - (void) 12 main { 13 NSLog( @"main:%@", [ NSThread currentThr ead ] ); 14 [ self performSel ectorOnMai nThread:@selector(Sub) withObject :nil waitUntilD one:NO ]; 15 } 16 @end 17 18 19 { 20 NSOperatio nQueue* w = [ [ [ NSOperatio nQueue alloc ] init ] autoreleas e ]; 21 [ w addOperati on:[ [ Operation alloc ] init ] ]; 22 }
info.plist