/*
performSelector:withObject:afterDelay:
Invokes a method of the receiver on the current thread using the default mode after a delay.
- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay
Parameters
aSelector
A selector that identifies the method to invoke. The method should not have a significant return value and should take a single argument of type id, or no arguments.
See “Selectors” for a description of the SEL type.
anArgument
The argument to pass to the method when it is invoked. Pass nil if the method does not take an argument.
delay
The minimum time before which the message is sent. Specifying a delay of 0 does not necessarily cause the selector to be performed immediately. The selector is still queued on the thread’s run loop and performed as soon as possible.
Discussion
This method sets up a timer to perform the aSelector message on the current thread’s run loop. The timer is configured to run in the default mode (NSDefaultRunLoopMode). When the timer fires, the thread attempts to dequeue the message from the run loop and perform the selector. It succeeds if the run loop is running and in the default mode; otherwise, the timer waits until the run loop is in the default mode.
*/
//loadTimeline是要延迟执行的方法,afterDelay:是要延迟的时间。这里是0.5秒
[self performSelector:@selector(loadTimeline) withObject:nil afterDelay:0.5];
分享到:
相关推荐
这儿的运行时系统扮演的角色类似于Objective-C语言的操作系统,Objective-C基于该系统来工作。本文档将具体介绍NSObject类以及Objective-C程序是如何和运行时系统交互的。特别地,本文档还给出来怎样在运行时动态地加
Objective-C语言的许多决策可以在编译和运行时执行。只要有可能,它是动态的。这意味着Objective-C语言不仅需要一个编译器,还需要一个运行时系统来执行编译的代码。Runtime系统是一种用于Objective-C语言的操作系统...
《objective-c程序设计》通过大量的实例系统地介绍了objective-c语言的基本概念、语法规则、框架、类库及开发环境。读者在阅读《objective-c程序设计》后,可以掌握objective-c语言的基本内容,并进行实际的iphone/...
Objective-C是一种面向对象的编程语言,广泛应用于Mac OS和iOS开发。通过学习Objective-C的基本语法、类和对象、控制流程和方法等内容,你将能够编写简单的Objective-C程序并逐渐掌握更复杂的概念。继续学习和实践,...
《Objective-C 程序设计(第4版)》已经为iOS 5和Xcode4.2中的重大变更做了全面更新,最大的改动是引入了自动引用计数(ARC),并详细说明了如何在Objective-C编程过程中使用ARC提升和简化内存管理。
用Objective-C语言实现了各种设计模式,收集各种例子,方便大家学习和普及设计模式。.zip用Objective-C语言实现了各种设计模式,收集各种例子,方便大家学习和普及设计模式。.zip用Objective-C语言实现了各种设计...
C语言主要知识点巩固(学习Objective-C 的前提),PPT格式。
中文名: Objective-C基础教程 作者: Mark Dalrymple Scott Knaster译者: 高朝勤 杨越 刘霞图书 分类: 软件 资源格式: PDF 版本: 扫描版 出版社: 人民邮电出版社 书号: ISBN: 9787115208774 发行时间: 2009...
Objective-C 基础教程,从入门到精通 Objective-C 基础教程,从入门到精通,是你学习 Objective-C 的经典之作。
Objective-C 是一种通用、面向对象的编程语言,广泛应用于 macOS 和 iOS 等苹果平台的开发中。它是 C 语言的超集,结合了 Smalltalk 式的消息传递机制和 C++ 的特性。Objective-C 是苹果公司采用的主要编程语言之一...
Amazon超级畅销书,好评如潮,全面解读Objective-C语言及Cocoa特性,用最通俗的语言阐释深奥的知识。 Objective-C是扩展C的面向对象编程语言,也是iPhone开发用到的主要语言。 本书结合理论知识与示例程序,全面...
在windows系统下搭建Objective-C开发环境,由于公司要做iphone开发,个人学习objc(Objective-C)语法,所以在windows7下搭建了一个objc开发环境,现把自己整理的帮助文档拿来与大家分享,希望能对大家有所帮助。...
elcome to Learn Objective- C on the Mac! This book is designed to teach you the basics of the Objective- C language. Objective- C is a superset of C and is the language used by many (if not most) ...
Objective-C是扩展C的面向对象编程语言,也是iPhone开发用到的主要语言。本书结合理论知识与示例程序,全面而系统地讲述Objective-C编程...附录中还介绍了如何从其他语言过渡到Objective-C。 本书适合各类开发人员阅读
这是一个基于Objective-C语言的基础案例集。旨在用于给初学者快速了解Objective-C语言的语法。.zip
Objective-C高级编程 iOS与OS X多线程和内存管理.pdf
全书共分为四大部分:第一部分全面讲解了Objective-C语言的基础知识,包括类、对象、方法、数据类型、表达式、程序结构、继承、多态、动态类型和动态绑定、函数、数组、结构和指针等;第二部分详细阐述了Foundation...
资源里面包含Objective-C 2.0程序设计 原书中文版第2版及代码,还包含Effective Objective-C 2.0英文版完整的电子书