我想知道Twitter是如何实现它的个人资料屏幕的.起初我以为它是一个带有标题(简介信息)和节标题的表格视图(用于选择推文/媒体/收藏夹的分段控件).这对我来说是有道理的,因为当用户向下滚动时,配置文件信息会消失,但是分段控件会保留,这正是UITableView标题视图和节标题的完全行为.在导航栏的顶部还有一个图像视图,但这对我来说并不重要.这是我认为它的可视化:
我试图在Interface Builder中重新创建它,这就是我得到的.滑块引起了我的注意:它与Twitter应用程序不同,它从表格视图标题的顶部开始,而不是在单元格的顶部.
那么......他们是如何实现的呢?他们是否在UIScrollView中放置了UITableView并自行处理了触摸/滚动事件?我不这么认为,因为它气馁,但我想不出另一种解释.
我的项目出了点问题.调试应用程序和应用程序崩溃时,它不会打印断言消息.通常它应该显示如下:
2017-02-05 20:13:54.687 MyPlayground[29372:221950] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.6.21/UITableView.m:1610
2017-02-05 20:13:54.690 MyPlayground[29372:221950] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (10) must be equal to the number of rows contained in that section before the update (10), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus …Run Code Online (Sandbox Code Playgroud) 如何从 pod 中删除依赖项?
我有一个 podfile
pod 'GData'
Run Code Online (Sandbox Code Playgroud)
这似乎被破坏了,因为它会产生 163 个重复的符号错误。我想我知道它是什么。安装时可以观察到:
Installing GTMHTTPFetcher (1.141)
Installing gtm-http-fetcher (1.0.141)
[!] GTMHTTPFetcher has been deprecated in favor of gtm-http-fetcher
Run Code Online (Sandbox Code Playgroud)
其中之一是不需要的。所以要删除它,我尝试修改 podfile 以使用自定义的本地 podspec 文件:
podspec :path => '~/GData.podspec.json'
Run Code Online (Sandbox Code Playgroud)
在哪个 podspec 文件中,我复制了没有 GTMHTTPFetcher 的所有原始 JSON podspec 内容,GData 没有安装。如果我只是复制原始内容并且根本不更改任何内容,它甚至会发生。所有依赖项都已安装,但 GData 本身未安装。我想我在这里遗漏了一些东西。
ios ×2
cocoapods ×1
gdata ×1
lldb ×1
nsassert ×1
objective-c ×1
swift ×1
twitter ×1
uitableview ×1
xcode ×1