Fwd: problems with NSMovieView (but may be obj alloc mistakes)
Fwd: problems with NSMovieView (but may be obj alloc mistakes)
- Subject: Fwd: problems with NSMovieView (but may be obj alloc mistakes)
- From: David Cairns <email@hidden>
- Date: Mon, 21 Apr 2003 19:18:30 -0400
Begin forwarded message:
From: David Cairns <email@hidden>
Date: Mon Apr 21, 2003 4:13:51 PM US/Eastern
To: email@hidden
Subject: problems with NSMovieView (but may be obj alloc mistakes)
Hey everyone, i've sent to this list before, without wanting to submit
too much code, but now i've gone through my code 2 or 3 times,
perfecting (hopefully...) my memory management stuff. the point is, i
have an NSTableView that displays a number of quicktime movies'
titles. When the user selects a title and presses a "Preview" button,
it (used to) displays the movie in a small NSMovieView. The NSMovies
are encapsulated in a class called Clip that holds some of the other
stuff associated with the movie that I will add later (timestamps,
etc).
Anyhoo, the NSMovieView no longer works and I can't for the life of me
figure out quite why...
Here is the code from my "Preview" button. All the references to
other object are OK:
(note that theDataSource is the data source for the NSTable called
clipView.
also, [theDataSource clipSet] returns an NSMutableArray holding all
the clips.
[selectedClip movie] returns the NSMovie in the clip.)
- (IBAction)PlayClip:(id)sender
{
int index;
if([listView selectedRow] == -1) {
if([[theDataSource clipSet] count] != 0) {
[listView selectRow:0 byExtendingSelection: NO];
index = 0;
NSLog(@" none selected -- using index = 0");
}
else {
NSBeep();
NSLog(@" no clips -- duh!");
NSLog(@"[ClipController PlayClip:] end");
return;
}
}
index = [listView selectedRow];
Clip *selectedClip = [Clip clipWithClip:[[theDataSource clipSet]
objectAtIndex: index]];
[selectedClip retain];
[clipView setMovie: [selectedClip movie]];
[selectedClip autorelease];
}
This is just plain not working! i've run it through PB's debugger and
it goes through the steps properly, i just can't figure out what
exactly is wrong!
thanx in advance.
-- dave.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.