when you get Annot["Subtitle"] , will you get a CKRecordValue? response CKRecordValue? which has the base class NSObjectProtocol . Thus, in your case, the field exists, but it is not a string, so it should be used using! String will crash your application. Since the field exists, CKRecordValue will not be nil. However, the content of this field is zero. When you print the field, it will output .description this field. In your case, it is zero. Could you try this code:
if let f = Annot["Subtitle"] { print("f = \(f) of type \(f.dynamicType)") }
then set a breakpoint on the print line and when it stops, try the following three statements in the output window:
po Annot po f pf
After po Annot you will see that in this entry. Including subtitle field. po f not so interesting. It will simply output the memory address. However, pf will show you the actual type. If this is a line, you should see something like: (__NSCFConstantString *) $R3 = 0xafdd21e0
PS Maybe you should call it a record instead of Annot. This is a local variable, so it must begin with a lowercase character. And it's still a record, not Annot.
source share