ȥå   Խ ʬ Хåå ź ʣ ̾ѹ   ñ측 ǽ   إ   ǽRSS

Objective-C/ʸˡ

Last-modified: 2009-06-03 () 04:12:11 (3094d)
Top / Objective-C / ʸˡ

Objective-C

ܾ

إåĥ.h
᥽åĥ.m

ȵˡ

  • //
  • /* */

print, echo

Хȿ
char1'A'
short2-100, 0xff
unsigned short2100, 0xff
int4-100, 0xff
unsigned int4100, 0xff
long long8-100, 0xff
unsigned long long8100, 0xff
float3.14f, 1.2e3f
double3.14, 1.2e3
BOOL
  • longintƱХȿǤ

Cocoa TouchǤ褯Ȥ饹

Хȿ
idǤޤޤʥ֥ȤǤޤ
NSStringǤUnicode@"ʸ"

ˡ

Ѥ

̣̾
nil̵ʥ֥NSString* str; str = nil;
NULLasciizʸνüʸ
?
?

ѿ

󡦥ϥå

ˡ

ϥåˡ

ͤFALSEȤʤޤ

  • nil
  • integer0


ʸ黻

ʸ

ץ󥹰

\xnn16ʿɽΣʸ
\rå꥿, CR, 0x0d
\n, LF, 0x0a
\tʿ
\"Ű
\\\

湽¤

ʳcƱǤ

®

NSArray arFriends;
arFriends = [NSArray arrayWithObjects:"Tom", @"Cindy", @"Ben", nil];
for (NSString* strName in arFriends) {
	// strNameѤ
}
// inϷ֤ǥԡѿȷǤ
// inθNSArray, NSDictionary, NSSetȤäCocoa TouchΥ쥯󥯥饹Ǥ

ؿ

// ̵᥽åɤθƤӽФ
NSString* str;
str = @"hello world";
int iLength;
iLength = [str length];
// [ѿ̾ ᥽å̾]
// ĤΥ᥽åɸƤӽФ
NSString* str;
str = @"hello world";
unichar uc;
uc = [str characterAtIndex:0];
// [ѿ̾ ᥽å̾:]
// ĤΥ᥽åɸƤӽФ
NSString* str;
str = @"hello world";
NSRange range;
range = [str rangeOfString:str
		options:NSCaseInsensitiveSearch];
// [ѿ̾ ᥽å̾:
//     ٥:]

饤֥ꡦ󥯥롼ɥե