在ARC项目中使用dismissModalViewControllerAnimated方法隐藏视图时,在dealloc里面打印NSlog检测该控制器有没有释放,结果没有打印出来,经过查找,是由于对这个控制器里面的协议指针赋值,但是这个协议的属性声明的是retain或者strong,要改成 assign。例如:
#import "MonthView.h"
@interface CalendarController ()<MonthViewDelegate>
@end
引入协议 MonthViewDelegate, 并在CalendarController 里面赋值 [ monthView setManage : self ];在
@interface MonthView : UIView
@property (nonatomic,strong) id<MonthViewDelegate> manage;
@end
需要把strong改成assign ;