zoukankan      html  css  js  c++  java
  • 【Foundation Frame】Struct

    //
    //  main.m
    //  struct
    //
    //  Created by mac on 14-12-2.
    //  Copyright (c) 2014 mac. All rights reserved.
    //

    #import <Foundation/Foundation.h>

    #pragma mark 基本数据类型----
    void baseType()
    {
       
    //unsigned long  %lu
       
    NSUInteger i;
       
    //long
       
    NSInteger  j;
       
    //double
       
    NSTimeInterval  k;
    }

    #pragma 结构体---------------
    void structType()
    {
       
    //first type
       
    NSRange range = {34,67};
       
    NSLog(@"%lu,%lu",range.location,range.length);
       
    //second type
       
    NSRange range1 = {.location = 43, .length = 76};
       
    NSLog(@"%lu,%lu",range1.location,range1.length);
       
    //third type
       
    NSRange range3 = NSMakeRange(456, 789);
       
    NSLog(@"%lu,%lu",range3.location,range3.length);
       
       
    //example
       
    NSString *str =@"Hello,NSStruct";
       
    NSRange range4 = [str rangeOfString:@"Hello"];
       
    NSLog(@"%lu,%lu",range4.location,range4.length);
       
       
    //point
       
    NSPoint  point = NSMakePoint(0.0, 0.0) ;
       
    //size
       
    NSSize  size  = NSMakeSize(34.2, 123.1);
       
    //rect
       
    NSRect  rect  = NSMakeRect(0.0, 0.0, 234, 231);
       
       
    //CG 开头的结构体
       
    CGPoint point1 = CGPointMake(0.0, 0.0);
       
    CGSize  size1  = CGSizeMake(34.2, 123.1);
       
    CGRect  rect2  = CGRectMake(45.2, 34.2, 40, 60);
      
       
    CGPoint point2 = CGPointZero;
       
    CGSize  size2 = CGSizeZero;
       
    CGRect  rect3 = CGRectZero;
     
    }


    int main(int argc, const char * argv[]) {
       
    @autoreleasepool {
           
           
    structType();
        }
       
    return 0;
    }
  • 相关阅读:
    2014 ACM-ICPC Beijing Invitational Programming Contest
    面试算法爱好者书籍/OJ推荐
    最新版本号MYSQL官网下载地址可是必需要注冊后才干下载
    [ZJOI2019]开关
    2019-9-24-dotnet-remoting-使用事件
    2019-9-24-dotnet-remoting-使用事件
    2019-3-8-为何使用-DirectComposition
    2019-3-8-为何使用-DirectComposition
    2019-8-31-C#-获取-PC-序列号
    2019-8-31-C#-获取-PC-序列号
  • 原文地址:https://www.cnblogs.com/shujucn/p/7481457.html
Copyright © 2011-2022 走看看