分析结果如下:
cy# [#0x13052e7b0 nextResponder]
#"<ICNoteEditorViewController: 0x12f80d600>"
就是这个controller。
1、
然后,输出其中一个属性:
cy# [#0x12f80d600 note]
#"<ICNote: 0x1305200d0> (entity: ICNote; id: 0xd000000000340006 x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICNote/p13 ; data: {\n account = “0xd000000000240000 x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICAccount/p9”;\n assetCryptoInitializationVector = nil;\n assetCryptoTag = nil;\n attachmentViewType = 0;\n attachments = (\n “0xd00000000038000c x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICAttachment/p14”,\n “0xd00000000040000c x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICAttachment/p16”\n );\n cloudState = “0xd000000000340002 x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICCloudState/p13”;\n creationDate = “2016-08-19 06:02:05 +0000”;\n cryptoInitializationVector = nil;\n cryptoIterationCount = 0;\n cryptoSalt = nil;\n cryptoTag = nil;\n cryptoWrappedKey = nil;\n encryptedValuesJSON = nil;\n folders = (\n “0xd000000000280004 x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICFolder/p10”\n );\n foldersModificationDate = “2016-09-19 07:06:16 +0000”;\n group = nil;\n identifier = “55E9FC98-6B9B-4874-B8E7-A9D9F45B3B5F”;\n integerId = nil;\n isPasswordProtected = 0;\n legacyContentHashAtImport = nil;\n legacyImportDeviceIdentifier = nil;\n legacyManagedObjectIDURIRepresentation = nil;\n legacyModificationDateAtImport = nil;\n legacyNoteIntegerId = 0;\n legacyNoteWasPlainText = nil;\n markedForDeletion = 0;\n modificationDate = “2016-10-01 12:29:28 +0000”;\n needsInitialFetchFromCloud = 0;\n needsToBeFetchedFromCloud = nil;\n noteData = “0xd000000000080008 x-coredata://2C794417-15E6-4AE2-8054-7D40E668635D/ICNoteData/p2”;\n noteHasChanges = 0;\n passwordHint = nil;\n serverRecord = nil;\n snippet = 567891234523;\n thumbnailAttachmentIdentifier = nil;\n title = 1234567890;\n type = nil;\n unappliedEncryptedRecord = nil;\n})"
这样就看到了note的内容了。
按照书上说的(第二版 P221):查看note的类型 ICNote的定义。这里,能解释下 怎么查看 ICNote的定义吗? 书上只是给了定义的结果。我在上面输出的 controller中没有找到对应的 ICNote的定义。
2、我利用书上的分析思路,利用上面的controller,输出其属性:textView。这样同样也能看到note的内容:
cy# [#0x12f80d600 textView]
#"<ICTextView: 0x12f006000; baseClass = UITextView; frame = (0 0; 320 568); text = ‘1234567890\n567891234523\n\xef\xbf\xbc…’; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x12ef2bf40>; layer = <CALayer: 0x12ee06b60>; contentOffset: {0, -64}; contentSize: {320, 200}>"
在上面的controller找到了下面的两个函数:
textViewDidChangeSelection 和 textViewDidChange 。远程调试分析:发现,每当note内容发生变化,这2个函数将被触发。
但是,继续分析下去,并没有定位到note的内容text所在头文件。
请指教~~