Re: NSArray's objectAtIndex compiles to objectAtIndexedSubscript? SOLVED
Re: NSArray's objectAtIndex compiles to objectAtIndexedSubscript? SOLVED
- Subject: Re: NSArray's objectAtIndex compiles to objectAtIndexedSubscript? SOLVED
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 09 Mar 2014 09:17:59 -0400
I just realized that there is a bug in my +QSWStandardizedSystemVersion method that explains the crash. The fault is NOT the -objectAtIndex: message. It is instead the 3
versionComponentStrings[x] subscripted messages, which of course compile to -objectAtIndexedSubscript:. I was thinking of versionComponentStrings as a C array when it is actually an NSArray object.
NSArray *versionComponentStrings = [versionString componentsSeparatedByString:@"."];
static unsigned long sBCDSystemVersion = 0;
SInt32 majorVersion = ([versionComponentStrings count] >= 1) ? [versionComponentStrings[0] intValue] : 0;
SInt32 minorVersion = ([versionComponentStrings count] >= 2) ? [versionComponentStrings[1] intValue] : 0;
SInt32 bugFixVersion = ([versionComponentStrings count] >= 3) ? [versionComponentStrings[2] intValue] : 0;
Sorry for the noise.
--
Bill Cheeseman - email@hidden
_______________________________________________
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