leichunfeng / WXTabBarController

在系统 UITabBarController 的基础上实现安卓版微信 TabBar 的滑动切换功能
MIT License
1.09k stars 217 forks source link

some confuse about programming syntax #1

Closed fealonelei closed 8 years ago

fealonelei commented 8 years ago

I am a little confused by your code. <br /n> In AppDelegate.m , after line 40, some code like : <br /n>

ViewController mainframeViewController = ({ ViewController mainframeViewController = [[ViewController alloc] init];

    UIImage *mainframeImage   = [[UIImage imageNamed:@"tabbar_mainframe"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *mainframeHLImage = [[UIImage imageNamed:@"tabbar_mainframeHL"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    mainframeViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"微信" image:mainframeImage selectedImage:mainframeHLImage];
    mainframeViewController.view.backgroundColor = [UIColor colorWithRed:48 / 255.0 green:67 / 255.0 blue:78 / 255.0 alpha:1];

    mainframeViewController;
});

what is the last line ? I found that if I comment it mainframeViewController;(the last line in bracket) out , the compiler will complain. I don't know what is this programming syntax. Could you offer some reference or hint, please ?

leichunfeng commented 8 years ago

Of course, you can find it: https://github.com/objc-zen/objc-zen-book#exploit-code-block

fealonelei commented 8 years ago

That's great ! Thanks a lot.