Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 自动释放问题_Iphone_Objective C - Fatal编程技术网

Iphone 自动释放问题

Iphone 自动释放问题,iphone,objective-c,Iphone,Objective C,如果BobObject对象已经使用,为什么分配了arrayWithObjects的NSArray会自动解除锁定??在teory NSArray必须保持分配的所有对象生命周期 [[BObject alloc] initObjectName:@"oneObject" states: [NSArray arrayWithObjects: [[State alloc] initStateName:@"stand_front" singleImg:[NSArray arrayWithObje

如果BobObject对象已经使用,为什么分配了arrayWithObjects的NSArray会自动解除锁定??在teory NSArray必须保持分配的所有对象生命周期

[[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];

BObject
可能会复制数组,而不是保留它。

BObject必须保留作为
状态传递的数组:

什么是“BObject”,它是否保留
状态:
参数?不,它不保留状态。。。我已经补好了。。thx:D