Solved

Property/Synthesize difference between debug and release

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now