Ios ARC禁止显式消息发送';保留';
当我遇到问题时,我正在构建ios应用程序。它说ARC禁止显式消息发送“保留”。这是我的代码,给我错误Ios ARC禁止显式消息发送';保留';,ios,automatic-ref-counting,Ios,Automatic Ref Counting,当我遇到问题时,我正在构建ios应用程序。它说ARC禁止显式消息发送“保留”。这是我的代码,给我错误 filePath= [[NSString stringWithFormat:@"%@", [[NSBundle mainBundle] resourcePath]] retain]; 我在这里该怎么办?我的ARC已打开,我希望它保持打开状态,那么我该怎么办。只需删除retain,编译器将自动确保内存管理正确: filePath = [NSString stringWithFormat:
filePath= [[NSString stringWithFormat:@"%@", [[NSBundle mainBundle] resourcePath]] retain];
我在这里该怎么办?我的ARC已打开,我希望它保持打开状态,那么我该怎么办。只需删除retain,编译器将自动确保内存管理正确:
filePath = [NSString stringWithFormat:@"%@",
[[NSBundle mainBundle] resourcePath]];
filePath = [NSString stringWithFormat:@"%@", [[NSBundle mainBundle] resourcePath]];
你知道ARC是什么吗?而且也被否决了,因为相关问题中有多个链接已经回答了这个问题。我不理解ARC,这就是我为什么要问这个问题。我对ios的人不熟悉。