Class: NSPropertyDescription

Inherits:
NSObject show all

Overview

The NSPropertyDescription class is used to define properties of an entity in a Core Data managed object model. Properties are to entities what instance variables are to classes.

Direct Known Subclasses

NSAttributeDescription, NSExpressionDescription, NSFetchedPropertyDescription, NSRelationshipDescription

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Method Details

- (NSEntityDescription) entity

Returns the entity description of the receiver.

Returns:

- (Boolean) isIndexed

Returns a Boolean value that indicates whether the receiver is important for searching. Object stores can optionally use this information upon store creation for operations such as defining indexes.

Returns:

  • (Boolean)

    YES if the receiver is important for searching, otherwise NO.

- (Boolean) isIndexedBySpotlight

Returns a Boolean value that indicates whether the property should be indexed by Spotlight. For details, see Core Data Spotlight Integration Programming Guide.

Returns:

  • (Boolean)

    YES if the property should be indexed by Spotlight, otherwise NO.

- (Boolean) isOptional

Returns a Boolean value that indicates whether the receiver is optional.

Returns:

  • (Boolean)

    YES if the receiver is optional, otherwise NO.

- (Boolean) isStoredInExternalRecord

Returns a Boolean value that indicates whether the property data should be written out in an external record file corresponding to the managed object. For details, see Core Data Spotlight Integration Programming Guide.

Returns:

  • (Boolean)

    YES if the property data should be written out in an external record file corresponding to the managed object, otherwise NO.

- (Boolean) isTransient

Returns a Boolean value that indicates whether the receiver is transient.

Returns:

  • (Boolean)

    YES if the receiver is transient, otherwise NO.

- (String) name

Returns the name of the receiver.

Returns:

  • (String)

    The name of the receiver.

- (String) renamingIdentifier

Returns the renaming identifier for the receiver. This is used to resolve naming conflicts between models. When creating an entity mapping between entities in two managed object models, a source entity property and a destination entity property that share the same identifier indicate that a property mapping should be configured to migrate from the source to the destination. If unset, the identifier will return the property's name.

Returns:

  • (String)

    The renaming identifier for the receiver.

- (Object) setIndexed(flag)

Sets the optionality flag of the receiver. Object stores can optionally use this information upon store creation for operations such as defining indexes.

Parameters:

  • flag (Boolean)

    A Boolean value that indicates whether whether the receiver is important for searching (YES) or not (NO).

Returns:

- (Object) setIndexedBySpotlight(flag)

Sets whether the property should be indexed by Spotlight. For details, see Core Data Spotlight Integration Programming Guide.

Parameters:

  • flag (Boolean)

    YES if the property should be indexed by Spotlight, otherwise NO.

Returns:

- (Object) setName(name)

Sets the name of the receiver.

Parameters:

  • name (String)

    The name of the receiver.

Returns:

- (Object) setOptional(flag)

Sets the optionality flag of the receiver. The optionality flag specifies whether a property’s value can be nil before an object can be saved to a persistent store.

Parameters:

  • flag (Boolean)

    A Boolean value that indicates whether whether the receiver is optional (YES) or not (NO).

Returns:

- (Object) setRenamingIdentifier(value)

Sets the renaming identifier for the receiver. See renamingIdentifier for a full discussion.

Parameters:

  • value (String)

    The renaming identifier for the receiver.

Returns:

- (Object) setStoredInExternalRecord(flag)

Sets whether the data should be written out in an external record file corresponding to the managed object. For details, see Core Data Spotlight Integration Programming Guide.

Parameters:

  • flag (Boolean)

    YES if the property data should be written out in an external record file corresponding to the managed object, otherwise NO.

Returns:

- (Object) setTransient(flag)

Sets the transient flag of the receiver. The transient flag specifies whether or not a property’s value is ignored when an object is saved to a persistent store. Transient properties are not saved to the persistent store, but are still managed for undo, redo, validation, and so on.

Parameters:

  • flag (Boolean)

    A Boolean value that indicates whether whether the receiver is transient (YES) or not (NO).

Returns:

- (Object) setUserInfo(dictionary)

Sets the user info dictionary of the receiver.

Parameters:

  • dictionary (Hash)

    The user info dictionary of the receiver.

Returns:

- (Object) setValidationPredicates(validationPredicates, withValidationWarnings:validationWarnings)

Sets the validation predicates and warnings of the receiver. The validationPredicates and validationWarnings arrays should contain the same number of elements, and corresponding elements should appear at the same index in each array.Instead of implementing individual validation methods, you can use this method to provide a list of predicates that are evaluated against the managed objects and a list of corresponding error messages (which can be localized).

Parameters:

  • validationPredicates (Array)

    An array containing the validation predicates for the receiver.

  • validationWarnings (Array)

    An array containing the validation warnings for the receiver.

Returns:

- (Object) setVersionHashModifier(modifierString)

Sets the version hash modifier for the receiver. See versionHashModifier for a full discussion.

Parameters:

  • modifierString (String)

    The version hash modifier for the receiver.

Returns:

- (Hash) userInfo

Returns the user info dictionary of the receiver.

Returns:

  • (Hash)

    The user info dictionary of the receiver.

- (Array) validationPredicates

Returns the validation predicates of the receiver.

Returns:

  • (Array)

    An array containing the receiver’s validation predicates.

- (Array) validationWarnings

Returns the error strings associated with the receiver’s validation predicates.

Returns:

  • (Array)

    An array containing the error strings associated with the receiver’s validation predicates.

- (NSData) versionHash

Returns the version hash for the receiver. The version hash is used to uniquely identify a property based on its configuration. The version hash uses only values which affect the persistence of data and the user-defined versionHashModifier value. (The values which affect persistence are the name of the property, and the flags for isOptional, isTransient, and isReadOnly.) This value is stored as part of the version information in the metadata for stores, as well as a definition of a property involved in an NSPropertyMapping object.

Returns:

  • (NSData)

    The version hash for the receiver.

- (String) versionHashModifier

Returns the version hash modifier for the receiver. This value is included in the version hash for the property. You use it to mark or denote a property as being a different “version” than another even if all of the values which affect persistence are equal. (Such a difference is important in cases where the attributes of a property are unchanged but the format or content of its data are changed.)This value is included in the version hash for the property.

Returns:

  • (String)

    The version hash modifier for the receiver.