2010-05-15 63 views
0

为什么NSArray自动分配与arrayWithObjects dealloc如果已经被BObject对象使用?在teory NSArray中必须继续分配所有的BObject续航时间......autorelease问题

[[BObject alloc] initObjectName:@"oneObject" states: 
    [NSArray arrayWithObjects: 
    [[State alloc] initStateName:@"stand_front" singleImg:[NSArray arrayWithObjects:[UIImage imageNamed:@"front_1.png"], nil]], 
    [[State alloc] initStateName:@"front_walking" frames: 
    [NSArray arrayWithObjects: 
     [UIImage imageNamed:@"front_1.png"], 
     [UIImage imageNamed:@"front_2.png"], 
     [UIImage imageNamed:@"front_3.png"], 
     [UIImage imageNamed:@"front_4.png"], 
     [UIImage imageNamed:@"front_5.png"], 
     [UIImage imageNamed:@"front_6.png"], 
     [UIImage imageNamed:@"front_7.png"], 
     [UIImage imageNamed:@"front_8.png"], 
     nil] duration:0.8 repeat:0], 
    nil] 
    isSolid:TRUE]; 
+3

什么是“BObject”传递的数组,它保留了'状态:'参数? – 2010-05-15 01:40:42

+0

不,它不保留州...我已经修补.. thx:D – BQuadra 2010-05-16 17:16:05

回答

0

BObject可能会让而不是将其保留在数组的副本。