zoukankan      html  css  js  c++  java
  • 小知识点

    1     [[UINavigationBar appearance] setBarTintColor:K_Custom_Color(23, 158, 250)];
    2 //    [[UINavigationBar appearance] setTitleTextAttributes:@{NSBackgroundColorAttributeName:[UIColor whiteColor]}];
    3     [self.navigationBar setTitleTextAttributes:
    4      
    5   @{NSFontAttributeName:[UIFont systemFontOfSize:19],
    6     
    7     NSForegroundColorAttributeName:[UIColor whiteColor]}];
    1 UIGestureRecognizerDelegate
    2 self.interactivePopGestureRecognizer.delegate = self;
    3 - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    4     
    5     return self.viewControllers.count >1;
    6 }
     1     UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
     2     btn.frame = CGRectMake(0, 0, 40, 40);
     3     btn.backgroundColor = [UIColor clearColor];
     4     
     5     [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
     6     [btn setImage:[UIImage imageNamed:@"fahui.png"] forState:UIControlStateNormal];
     7     [self.view addSubview:btn];
     8     
     9     
    10     
    11     UIBarButtonItem *rightBar = [[UIBarButtonItem alloc] initWithCustomView:btn];
    12     self.navigationItem.leftBarButtonItem = rightBar;
    13     
    14     btn.contentEdgeInsets = UIEdgeInsetsMake(0, -30, 0, 0);

     //scrollview引起侧边缘滑动手势失效的解决办法

    NSArray *gestureArray = self.navigationController.view.gestureRecognizers;
    
    for (UIGestureRecognizer *gesture in gestureArray) {
        if ([gesture isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) {
            [self.scrollView.panGestureRecognizer requireGestureRecognizerToFail:gesture];
        }
    }

     //小知识 大发现

    关于 UDID和UUID这两个东西

    UDID的全名为 Unique Device Identifier :设备唯一标识符。

    从名称上也可以看出,UDID这个东西是和设备有关的,而且是只和设备有关的,有点类似于MAC地址。

    需要把UDID这个东西添加到Provisoning Profile授权文件中,也就是把设备唯一标识符添加进去,以此来识别某一台设备。

    UDID是一个40位十六进制序列

    从iOS5之后,苹果就禁止了通过代码访问UDID,

    在这之前,可以使用[[UIDevice cuurrent] uniqueIdenfier] 这个方法来获取某设备UDID,现在是不可能了

    而在目前的SDK中,苹果提供了一个参数identifierForVendor来替代原来UDID的作用。通过代码实现如下:

    NSUUID *uuid = [UIDevice currentDevice].identifierForVendor; NSLog(@"uuid 1 = %@",uuid.UUIDString);
    

    此时打印出的字符串UUIDString这个东西不是真正的UDID,而是一个有一点像的替代品。如同我上面所说,UDID是只和iOS设备有关的,而这个identifierForVendor是应用和设备两者都有关的,A应用安装到张三这台设备上,就会产生一个identifierForVendor(比如是:1234);A应用安装到李四这台设备上,就会产生另一个identifierForVendor(比如是:5678);B应用安装到张三这台设备上,又是一个全新的identifierForVendor(比如是:9999),B应用安装到李四这台设备上,还是一个全新的identifierForVendor(比如是:7777)。但是无论A应用安装卸载多少次,产生的是都是1234. 所以我们知道,这个identifierForVendor是一种应用加设备绑定产生的标识符,相当于是:Z(identifierForVendor) = X(某应用) + Y(某设备)。 当然,和真正的UDID的区别是显而易见的:也就是说App的开发者没有办法去区分某一台设备了,而是只能识别某个应用在某台设备上。

    【UUID】英文名称是:Universally Unique Identifier,翻译过来就是通用唯一标识符。

    是一个32位的十六进制序列,使用小横线来连接:8-4-4-4-12 。

    UUID在某一时空下是唯一的。比如在当前这一秒,全世界产生的UUID都是不一样的;当然同一台设备产生的UUID也是不一样的。

    苹果宣称如果第三方应用开发者继续分享或者使用iPhone、Mac、AppleWatch的UDID的话,那么他们的应用将会禁止上架。为什么苹果要在应用中禁止使用呢?那是因为隐私问题。比如我开发了5款App,很多用户都下载了这5款App并使用。如果我能轻易的获取这些用户的UDID,其实我能拼凑出用户的很多信息。由于UDID本身的隐私属性,之前常常用来做第三方统计和其他的目的。当然现在也有人使用MAC地址来识别设备,因为MAC地址也唯一的识别了一台设备并且不会被修改

    有时候一个小的发现 总能把自己好多的困惑串联起来 并解决掉

    ----------------------------------------------------------------------------------------------

    更改textField的placeholder的颜色透明度

            [textField setValue:[UIColor blackColor] forKeyPath:@"_placeholderLabel.textColor"];
            [textField setValue:[NSNumber numberWithFloat:.6] forKeyPath:@"_placeholderLabel.alpha"];
  • 相关阅读:
    【Codechef】Chef and Bike(二维多项式插值)
    USACO 完结的一些感想
    USACO 6.5 Checker Challenge
    USACO 6.5 The Clocks
    USACO 6.5 Betsy's Tour (插头dp)
    USACO 6.5 Closed Fences
    USACO 6.4 Electric Fences
    USACO 6.5 All Latin Squares
    USACO 6.4 The Primes
    USACO 6.4 Wisconsin Squares
  • 原文地址:https://www.cnblogs.com/dlwj/p/5816817.html
Copyright © 2011-2022 走看看