简体   繁体   English

登录objective-c后加载信息

[英]load information after login objective-c

I have a login page with two button one for facebook login one with email and pass login,after login I will load some information in table, my question is what is the best way to load this information, create two .xib file tableView for each login, or just one .xib file. 我有一个带有两个按钮的登录页面,一个用于Facebook登录,一个通过电子邮件登录并通过登录,登录后我将在表中加载一些信息,我的问题是加载此信息的最佳方法是什么,为每个创建两个.xib文件tableView登录名或一个.xib文件。

Thanks in advance! 提前致谢!

I would suggest the following solution : 我建议以下解决方案:

1 create a second view, call it something like ListVC.xib. 1创建第二个视图,将其命名为ListVC.xib。

2 in ListVC add a member NSMutableArray called listData. 2在ListVC中添加一个名为listData的成员NSMutableArray。

3 in your first window, said loginVC.xib, each of your button will load data in an NSMutableArray, each in its own way. 3.在您的第一个窗口中,loginVC.xib表示,每个按钮将以各自的方式将数据加载到NSMutableArray中。 then each open ListVC.xib, and set listData member to the array it just load. 然后每个打开ListVC.xib,并将listData成员设置为其刚加载的数组。

If you use this solution, or something close, you will not create 2 ViewController, with nearly the same code. 如果使用此解决方案或其他解决方案,则不会使用几乎相同的代码创建2个ViewController。 Basically, copy and pasting your code is bad. 基本上,复制和粘贴代码是不好的。 If you need to modify it, it will become much more complicated. 如果需要修改,它将变得更加复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM