I use GHSidebarNav in one of my projects, and I came across this code, allocating an array of objects. I just have no idea what he is doing. Is it just an array? What is this weird @[...] syntax? I have not seen this before:
NSArray *controllers = @[ @[ [[UINavigationController alloc] initWithRootViewController:[[GHRootViewController alloc] initWithTitle:@"Profile" withRevealBlock:revealBlock]] ], @[ [[UINavigationController alloc] initWithRootViewController:[[GHRootViewController alloc] initWithTitle:@"News Feed" withRevealBlock:revealBlock]], [[UINavigationController alloc] initWithRootViewController:[[GHMessagesViewController alloc] initWithTitle:@"Messages" withRevealBlock:revealBlock]], [[UINavigationController alloc] initWithRootViewController:[[GHRootViewController alloc] initWithTitle:@"Nearby" withRevealBlock:revealBlock]], [[UINavigationController alloc] initWithRootViewController:[[GHRootViewController alloc] initWithTitle:@"Events" withRevealBlock:revealBlock]], [[UINavigationController alloc] initWithRootViewController:[[GHRootViewController alloc] initWithTitle:@"Friends" withRevealBlock:revealBlock]] ] ];
syntax ios objective-c iphone ipad
Imme22009 Nov 20 2018-12-12T00: 00Z
source share