iOSFont assigned to a variable?

So this code works:

Dim italicfont As New iOSFont("Helvetica-Oblique", 10) uppLineOriginalLabel.TextFont = italicfont

But this doesn’t:

Dim largefont As New iOSFont.BoldSystemFont(18) uppStatStrOriginalLabel.TextFont = largefont

What am I doing wrong?

my guess… the first example is calling the object constructor
the second is attempting to call a method inside the iOSFont class, but the instance of the class does not yet exist

The second is a shared method so it should be OK

You can’t use “New” with a method. BoldSystemFont is a shared method, so you’d just set it up like this:

Dim largefont As iOSFont = iOSFont.BoldSystemFont(18) uppStatStrOriginalLabel.TextFont = largefont

Thanks, Paul!

heh … overlooked the “new”

note to self … dont try & work & read the forums posts at the same time :slight_smile:

The documentation has sample code for the first case. Might I suggest adding sample code for the second case as well?

The shared methods do all have sample code.

http://developer.xojo.com/iosfont$BoldSystemFont