iOS 에서 열 거 된 사용법
NSLog(@"Hello, World!");
// ,key-value
NSDictionary *myDic=[[NSDictionary alloc]initWithObjectsAndKeys:@" ",@"name",@" ",@"name", nil];
NSUInteger count = [myDic count];
NSLog(@" : %lu",count);
// myDic key
NSEnumerator * myEnumerator = [myDic keyEnumerator];
for (NSObject *object in myEnumerator) {
NSLog(@" KEY : %@",object);
}
// myDic value
myEnumerator = [[myDic allValues] objectEnumerator];
NSString *value;
while((value = [myEnumerator nextObject]))
{
NSLog(@" : %@",value);
}
// KEY value
NSObject *myObject = [myDic objectForKey:@"name"];
if (myObject != nil) {
NSLog(@" KEY value : %@",myObject);
}
NSMutableDictionary *mydic2 = [NSMutableDictionary dictionaryWithCapacity:10];
[mydic2 setObject:@"Alex Hu" forKey:@"name"];
[mydic2 setObject:@"1388888888" forKey:@"mobile number"];
// mydic2 value
for (NSObject *object in [mydic2 objectEnumerator]) {
NSLog(@" : %@",object);
}
NSSet *mySet=[NSSet setWithObjects:@"A",@"B",@"C",@"D",[NSNumber numberWithInteger:123], nil];
count=[mySet count];
NSLog(@"count= %lu",count);
// mySet
myEnumerator=[mySet objectEnumerator];
for (NSObject *object in myEnumerator) {
NSLog(@"myEnumerator value=%@",object);
if ([object isEqualTo:@"A"]) {
NSLog(@" A ");
}
if ([object isEqual:@"B"]) {
NSLog(@" B");
}
}
// mySet NSArray
NSArray *mySetArr=[mySet allObjects];
for (NSUInteger i=0; i%@",i,[mySetArr objectAtIndex:i]);
}
if ([mySet containsObject:@"D"]) {
NSLog(@" D ");
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
View의 레이아웃 방법을 AutoLayout에서 따뜻한 손 계산으로 하면 성능이 9.26배로 된 이야기이 기사는 의 15 일째 기사입니다. 어제는 에서 이었습니다. 손 계산을 권하는 의도는 없고, 특수한 상황하에서 계측한 내용입니다 화면 높이의 10 배 정도의 contentView가있는 UIScrollView 레이아...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.