Skip to content

Commit 98c0185

Browse files
committed
Add note about extension use and Coding support.
1 parent d58b92a commit 98c0185

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

objectivec/GPBMessage.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,18 @@ CF_EXTERN_C_END
6565

6666
/**
6767
* Base class that each generated message subclasses from.
68+
*
69+
* @note While the class support NSSecureCoding, if the message has any
70+
* extensions, they will end up reloaded in @c unknownFields as there is
71+
* no way for the @c NSCoding plumbing to pass through a
72+
* @c GPBExtensionRegistry. To support extensions, instead of passing the
73+
* calls off to the Message, simple store the result of @c data, and then
74+
* when loading, fetch the data and use
75+
* @c +parseFromData:extensionRegistry:error: to provide an extension
76+
* registry.
6877
**/
6978
@interface GPBMessage : NSObject<NSSecureCoding, NSCopying>
70-
79+
7180
// If you add an instance method/property to this class that may conflict with
7281
// fields declared in protos, you need to update objective_helpers.cc. The main
7382
// cases are methods that take no arguments, or setFoo:/hasFoo: type methods.

0 commit comments

Comments
 (0)