How do you store text, images and documents in Agenda?

I am posting this question as an Agenda user and as an iOS developer. I really like Agenda and have been impressed with its many features, including the fact that I can store virtually anything in Agenda.

I am developing a small task app specific to home maintenance, which in no way is a potential competitor to Agenda. In working on this project I am wondering how you store and retrieve and display note content. I have been trying to use NSTextAttachment and store the contents in CoreData using Transformable objects, but so far I am not having much success. Any guidance you might be able to share would be greatly appreciated. Even a pointer in the right direction would be helpful.

Thank you.

Forrest

Hi Forrest,
To be quite frank, it is a pain in the neck. Cost many months to get it all working nicely with a nice UI.

The way we do it is to use custom attributes on the NSAttributedString. So we have some model object (eg Attachment) which you would store in Core Data, and in the text, we add a custom attribute (eg “MYAttachmentInfo”) which is a dictionary of info we need about the attachment, such as its unique identifier.

If your app needs to work on iOS and macOS, you need to consider how you transform the text when storing in Core Data. Many attributes are not compatible between the platforms. What we do is replace attributes (eg bold) with our own custom attributes that are on each platform. When we go to present the string to the user, we convert the string attributes to native ones for that platform. It’s basically a very advanced transform.

Hope that gives you some idea. I don’t really know any shortcuts, otherwise I would have used them myself :wink:

Kind regards,
Drew

1 Like

Hi Drew,

Thank you so much for the thoughtful and detailed response. Fortunately I only need to have it work on iOS, so that simplifies it somewhat. I will definitely be looking into NSAttributedString.

Thank you too for Agenda. It is a great app. I really appreciate your thoughtful attention to detail.

Forrest

1 Like