编写应用程序与iOS开发差异解析
1. 应用代码实现
在编写应用程序时,首先要设置排序描述符,同时触发KVO通知,以便更新相关控制器。以下是设置排序描述符的代码:
// setup the sort descriptors
// remember to trigger KVO notifications so the relevant controllers can be
// updated-- they’re already bound by this point
if ( _personSortDescriptors == nil )
{
[self willChangeValueForKey: @"personSortDescriptors"];
_personSortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey: @"lastName"
ascending: YES]];
[self didChangeValueForKey: @"personSortDescriptors"];
}
if ( _labelSortDescriptors == nil )
{
[self willChangeValueForKey: @"labelSortDescriptors"];
_labelSortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey: @"la
超级会员免费看
订阅专栏 解锁全文
2659

被折叠的 条评论
为什么被折叠?



