我有这个类在我的项目:的dealloc自定义对象的
@interface VideoItem : NSObject <NSCoding> {
NSString *name;
NSString *artist;
int seconds;
}
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *imgUrl;
@property (nonatomic, retain) NSString *artist;
@end
这也是我如何创建该对象:
VideoItem *item = [[VideoItem alloc] init];
item.name = name;
item.imgUrl = imgLink;
item.artist = artist;
这是的dealloc:
- (void)dealloc{
[name release];
[imgUrl release];
[artist release];
[super dealloc];
}
我想知道这dealoc
是否可以用NON-ARC
?我是否需要执行其他操作,因为NSString
与Property?
编辑
而如果VideoItem对象与创造:
VideoItem *item = [[VideoItem alloc] init];
item.name = [NSString alloc][email protected]"%@",name];
item.imgUrl = [NSString alloc][email protected]"%@",imgLink];
item.artist = [NSString alloc][email protected]"%@",artist];
在这种情况下做的dealloc的仍然是确定?或者我需要改变一些东西?
我编辑我的问题与其他一些东西,并感谢您的帮助! – MTA 2013-05-13 08:34:17
我确实检查了你的编辑并添加了一些信息。 – Peres 2013-05-13 08:35:40