zoukankan      html  css  js  c++  java
  • 多线程里处理

    t is true that apple recommends using elements from the UIKIt on the main thread:

    Note: For the most part, UIKit classes should be used only from an application’s main thread. This is particularly true for classes derived from UIResponder or that involve manipulating your application’s user interface in any way.

    Since UIImage isn't derived from UIResponder, and you do not actually display it on the interface/screen. Then doing operations with UIImages on another thread should be safe.

    This is however based on my experience, I haven't seen any official documentation about it.

      照相机,选取图片在图片处理可以使用线程来处理,避免卡顿。

    http://inessential.com/2013/12/20/observers_and_thread_safety

    在线程立马post notification会有什么效果?小心observer被回收了,导致app crash。 

    1.要么你保证obsever在post notification之后会后

    2.使用block api 

    3. 保证不被回收

    4. 不在线程里面post notification

  • 相关阅读:
    修改spring boot 启动logo
    查看jvm常用命令
    intellij IDEA破解
    hdu 新生晚会
    How many prime numbers(素数)
    2077 汉诺塔IV
    Factorial
    双人黑白块
    EasyX
    七夕情人节
  • 原文地址:https://www.cnblogs.com/studyNT/p/4585421.html
Copyright © 2011-2022 走看看