Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCode 4.4.1 Error Macro ARC #11

Open
kajinka13 opened this issue Aug 10, 2012 · 4 comments
Open

XCode 4.4.1 Error Macro ARC #11

kajinka13 opened this issue Aug 10, 2012 · 4 comments

Comments

@kajinka13
Copy link

I would like to report an error in the use of macros to support ARC.

file: TBXML+HTTP.m:

/****************************************************************/

ifndef ARC_ENABLED <<<<<<< error, invert control

return [request autorelease];

else

return request;

endif

FIX:

ifdef ARC_ENABLED

return [request autorelease];

else

return request;

endif

/****************************************************************/

ifndef ARC_ENABLED <<<<<<< error, invert control

[params release];
return [request autorelease];

else

return request;

endif

FIX:

ifdef ARC_ENABLED

[params release];
return [request autorelease];

else

return request;

endif

/****************************************************************/

file: TBXML.m:

/****************************************************************/

ifndef ARC_ENABLED <<<<<<< error, invert control

[super dealloc];

endif

FIX:

ifdef ARC_ENABLED

[super dealloc];

endif

/****************************************************************/

value = [NSString stringWithString:@""]; <<<<<<< fix warning

FIX:

value = @"";
/****************************************************************/

@proth
Copy link

proth commented Aug 31, 2012

+1 thank you

@kpower
Copy link

kpower commented Oct 8, 2012

Your fix won't work when ARC is disabled. The problem here is not in inverted control. ARC_ENABLED is enabled in TBXML-Prefix.pch (for OS X build) and in TBXML-iOS-Prefix.pch there is no ARC_ENABLED management. So to fix the first issue you should add similar code there (you can simply copy it from TBXML-Prefix.pch).

@MartinMReed
Copy link

See pull request #23. The fix is to use __has_feature(objc_arc) instead of ARC_ENABLED

@kpower
Copy link

kpower commented Oct 31, 2013

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants