Aspects icon indicating copy to clipboard operation
Aspects copied to clipboard

can't access return value's property

Open nealsun opened this issue 9 years ago • 0 comments

Hi, here is my code:

    [self aspect_hookSelector:@selector(initWithCoder:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
        __weak UINavigationItem *item;
        NSInvocation *invocation = aspectInfo.originalInvocation;
        [invocation invoke];
        [invocation getReturnValue:&item];
        if (item.title) {
            UILabel *titleLable = [[UILabel alloc] init];
            titleLable.textColor = [UIColor whiteColor];
            titleLable.font = [UIFont systemFontOfSize:16];
            [titleLable setText:item.title];
            [titleLable sizeToFit];
            item.titleView = titleLable;
        }
    } error:nil];

I can't step into if statement, but po item.title in console, I get the right value.

nealsun avatar Jun 14 '15 16:06 nealsun