Comment 3 for bug 1024651

Revision history for this message
hilaire (hilaire-fernandes) wrote : Re: [Bug 1024651] Re: A link to Dr. Geo web page

I convert it in a portable code as below, Does it look correct for you ? :

openURI: aString
    | sharedApp nsUrl nsStringUTF8 urlWithString |
    sharedApp := ((Smalltalk at: #ObjectiveCBridge) perform:
#classObjectForName: with: #UIApplication) perform: #sharedApplication.
    nsUrl := (Smalltalk at: #ObjectiveCBridge) perform:
#classObjectForName: with: #NSURL.
    nsStringUTF8 := aString perform: #asNSStringUTF8.
    urlWithString := nsUrl perform: #URLWithString: with: nsStringUTF8.
    sharedApp perform: #openURL with: urlWithString.

    "(ObjectiveCBridge classObjectForName: #UIApplication)
sharedApplication
        openURL: ((ObjectiveCBridge classObjectForName: #NSURL)
URLWithString: 'http://www.drgeo.eu' asNSStringUTF8)"

Le 29/01/2013 16:54, Esteban Lorenzano a écrit :
> (ObjectiveCBridge classObjectForName: #UIApplication) sharedApplication
> openURL: ((ObjectiveCBridge classObjectForName: #NSURL) URLWithString: 'http://www.drgeo.eu' asNSStringUTF8)

--
Dr. Geo - http://drgeo.eu