Hi there,

I'm trying to process a MAC Address into Hex so I was going to do something like.

NSArray *macArray=[[NSArray alloc] init];
macArray=[mac componentsSeparatedByString:@":"];
for (int i=0; i < [macArray count] ;  i++)
        {
//somehow need to get an int called dec from the number in the NSString then...
        NSString *hex=stringWithFormat:@"%x",dec;
        [macArray[i] autorelease];
        macArray[i]=hex;

        }

My main question is how to get an int from an NSString, but also, if you could have a look at the rest of the contents of the for loop I'd be grateful as I'm sure I'm making a pigs ear of the memory management there. Sort of had a feeling that it would be autorelease as I thought that the substrings in the array would be the responsibility of the array rather than me, but other than that I was a bit boggled.

Thank you all.

Adam
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to