Lefora Free Forum
login join
Loading
742 views

Accessing property from another class

Page 1
1–2
rookie - member
3 posts



I have a class named TLController.  It is the main controller for my application.  I have another class named TLMoviePlayer.  This one specifically controls the movie player portion of the application.

In TLMoviePlayer.h, I have an IB Outlet called player, of type QTMovieView.  I have it set as a retained property @property (retain) IBOutlet QTMovieView *player; .  In TLController, I have moviePlayer as a TLMoviePlayer.  I can get data from TLMoviePlayer, but the player (QTMovieView) always returns null.

- (IBAction)buttonAction:(id)sender

{

    [mainView setSubviews:[NSArray arrayWithObjects:mainTableView,videoPlayerView,nil]];

    NSError *err = nil;
    QTMovie *movie = [QTMovie movieWithFile:[[movies objectAtIndex:[movieTable selectedRow]] valueForKey:@"Location"] error:&err];
    moviePlayer = [TLMoviePlayer new];
    NSLog(@"before:%@",moviePlayer.player);
    [moviePlayer.player setMovie:movie];
    NSLog(@"after:%@",moviePlayer.player);
}

Both the before and after return (null).  Any idea why I can't access player during this method?



?
288 posts

I think I'm being confused by the talk of video.  I think the syntax you're after more like:

mp = [[TLMoviePlayer alloc]init];
NSLog(@"before = %@",mp.player);
mp.player = movie;

NSLog(@"after = %@",mp.player);


__________________
Page 1
1–2

Locked Topic


You must be a member to post in this forum

Join Now!