Solved

Property/Synthesize difference between debug and release

Posted on 2010-08-12
3
1,243 Views
Last Modified: 2013-12-26
I'm declaring a property in my *.h file:

@property NSString * URL;

I add a "Synthesize" in my *.m file:

@synthesize URL;

Building and running in debug works fine. Making use of it and it seems healthy. Building release mode yields an error:  synthesized property 'URL' must either be named the same as a compatible ivar or must explicitly name an ivar

what am I doing wrong?



0
Comment
Question by:ronenmagid1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 500 total points
ID: 33423139
Seems like you make programs for Mac OS X and not for iPhone. I'm really glad. :)

You wrote:
@property NSString * URL;

so everything is by default: readwrite and assing are the attributes, the setter and the getter will be generated and will have URL and setURL names.
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW2

For NSString, I'd use retain or copy, but not assign. At least it is so for a common case.

The answer: the release configuration is 32-bit. The debug is 64 bit and so you can declare the property (it works so since Xcode 3.2.2?). For the 32-bit version we have to declare a variable and then the property. So for a test,  add NSString* URL into the class. If the project will be compiled in debug and release, so I'm right.
 
0
 

Author Closing Comment

by:ronenmagid1
ID: 33423242
yep. thanks!
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33423298
You are welcome.

0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question