|
|
#1 |
|
How to write it without "@"
I have a code lie this:
Code:
// Initialize List View Controller
MTListViewController *listViewController = [[MTListViewController alloc] init];
// Initialize Navigation Controller
UINavigationController *listNavigationController = [[UINavigationController alloc] initWithRootViewController:listViewController];
// Initialize Tab Bar Controller
UITabBarController *tabBarController = [[UITabBarController alloc] init];
// Configure Tab Bar Controller
[tabBarController setViewControllers:@[listNavigationController]];
Code:
[tabBarController setViewControllers:@[listNavigationController]] |
|
|
|
0
|
|
|
#2 |
|
The @ signifies an Obj-C literal. In this case, what you specifically want is an NSArray literal.
To get this same NSArray as a non-literal, you can do: Code:
NSArray *navigationControllerArray = [NSArray arrayWithObject:listNavigationController]; [tabBarController setViewControllers:navigationControllerArray animated:NO];
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed. Like it on Facebook! |
|
|
|
1
|
|
|
#3 | |
|
Quote:
__________________
2.4 MacBook Aluminum 480GB SSD/750GB Optibay 8GB RAM CE | MacBook 2.4 SR 4GB, 320GB HD | PB G4 1.67 | 15 TiBook-DVI 800 iPhone 4S 16GB | iPhone 5 32GB
|
||
|
|
0
|
|
|
#4 |
|
OP (and ArtOfWar), if you look at the UITabBarController header you'll find the relevant property:
Code:
@property(nonatomic,copy) NSArray *viewControllers; |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 01:46 AM.








Linear Mode
