iOS Question How to get the country Code

Brian Robinson

Active Member
Licensed User
Longtime User
Hi All,

I am attempting to get the country code of the device based off the ISO value.

I found this bit of code:

NSString *countryCode = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];

and I have attempted to write it like this, but I am unsure how to specify the NSLocaleCountryCode value. This is what I have so far:
Private Sub GetCountryCode As String
    Dim no As NativeObject
    Return no.Initialize("NSLocale") _
        .RunMethod("currentLocale", Null).RunMethod("objectForKey:", Array("NSLocaleCountryCode")).AsString
End Sub

Any ideas?