Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8541849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:55:26+00:00 2026-06-11T11:55:26+00:00

I am using Xcode 4.4.1. When I define @property like UINavigationController or NSArray in

  • 0

I am using Xcode 4.4.1. When I define @property like UINavigationController or NSArrayin .h file I have to @synthesize it in .m file. But some @property like UITabBarController or NSString I don’t have to @synthesize it to make it work.

My Question is what @propertys need to @synthesize and what need not to.

AppDelegate.h

@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
UITabBarController *_tabBar;
UINavigationController *_navBar;
}

@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) Employee *empView;
@property (nonatomic, retain) UITabBarController *_tabBar;
@property (nonatomic, retain) UINavigationController *_navBar;

AppDelegate.m

@implementation AppDelegate
@synthesize _navBar;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
Employee *emp = [[Employee alloc]initWithNibName:@"Employee" bundle:nil];
self._tabBar = [[UITabBarController alloc]init];
self._navBar = [[UINavigationController alloc]initWithRootViewController:emp];
self._tabBar.viewControllers = [NSArray arrayWithObjects:_navBar, nil];
self.window.rootViewController = self._tabBar;
self._navBar.navigationBar.tintColor = [UIColor brownColor];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}

When I @synthesize UINavigationController I get UINavigationController and UITabBarController. But when I don’t @synthesize UINavigationController I don’t get UINavigationController but UITabBarController is displayed.

In both cases I didn’t @synthesize UITabBarController

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:55:27+00:00Added an answer on June 11, 2026 at 11:55 am

    Since the last version of the compiler (LLVM) shipped with Xcode 4.4, the @synthesize directive is not needed anymore.

    Every @property you declare for which you don’t use @synthesizeexplicitly will have its accessor synthesized automatically as if you wrote @synthesize yourprop = _yourprop;. That’s a new feature of the latest compiler (as before you had to write @synthesize (or implement the accessors) for all your @properties explicitly).

    Note that of course you can still use the @synthesize property explicitly if you prefer to (just like old times). This can be a way to explicitly design the backing instance variable to use for the property. But as a matter of fact I strongly recommend to forget about instance variables (in fact that’s ages I don’t use explicit instance variables between the curly braces of my @interface declaration anymore), and only work with @property declarations. With that and the new feature that let the compiler generate the @synthesize directives for you, you will avoid a lot of glue code and make your classes more compact to write.


    FYI you can toggle a warning when you have a @property for which is implicitly synthesized (meaning for which you didn’t write the @synthesize directive explicitly thus for which the compiler now synthesize it for you). Simply go to the Build Settings of your project and turn on the “Implicit Synthesized Properties” warning (under “Apple LLVM compiler 4.0 – Warnings – Objective-C” section), and the compiler will tell you about all the properties for which it implicitly synthesize the accessors as you didn’t mention the @synthesize directive yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to define an Objective-C block property but still have full-code completion
I have created a UIView object using the contents of a NIB file like
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I am using xcode 4, Compiler version LLVM GCC 4.2. I have been trying
I'm using XCode for some iOS development and the watch window for viewing STL
I'm using Xcode 4.3 and I have followed this user's steps to create the
I'ld like to automatically detect (using #ifdef) whether I'm building using XCode or using
I am using Xcode 4.2 and have a UIViewController representing one of the scenes.
I am using Xcode 3.2.5 with the LLVM 1.6 compiler. Some of my classes
i am coding a program for iPhone using Xcode. i defined some attributes for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.