not good but great

プログラミング、アート、映画・本の感想について書きます。

2014-04-23から1日間の記事一覧

UILabelの強い参照を使う

@interface ViewController () - (IBAction)removeAddLabel:(id)sender; @property (strong, nonatomic) IBOutlet UILabel *myLabel; @end 参照の種類を「strong」にします。 - (IBAction)removeAddLabel:(id)sender { if ([_myLabel isDescendantOfView:sel…

storyboardからではなくプログラムだけでラベルを作成する

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //ラベルサイズ CGRect rect = CGRectMake(50,100,200,30); //ラベル作成 UILabel *myLabel = [[UILabel alloc] initWithFrame:rect…