The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > Omni Frameworks
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Filtering /Documents directory and other issues... Thread Tools Search this Thread Display Modes
Tim -

First thanks for the massive update. Builds just fine with lots to catch up on. The writePreviews example in TextEditor is great. Much better than my measly implementation...

A few questions:

1 - Can you suggest an "elegant" way of filtering out certain documents in the /Documents directory within your framework. I've researched the topic and between the picker and the store, it looks like ALL documents and sub-directories are being picked up (I even get the .DS_Store). Unfortunately my app is also storing some documents there. So I end up with non-documents in my picker view. I hate subclassing too much from your framework - just headaches merging changes down the line. Maybe a nice override from the app controller that allows one to specify valid file patterns for display/edit?

2 - For the life of me, I can't figure out how the image picker (photo album) is being invoked. The toolbar in app controller has a nil target for the attachImage action. The proper target must be set somewhere else? Right? It is also only "active" after a tap in the edit window (and the keyboard comes up). My app uses a custom image document app with a view controller that is loosely based on OUIEditableFrame. I can get it to work properly by hard coding a target in toolbarItemsForDocument, but that clearly wasn't your intent.

3 - MidSummer.rtf is finally viewable in the new build. Never did before - just got the spinner of death from the picker. However, this time around, text is displayed, but scrolling the document doesn't work : everything seems to stutter: scrollbars inch along and the keyboard is non-functional after tap. It's a long document, dunno if that has anything to do with it.

I am running all of this in the iPad simulator using Xcode 4.2 and IOS 5.0 (9A334) in 10.7.3 on a Mac Pro.

Regards, Patrice
 
For filtering, you can implement the OFSDataStore delegate method -documentStore:fileItemClassForURL: to return Nil and the somewhat redundant -documentStore:canViewFileTypeWithIdentifier:. These are already subclassed in OUIAppController, but you can further subclass them in your app.

The nil target convention means to start looking for a responder at the current first responder in the window. The exact search ordering differs between UIKit and AppKit. In this case, when the OUIEditableFrame is first responder, the search starts there and goes up the view and view controller chain until it gets to the TextViewController instance (UIViewControllers are part of the responder chain in iOS, unlike NSViewController in AppKit).

The MidSummer.rtf example was added as a far out performance goal for OUIEditableFrame. We've made some improvements in the latest round of framework changes that let it be a bit more usable, but it still shows off the need for better handling of large text blobs. We haven't tackled this yet, but a couple of possible approaches that we might take are to break up the text by paragraphs and build CTFrameRefs for smaller chunks and to allow rendering of slices of text (like CATileLayer). In fact, the class becomes almost usable (though it hits a bunch of assertions) if you make it subclass from OUITiledScalingView. This avoids allocating a HUGE CALayer for the text view, which eats up a ton of memory.
__________________
CTO, The Omni Group
 
Oh, I forgot to also mention you might also want to look at OFSDocumentStoreFilter for filtering what shows up in the document picker. The delegate methods on OFSDocumentStore are intended to filter the contents of the various scopes down to the file types the application understands. OFSDocumentStoreFilter is then intended to apply a visibility filter of some sort.

So, for example, in OmniGraffle for iPad, all the stencils and documents are included in the document store, but as the user switches between viewing stencils and documents, the OFSDocumentStoreFilter is updated.

OUIDocumentPicker has a OFSDocumentStoreFilter ivar that you can tweak to do the finer grained filtering.
__________________
CTO, The Omni Group
 
Thanks Tim will try and report results soon. By the way I think the ScalingScrollView example is broken, I am posting how to fix it in a few minutes.

Regards and keep on adding to the frameworks, please! (smile) especially juicy inspector code...

Later...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
backup directory tehprince OmniFocus 1 for Mac 1 2007-12-18 05:36 PM


All times are GMT -8. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.