• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Converting to Arc → undeclared identifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting to Arc → undeclared identifier


  • Subject: Re: Converting to Arc → undeclared identifier
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 20 Aug 2013 19:31:23 +0700

On 20 Aug 2013, at 19:24, Uli Kusterer <email@hidden> wrote:

> You're missing an @synthesize privateData = _privateData; in your @implementation, would be my guess.

There is no @synthesize, this is true.
But Xcode normally does not mind, and I think this is (since when?) no longer necessary (maybe only in 64 bit?).

>
> On Aug 20, 2013, at 1:07 PM, Gerriet M. Denkmann <email@hidden> wrote:
>> Trying to convert an older project to Arc, Xcode complains about "Use of undeclared identifier '_privateDate'".
>> And threatens that nothing will be done unless I fix this first.
>>
>> Well - for one: without Arc there are no undeclared identifiers. (Builds without error or warnings).
>>
>> The class with problems looks like:
>>
>> @interface SomeClass( )
>>
>> @property (strong) NSDate *privateDate;
>>
>> @end
>>
>>
>> @implementation SomeClass
>>
>> - (id)initAt:(NSDate *)someDate ;
>> {
>> 	self = [ super init ];
>> 	if ( self == nil ) return nil;
>>
>> 	_privateDate = [ someDate retain ];
>>
>> 	return self ;
>> }
>>
>> ... some other stuff omitted ...
>>
>> @end
>>
>> I always thought that using accessors (like self.privateDate) in init methods was NOT a good idea, because at this point the thing might not be completely initialised and functional, so one had better use _privateDate directly.
>> And the accessor methods like setPrivateDate: might rely on a completely functional object.
>>
>> Is this correct?
>>
>> How to placate Xcode?
>>
>> Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Converting to Arc → undeclared identifier (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Converting to Arc → undeclared identifier (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Converting to Arc → undeclared identifier
  • Next by Date: Re: Converting to Arc → undeclared identifier
  • Previous by thread: Re: Converting to Arc → undeclared identifier
  • Next by thread: Re: Converting to Arc → undeclared identifier
  • Index(es):
    • Date
    • Thread