小编lib*_*bai的帖子

我的uilabel文字无法改变,为什么?

lblOverlayView_text.text不会从@"english subtitle"更改为@"change";

如何改变,为什么不呢?

- (void)video123 {



    lblOverlayView = [[UILabel alloc] init];
    int height=40;
    lblOverlayView.frame = CGRectMake(0, 480-height, 320, height);
    lblOverlayView.backgroundColor = [UIColor grayColor];
    lblOverlayView.alpha = 0.5f;
    lblOverlayView.text = @"english subtitle";
    lblOverlayView.textColor=[UIColor greenColor];
    lblOverlayView.textAlignment=UITextAlignmentCenter;





    NSString *urlAddress=@"http://video.ted.com/talk/stream/2011U/Blank/MattCutts_2011U-320k.mp4";

     movieURL= [NSURL URLWithString:urlAddress];

    //MPMoviePlayerViewController *
    moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];



    [moviePlayer.view addSubview:lblOverlayView];


    [self presentMoviePlayerViewControllerAnimated:moviePlayer];


    [NSThread detachNewThreadSelector:@selector(thread) toTarget:self withObject:nil];

    NSLog(@"loop test end playback starting...");

}





- (void) thread{


    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];


   while (true) 
   {
        [NSThread sleepForTimeInterval: 0.2];

       lblOverlayView.text =  @"change";

    }




     [pool drain]; …
Run Code Online (Sandbox Code Playgroud)

iphone video objective-c

1
推荐指数
1
解决办法
1701
查看次数

标签 统计

iphone ×1

objective-c ×1

video ×1