Re: C struct and __unsafe_unretained
Re: C struct and __unsafe_unretained
- Subject: Re: C struct and __unsafe_unretained
- From: Charles Srstka <email@hidden>
- Date: Sun, 30 Oct 2011 12:41:05 -0500
On Oct 30, 2011, at 12:32 PM, James Merkel wrote:
> struct x { NSString *S; int X; } StaticArray[] = {
> @"foo", 42,
> @"bar, 97,
> ...
> };
>
> I use that pattern quite a bit in my code and haven't had any problems with it. These are basically constant strings that never change.
>
> With ARC, the compiler wants me to change the code to:
>
> struct x { __unsafe_unretained NSString *S; int X; }
>
> Aside from this looking really ugly, will the App store accept this in an application?
>
> The document on ARC says in order to do this task correctly, the code should be changed to a class. Ok, what class are they talking about?
They’re talking about:
@interface MyClass : NSObject
@property (strong) NSString *someString;
@property NSInteger someInteger;
@end
Charles_______________________________________________
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