加载xib时的执行顺序? [英] Sequence of execution when loading xib?

查看:64
本文介绍了加载xib时的执行顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我已经在iOS上进行了将近六个月的编程,使用了左右臂Xibs,但是我仍然不知道加载过程是如何工作的...

I have been programming on iOS for almost six months now, using xibs left and right, but i am still unaware how loading process works...

我的意思是,我有视图控制器和按钮来打开新的模态视图控制器.从那时起,事情是如何完成的.首先调用init方法,然后创建xib,连接出口,然后加载nib吗?

What i mean, i have view controller and push button to open new modal view controller. From that point onwards how are things done. Is init method first called, then xib created, outlets connected and then nib loaded?

有没有很好的文章或书籍详细解释​​了这一点?

Is there any good article or book that explains this in details?

推荐答案

这可能无法以您想要的方式回答您的问题,但我建议您自己找出来.

this maybe not answer your question the way like you want, but i recommend you to find it out yourself.

如何?请参见上面的文字.

  • NSLog()
  • 的情况下使用 XLog()
  • 将上面的代码粘贴到您的prefix.pch文件中
  • 输入您想要的 XLog()语句的每个方法,然后看看首先调用哪个方法.
  • use XLog() in case of NSLog()
  • paste the code above in your prefix.pch file
  • put in every method you want an XLog() statement and see, which methods are called firstly.

XLog() NSLog()的一种更好的方法.在控制台中,您可以看到调用日志的行号和方法名.这应该可以帮助您了解装入笔尖的方式.

XLog() is a better way of NSLog(). In console you can see the Line numbers and the methodnames where the log is called. this should help you out to understand the way of loading nibs.

 #define DEBUG 1  

 //#define RELEASE 1

#ifdef DEBUG 

// Debug definitions 
#define DEBUG_MODE 
#define XLog(fmt, ...) NSLog(@"%s line:%d " fmt, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 

#else 

#ifndef RELEASE 
#error DEBUG or RELEASE need to be #defined 
#endif 

// Release definitions 
#define RELEASE_MODE 
#define XLog(...) 

#endif

这篇关于加载xib时的执行顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆