`
wo890532
  • 浏览: 7807 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

从xib中创建完毕后会调用awakeFromNib方法

阅读更多
#pragma mark - 生命周期方法
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initial];
    }
    return self;
}

- (id)init {
    if (self = [super init]) {
        [self initial];
    }
    return self;
}

#pragma mark 当MJScrollView从xib中创建完毕后会调用这个方法
- (void)awakeFromNib {
    [self initial];
}

- (void)dealloc {
    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
    // 注意:记得要移除
    [center removeObserver:self];
    [super dealloc];
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics