Mobile, iPhone, Mac, Games and Coding

iPhone

iPhone UIFont List

Here is a list of fonts available on the iPhone with UIFont.

Font Family: American Typewriter
Font: AmericanTypewriter
Font: AmericanTypewriter-Bold

Font Family: AppleGothic
Font: AppleGothic

Font Family: Arial
Font: ArialMT
Font: Arial-BoldMT
Font: Arial-BoldItalicMT
Font: Arial-ItalicMT

Font Family: Arial Rounded MT Bold
Font: ArialRoundedMTBold

Font Family: Arial Unicode MS
Font: ArialUnicodeMS

Font Family: Courier
Font: Courier
Font: Courier-BoldOblique
Font: Courier-Oblique
Font: Courier-Bold

Font Family: Courier New
Font: CourierNewPS-BoldMT
Font: CourierNewPS-ItalicMT
Font: CourierNewPS-BoldItalicMT
Font: CourierNewPSMT

Font Family: DB LCD Temp
Font: DBLCDTempBlack

Font Family: Georgia
Font: Georgia-Bold
Font: Georgia
Font: Georgia-BoldItalic
Font: Georgia-Italic

Font Family: Helvetica
Font: Helvetica-Oblique
Font: Helvetica-BoldOblique
Font: Helvetica
Font: Helvetica-Bold

Font Family: Helvetica Neue
Font: HelveticaNeue
Font: HelveticaNeue-Bold

Font Family: Hiragino Kaku Gothic ProN W3
Font: HiraKakuProN-W3

Font Family: Hiragino Kaku Gothic ProN W6
Font: HiraKakuProN-W6

Font Family: Marker Felt
Font: MarkerFelt-Thin

Font Family: STHeiti J
Font: STHeitiJ-Medium
Font: STHeitiJ-Light

Font Family: STHeiti K
Font: STHeitiK-Medium
Font: STHeitiK-Light

Font Family: STHeiti SC
Font: STHeitiSC-Medium
Font: STHeitiSC-Light

Font Family: STHeiti TC
Font: STHeitiTC-Light
Font: STHeitiTC-Medium

Font Family: Times New Roman
Font: TimesNewRomanPSMT
Font: TimesNewRomanPS-BoldMT
Font: TimesNewRomanPS-BoldItalicMT
Font: TimesNewRomanPS-ItalicMT

Font Family: Trebuchet MS
Font: TrebuchetMS-Italic
Font: TrebuchetMS
Font: Trebuchet-BoldItalic
Font: TrebuchetMS-Bold

Font Family: Verdana
Font: Verdana-Bold
Font: Verdana-BoldItalic
Font: Verdana
Font: Verdana-Italic

Font Family: Zapfino
Font: Zapfino

Gotcha with Obj-C properties

Properties in Objective-C can be quite useful sometimes, but you have to be careful because they don’t always work how you think they should. Here is a common gotcha among people new to Obj-C and properties.

Consider we have a class called Sprite, which has a property called position.

@interface Sprite : NSObject {
  CGPoint position;
}

@property (readwrite) CGPoint position;

@end

CGPoint is a struct with 2 int variables, x and y.

Lets create one:

Sprite mySprite* = [[Sprite alloc] init];

Now consider the situation of getting and setting the position.

Getting
When you call this:

CGPoint pos = mySprite.position;

It is actually the same as:

CGPoint pos = [mySprite position];

Here its clear that pos is a copy of the position (its not a reference
to the instance variable).

Setting
When you can call:

mySprite.position = pos;

It is actually the same as:

[mySprite setPosition:pos];

OK this is probably fairly clear so far!

The Gotcha
Now this is where the issue happens.

When you call this:

mySprite.position.y = 99;

It is actually the same as this:

[mySprite position].y = 99;

In this instance, the position variable of mySprite is not changed at all.

So when using properties, try to be aware of what Objective-C is actually doing behind the scenes :)

Deactivate iTunes account on iPhone

Was having trouble figuring out how to deactivate the itunes account on the iPhone.

I finally figured it out though:

1. Plug in your iPhone into your computer.
2. Open up iTunes.
3. Sign out of iTunes account on your computer (on Mac, this is under the Store menu).