0
弧の命名規則では、init ***メソッドの戻り値は呼び出し元によって保持されますが、戻り値のないinit ***メソッドを作成した場合、ARCでメモリの問題が発生しますか?円で戻り値なしのinit **メソッドの場合はどうなりますか?
- (void)initToolbar
{
// 工具栏
UIButton *commendEditButton = [[UIButton alloc] initWithFrame:CGRectMake(15, 0, [Utils getScreenAppSize].width - 15 *2, 32)];
commendEditButton.backgroundColor = [UIColor whiteColor];
commendEditButton.layer.borderColor = UIColorFromRGB(0xb6b6b6).CGColor;
commendEditButton.layer.cornerRadius = 4.f;
commendEditButton.layer.borderWidth = .5f;
[commendEditButton addTarget:self action:@selector(showCommentCompose) forControlEvents:UIControlEventTouchUpInside];
[commendEditButton setImage:[UIImage imageNamed:@"comment-ico-compose"] forState:UIControlStateNormal];
[commendEditButton setImage:[UIImage imageNamed:@"comment-ico-compose"] forState:UIControlStateHighlighted];
[commendEditButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
[commendEditButton setImageEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0)];
[commendEditButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 15, 0, 0)];
[commendEditButton.titleLabel setFont:[UIFont systemFontOfSize:15.0f]];
[commendEditButton setTitleColor:UIColorFromRGB(0xc4c4c4) forState:UIControlStateNormal];
[commendEditButton setTitle:@"发表评论" forState:UIControlStateNormal];
NSArray *toolbarItems = [NSArray arrayWithObjects:[[UIBarButtonItem alloc] initWithCustomView:commendEditButton],nil];
_toolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, [Utils getScreenSize].height - UI_TOOL_BAR_HEIGHT - UI_STATUS_BAR_HEIGHT - UI_NAVIGATION_BAR_HEIGHT, [Utils getScreenAppSize].width, UI_TOOL_BAR_HEIGHT)];
[_toolBar setBackgroundImage:[UIImage imageNamed: @"toolbar_bg.png"] forToolbarPosition:UIToolbarPositionBottom barMetrics:UIBarMetricsDefault];
_toolBar.items = toolbarItems;
}