zoukankan      html  css  js  c++  java
  • Objective

    NSRange (location length)

    "I love oc"
    NSRange r = NSMakeRange(2,4)

    NSString *str = @"i love you";

    NSRange range = [str rangeofString:@"love"];

    NSLog(@"loc = %ld, length = %ld",range.location, range.length);

    找不到length = 0,location = NSNotFound == -1(涉及符号位)

    NSPointCGPoint 跨平台

    CGPoint p = NSMakePoint(10, 10);
    NSPoint p = CGPointMake(20, 20);

    CGSize s = NSMakeSize(20, 20);
    NSSize s = CGSizeMake(100,100);

    NSRectCGRect(CGPoint CGSize)
    CGRect r = CGRectMake(0, 0, 2, 3);

    origin.x
    origin.y
    sieze.width
    sieze.height

    NSLog("%@",[NSStringFromeSize(s)]);
    NSStringFromeRect(r)

    CGPointZero == CGPointMake(0, 0)
    CGRect r1 = {CGPointZero, CGSizeMake(100, 100)};

    BOOL b = CGPointEqualToPoint(CGPointMake(10, 10), CGPointMake(10, 20));
    CGRectEqualToRect

    BOOL b = CGRectContainsPoint(CGRectMake(40, 50, 60, 70), CGPointMake(80, 80));
    CG = CoreGraphics框架

    NS = NextStep 的 Foundation

  • 相关阅读:
    sprinf sprintf_s 的用法
    c++中static的用法详解
    C++数值类型与string的相互转换
    setTimeout(function(){}, 0);
    学习 Node.js 的 6 个步骤
    $destroy——angular
    模态框——angular
    日期控件
    前端加密
    ui-router
  • 原文地址:https://www.cnblogs.com/fangchun/p/4658394.html
Copyright © 2011-2022 走看看