Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Property/Synthesize difference between debug and release

Posted on 2010-08-12
3
Medium Priority
?
1,264 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 and use switch statements in the C programming language.

618 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