Re: Converting to Arc → undeclared identifier
Re: Converting to Arc → undeclared identifier
- Subject: Re: Converting to Arc → undeclared identifier
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 20 Aug 2013 20:43:46 +0700
On 20 Aug 2013, at 20:27, Fritz Anderson <email@hidden> wrote:
> Sure, but the whole point the OP is trying to make is that the purported error is being raised by the refactoring process that is _supposed to remove that retain_. Refactoring would be a very easy process indeed if doing the conversion yourself is a prerequisite of having Xcode do it.
>
> The use of the _ivar should work ― did work as far as the production compiler knew.
>
> Is the code the OP posted the whole context? Has he tried to convert that minimal example, and gotten the same error? Has he examined the preprocessed code (and then searched for the no-underscore name of the @property) to see if anything suggests itself?
Created a new project (not document based) removed arc in build settings, modified the AppDelegate thus:
#import "T1AppDelegate.h"
@interface T1AppDelegate ()
@property (strong) NSDate *myDate;
@end
@implementation T1AppDelegate
- initWithDate: (NSDate*)aDate
{
self = [super init];
if ( self == nil ) return nil;
_myDate = [ aDate retain];
return self;
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
}
@end
Nothing edited (except some comments at the very top).
Builds without errors. As expected.
Tried Edit → Refactor → Convert to Objective-C ARC
Got: "Xcode found 1 issue that prevents conversion from proceeding. Fix all ARC readiness issues and try again."
The offending line is:
_myDate = [ aDate retain];
Adorned with the remark "Use of undeclared identifier '_myDate'"
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