Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

iphone - Complete list of Lifecycle functions of ViewController from Starting To End of that Life without using the NIB and With using NIB?

I want complete list of lifecycle functions of view controller with correct sequence.Please any genius.

Please specify with Exact sequence number and From start to End of ViewController's LifeCycle Functions.

Please specify with sequence Number like with usage: and with only short description. example:

with using NIB

1.alloc

usage:blah..blah..

2..init

usage:blah..blah..

3...viewdidload

usage:blah..blah..

without using NIB

1.alloc

usage:blah..blah..

2..init

usage:blah..blah..

3...viewdidload

usage:blah..blah..

..

..

..

Everyone listen please, we have to first understand this concept to make easy as a iPhone Developer.

Once we understand all of them correctly then we can make anything easier.

I have searched for this Google but i can't get the right answer.

because everyone said different according to their understanding and this make me so confusing more.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To figure out in what order they are called you could use the debugger and a couple of breakpoints or simply put a NSLog(@"viewDidLoad was called"); call in each method.

Experienced programmers would use NSLog(@"%s", __PRETTY_FUNCTION__); because it automatically prints the method name and can be copied&pasted faster.

The View Controller Programming Guide can be handy too. It explains all that in detail.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...