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 8065551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:42:06+00:00 2026-06-05T11:42:06+00:00

I am following Big Nerd Ranch iOS Programming by Joe Conway and am kinda

  • 0

I am following Big Nerd Ranch iOS Programming by Joe Conway and am kinda puzzled when I saw the following code.

WebViewController.h

#import <Foundation/Foundation.h>
@interface WebViewController : UIViewController
@property (nonatomic, readonly) UIWebView *webView;
@end

WebViewController.m

#import "WebViewController.h"

@implementation WebViewController
- (void)loadView 
{
    // Create an instance of UIWebView as large as the screen
    // Tell web view to scale web content to fit within bounds of webview 
}

- (UIWebView *)webView
{
    return (UIWebView *)[self view];
}
@end

Shouldn’t one synthesize the property declared in .h file? Xcode didn’t give an warning either (which it usually does when I declare a property with synthesizing).

By the way, in the book, he also mentioned

In WebViewController.h, add a property (but not an instance variable)

Doesn’t declaring a property automatically generate an instance variable for you? Let me know what I missed. 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-05T11:42:08+00:00Added an answer on June 5, 2026 at 11:42 am

    This is because the “webView” getter method is implemented in the .m file and because of that, “@synthesize” isn’t necessary.

    If a “webView” method wasn’t explictly created in code, then the compiler would complain about the property not being synthesized. Synthesizing a “read only” property, in this case, would only create a “getter” method which would do roughly the same thing you see in the code up there.

    And yes, according to the Apple docs on declared properties, it says this about “@synthesize“:

    You use the @synthesize directive to tell the compiler that it should synthesize the setter and/or getter methods for a property if
    you do not supply them within the @implementation block. The
    @synthesize directive also synthesizes an appropriate instance
    variable if it is not otherwise declared.

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

Sidebar

Related Questions

I am following a book (Big Nerd Ranch IOS Programming) and the version of
I am following the Big Nerd Ranch iOS Programming Guide(3rd Edition), and have followed
Working off an idea from the Big Nerd Ranch guide to iOS programming, I'm
I'm reading through the Big Nerd Ranch book on iOS programming and I had
I am learning iOS programming through the Big Nerd Ranch guide by Hillegass and
I use the following code to append a big dom on a mobile browser
I have the following code but I'm not a big fan of reg exp
I am facing problem in big decimal no. Following code snippet will explain my
I have the following code: <div style=width:100% align=center> <img src=./platform-logos-big.png alt=Icons of platforms we
For the following Python code: fp = open('output.txt', 'wb') # Very big file, writes

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.