English 中文(简体)
iphone EXC_BAD_ACCESS 使用我自己的班子
原标题:iphone EXC_BAD_ACCESS using my own class

我把自己的阶级从国家统计局的目标中总结出来。

-(void) parseRow:(NSDictionary*) dictionary {
    NSArray* arName = [[dictionary valueForKey:displayname] componentsSeparatedByString:@"+"];
    [self setDriverName:[arName objectAtIndex:0]];
    [self setDriverSurname:[arName objectAtIndex:1]];
    [arName release]; // this give problem!
}

并且我认为:

driverStats = [[DriverStats alloc] init];

// driverStats is declared in the header:
DriverStats* driverStats;
@property (nonatomic,retain) DriverStats* driverStats;

[driverStats parseRow:dictionary];

If I add [arName release] in my class, when I exit from parseRow method, I have the EXC_BAD_ACCESS error.... but it s wrong?? I used array and after I released... I think that the error will be if I didn t release the pointer.. or not??? thanks in advance

最佳回答

这个问题很容易解决。 页: 1 因为你使用工厂方法部件 分离的ByString:它已经把自动释放的阵列归还给你。 因此,你不需要再放下你的阵列。

你们需要注意的另一件事情是编造的驱动器Name:并设置了驾驶员姓名:确保你保留/复制另外的物体,释放阵列时,这些物体也被释放,EXEC_BAD_ 缩略语

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签