• RunLoop和autorelease的一道面试题

    时间:2022-08-31 17:16:33

    有这么一道iOS面试题 以下代码有没有什么问题?如果有?如何解决?for (int i = 0; i < largeNumber; i++) {NSString *str = [NSString stringWithFormat:@"hello -%04d", i];str = [str st...

  • 八.OC基础加强--1.autorelease的用法 2.ARC下内存管理 3.分类(category)4.block的学习

    时间:2022-08-25 14:41:50

    1.autorelease的用法  1、自动释放池及autorelease介绍 (1)在iOS程序运行过程中,会创建无数个池子,这些池子都是以栈结构(先进后出)存在的。 (2)当一个对象调用autorelease时,会将这个对象放到位于栈顶的释放池中 。2、为什么会有autorelease? OC的...

  • ARC forbids explicit message send of 'autorelease'错误

    时间:2022-04-05 15:53:44

    (ARCforbidsexplicitmessagesendof'autorelease'错误)在ios中经常会遇到:ARCforbidsexplicitmessagesendof'autorelease'或“ARCforbidsexplicitmessagesendofrelease”这样的错误。...

  • ios开发之路十一(ARC forbids explicit message send of 'autorelease'错误)

    时间:2022-04-05 15:58:44

    在ios中经常会遇到:ARCforbidsexplicitmessagesendof'autorelease'或“ARCforbidsexplicitmessagesendofrelease”这样的错误。原因可能是项目使用了arc机制而有些文件禁止使用而报错,解决方法:1.禁用在Xcode中的特定文...

  • RunLoop总结:RunLoop 与GCD 、Autorelease Pool之间的关系

    时间:2021-07-23 06:04:52

    如果在面试中问到RunLoop相关的知识,很有可能也会问到RunLoop与GCD、AutoreleasePool有没有关系,哪些地方用到了GCD、AutoreleasePool等。So,本文就总结一下RunLoop与GCD和AutoreleasePool之间的关系,看看在RunLoop实现中,哪些地...