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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:26:36+00:00 2026-06-03T02:26:36+00:00

I handled several issues recently when working on my company’s iOS project using XCode

  • 0

I handled several issues recently when working on my company’s iOS project using XCode 4.2 and Apple LLVM complier 3.0 / LLVM-GCC.

Below is the code

A.h
@interface A{
   int _count;
};
@property(nonatomic,assign) count; 
@end
A.mm
@implementation A
@synthesize count = _cont;//note a typo here !!!
//... I use _count in below code 
@end

The typo will not generate a compile error or warning, the compiler or run-time (actually I am not sure who did it, to my best guess should be the compiler) will generate a _cont instance ivar for us.

This feature is great for encapsulation. Our header files could be much cleaner. However such a typo is hard to notice. So I am wondering if are there any setting to generate warning for this case? I search Clang’s official site without any finding.

Someone would suggest me to not declare the instance in class interface at all and always use self.count. first I don’t like this code style, second there are cases your “setCount” method may do something more than just change the instance value,lastly we began our product before this feature is introduced. I don’t want to change exist code’s style.

Does anyone here encounter the same problem? Are there any good ideas and best practice ?

  • 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-03T02:26:38+00:00Added an answer on June 3, 2026 at 2:26 am

    This is not possible. How should the compiler recognize your typo?

    Also you should have recognized that it is not necessary to write your own ivar for your property anymore, as @synthesize count = _count; is already enough to reach you iVar via _count later in the code.

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

Sidebar

Related Questions

I am developing an iOS app that must handle several stereo audio files (ranging
I've seen several of answers about using Handle or Process Monitor , but I
I recently ran across several objects implemented to handle events with a hard coded
How have you guys handled working with jQuery includes <script type=text/javascript src=jquery.js></script> in Asp.Net
Currently I am designing a database for use in our company. We are using
I just started using C# and I've got a couple of issues. Is there
I'm having some issues using the following code on user input: htmlentities($string, ENT_COMPAT, 'UTF-8');
I have recently joined a group with some severe JUnit testing issues. One problem
It's been several days that I got deadlock issues on a Java application with
What is the best way to handle several different onload scripts spread across many

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.