2 Star 0 Fork 0

Ian/VerificationCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
core_data_to-many_relationship_accessors.m 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
胡岩 提交于 2015-08-28 10:34 . Imported user code snippets
// Core Data To-Many Relationship Accessors
// The add and remove methods for a to-many relationship.
//
// IDECodeSnippetCompletionPrefix:
// IDECodeSnippetCompletionScopes: [ClassImplementation]
// IDECodeSnippetIdentifier: C1E91503-E91F-4EEA-A032-D98D80CDD00A
// IDECodeSnippetLanguage: Xcode.SourceCodeLanguage.Objective-C
// IDECodeSnippetUserSnippet: 1
// IDECodeSnippetVersion: 1
- (void)add<#CapitalizedRelationshipName#>Object:(<#relationship destination class#> *)value
{
NSSet *changedObjects = [NSSet setWithObject:value];
[self willChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"<#relationshipName#>"] addObject:value];
[self didChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
}
- (void)remove<#CapitalizedRelationshipName#>Object:(<#relationship destination class#> *)value
{
NSSet *changedObjects = [NSSet setWithObject:value];
[self willChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"<#relationshipName#>"] removeObject:value];
[self didChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects];
}
- (void)add<#CapitalizedRelationshipName#>:(NSSet *)value
{
[self willChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
[[self primitiveValueForKey:@"<#relationshipName#>"] unionSet:value];
[self didChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
}
- (void)remove<#CapitalizedRelationshipName#>:(NSSet *)value
{
[self willChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
[[self primitiveValueForKey:@"<#relationshipName#>"] minusSet:value];
[self didChangeValueForKey:@"<#relationshipName#>" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Ianhwu/VerificationCode.git
[email protected]:Ianhwu/VerificationCode.git
Ianhwu
VerificationCode
VerificationCode
master

搜索帮助