QuickTime Movies with CB

Member
Posts: 22
Joined: 2003.06
Post: #16
I wasn't autoreleasing some cells Rasp However the problem persists, the app crashes in the same way.

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #17
and you're sure that you aren't releasing cells when you shouldn't be?

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #18
Quote:Originally posted by kelvin
and you're sure that you aren't releasing cells when you shouldn't be?

yes

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #19
something in one of the cell's subcell arrays is being released somehow. I really can't think of anything else without seeing a code sample.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #20
Really thank you, I'll made some checks.

Quote:Originally posted by kelvin
I really can't think of anything else without seeing a code sample.

Thank you, but at the moment I don't know exactly where the problem is and I should post the whole code Rasp
However it's going to be released Smile

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #21
I have some cells that are instances of CBCell's subclasses. Can this influence? In their init method they call [super init]. I autorelease them in this way:
Code:
cell = [[[MySubclass alloc] init] autorelease];

Thank you

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #22
CB has been known not to play nice with CBCell subclasses in the past. Can you show me the -init method of the subclass?

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #23
I've two main subclasses. One has this init:
Code:
- (id)initBubble: (KindOfBubble) theKind withView: (CBView*) theView
{
    self = [super init];
    
    [self setView:theView];
    [self setKind:theKind];
    [self setStatus:kNoMove];
    [self setKindOfDamage:kFullDamage];
    [self setSound:TRUE];
    [[self view] addCell:self];
    
    switch([self kind])
    {
        case kBubbleTwo:
            [self setTexture:[[self view] textureNamed:@"bubbleTwo"]];
            break;
            
        case kBubbleOne:
        default:
            [self setTexture:[[self view] textureNamed:@"bubbleOne"]];
            break;
    }
    
    [self setRegPoint:NSMakePoint([self size].width/2.0,[self size].height/2.0)];
    
    return self;
}


The other is similar.
Thank you

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #24
Rasp
*thwaps junyx*
ok I know the methods are hidden, but seriously...
Shock
*blows steam*

DO NOT mess with the view property! CBCells have their view data managed automatically. -setView: is a hidden method that is used internally. By overriding it you are killing the view hierarchy. Don't mess with the view. The accessor provided will give you the view whose hierarchy contains that cell. Once a cell is added to a subcell of a view the -view accessor will return the view.

Code:
- (id)initBubble: (KindOfBubble) theKind withView: (CBView*) theView
{
    if (![super init]) return nil;
    
    [theView addCell:self];
    
    [self setKind:theKind];
    [self setStatus:kNoMove];
    [self setKindOfDamage:kFullDamage];
    [self setSound:TRUE];
    
    switch([self kind])
    {
        case kBubbleTwo:
            [self setTexture:[[self view] textureNamed:@"bubbleTwo"]];
            break;
            
        case kBubbleOne:
        default:
            [self setTexture:[[self view] textureNamed:@"bubbleOne"]];
            break;
    }
    
    [self setRegPoint:NSMakePoint([self size].width/2.0,[self size].height/2.0)];
    
    return self;
}

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #25
I'm so sorry... Sad
So CBView has its own setView: ... Oooops! Wacko You just called [junyx dealloc] Rasp
Thank you, I'll correct the code

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #26
You should really name your private methods beginning with an underscore Kelvin, to help avoid mistakes like this Rolleyes
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #27
It works now Wink
Thank you

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #28
Quote:Originally posted by OneSadCookie
You should really name your private methods beginning with an underscore Kelvin, to help avoid mistakes like this Rolleyes
indeed.

-setView: is a unique case however. it mirrors AppKit functionality where there is an public accessor for a managed property. Most of the other hidden methods are prefixed by an underscore. The main reason I didn't underscore the method was that I was thinking of making it public, but several design pitfalls ended up forcing me to make it private after I had written it.

-setView: is very tempting to the new user to toy with, with very _bad_ results. Even if I fully documented the method unintentional abuse would make it just not worth leaving open.

I was just surprised that junyx over wrote the method when there's a valid accessor. Though not so much in hindsight... I had a similar problem with a stanford grad student who was trying to directly access _view (which by the way doesn't work).

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 22
Joined: 2003.06
Post: #29
Quote:It works now

I was using the old version Rasp It doesn't work. However I decided to use the old version without the movies, because time is running out

if ( [[iDevGames uDevGame] started] )
{
Thought *uDevGameEntry = (Thought*)[[brain thoughts] objectForKey:kUDevGameEntry];

[self setMainProgrammingProject:uDevGameEntry];
}
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #30
Time to PANIC!!!!Wacko

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  SDL & Quicktime DM6 4 3,358 Jul 4, 2004 08:22 AM
Last Post: Steven