Solved

Property/Synthesize difference between debug and release

Posted on 2010-08-12
3
1,228 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Global Keyboard Hooks Blocked 4 81
firstChar challenge 13 121
Acrinis True image 2 92
Windows 2012 R2 -- create 3.5TB GPT from unallocated space ? 1 53
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

839 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