Unit testing a bundle
Hi, I have a bundle project that produces an NSBundle. I am trying to add unit tests to this, but am getting the following error: 2012-01-12 01:23:33.644 otest[12650:407] The test bundle at /.../DerivedData/.../Debug/PluginTests.octest could not be loaded because a link error occurred. It is likely that dyld cannot locate a framework framework or library that the the test bundle was linked against, possibly because the framework or library had an incorrect install path at link time. 2012-01-12 01:23:33.649 otest[12659:203] *** NSTask: Task create for path '/.../DerivedData/.../Debug/PluginTests.octest/Contents/MacOS/PluginTests' failed: 22, "Invalid argument". Terminating temporary process. I'm at a loss as to how to fix this. Every tip I've found via google, either the setting was already set as suggested, or I've tried it with no effect. Some things I can think of: - bundle is added to "Bundle Loader" in "Test Target"'s "Build Settings": $(BUILT_PRODUCTS_DIR)/Plugin.agplugin/Contents/MacOS/Plugin - bundle build is a "Target Dependency" in "Build Phases". - bundle build is also in the scheme (both build & test phases). - I've read through the build settings and compared to another (app) project that unit tests just fine and don't see any discrepancies. I can see when hitting cmd-U that the "build" target runs, and creates the bundle as it should. The octest is then created, and when it runs, I get the error. Any suggestions? Regards, Mikkel___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
AppleScript recording
Hi all, Forgive me for posting here, but I have a Carbon question that needs a Cocoa equivalent, if it indeed exists: In my app (Carbon-based) I have supported AppleScript recording for many years, but this appears to be broken in Lion because my app no longer receives the 'Start Recording' and 'Stop Recording' AppleEvent notifications it needs - namely : kCoreEventClass : kAENotifyStartRecording kCoreEventClass : kAENotifyStopRecording Although I have an open bug report on this issue (and I'm reliably informed that Apple are looking into it) I wonder if there is a Cocoa equivalent that I may use instead. Thank you for any suggestions. Regards, Martin Crane Senior Software Engineer Vicomsoft Vicomsoft Ltd. 21 Oxford Road, Bournemouth. BH8 8ET UK Tel: 0844 801 4587 (UK) +44 (0)1202 204830 (International) Fax: 0844 801 4588 (UK) +44 (0)1202 297900 (International) 888-842-2608 (US) Fax: 530-685-8896 (US) www.vicomsoft.com Vicomsoft Limited registered in the UK No. 04352786 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Respecting tabs across applications
On Jan 11, 2012, at 2:40 PM, James Merkel wrote: > > On Jan 11, 2012, at 8:39 AM, Ross Carter wrote: > >> On Jan 10, 2012, at 10:14 PM, James Merkel wrote: >> >>> the default NSParagraphStyle is being applied to my string. >> >> To be precise, a NSParagraphStyle is being applied to your attributed >> string. The NSString does not contain any formatting information. >> >> When you copy rich text, say from TextEdit, you place two sets of data on >> the pasteboard: the rich text data with the NSParagraphStyle and font >> information, and plain text data, which is just the characters. When you >> paste into a document, the receiving app chooses the item on the pasteboard >> that it wants to use. A code editor might prefer the plain text version, >> whereas a word processor would prefer the rich text version. >> >> If you want the text to line up neatly in an app that takes plain text from >> the pasteboard, you probably want to align everything using spaces, as Jens >> said. If you want the text to align in an app that uses rich text, you >> should use tabs and define their location using NSParagraphStyle. To handle >> both possibilities, you need to manage what gets put on the pasteboard. If >> you are using NSTextView, there are some pasteboard methods available for >> you to override. >> >> Ross > > I'm using my own defined NSParagraphStyle now for the tabstops and that works > fine. That's a cleaner and more maintainable approach than I was using > before. So thanks to Jens for that suggestion. > I would like to be able to copy and paste to TextEdit and maintain the > attributes (including bolded text). I'll take a look at the pasteboard > methods of NSTextView. > > Thanks > Jim Merkel > > Turns out, all I needed to do was check the "Allows Rich Text" check box in the NSTextView Attributes Inspector in Interface Builder to allow the two types of text (Rich Text and plain text) to be copied to the pasteboard. No coding required - excellent. Jim Merkel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
document saveing in Lion
Hi, I have a problem and can find the right terms to search for it to solve my problem. I have a app, that can read several documents as but can’t save them, it has a native file format is can save to. If I open such a file, it shows a "locked" in the title bar. If I unlock it and make some changes and close the document, it just saves to the same url as the opened file. As it saves in another file type, the file is rendered useless as the extension is wrong now. I suppose it should bring up a save panel either when I unlock it or when I close it, much like it does when duplicating. Can someone shed some light on this? Best Georg Seifert___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: document saveing in Lion
Sorry for replying to my own post. Just as I wrote this, I found the "File Type Fixing in -[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]" in the release notes. But this behavior is not acceptable. The read-only files should not be deleted but the user should be asked for an place to save the new file. By the way, this worked well in Snow Leopard. Georg On 12.01.2012, at 21:04, Georg Seifert wrote: > Hi, > > I have a problem and can find the right terms to search for it to solve my > problem. > > I have a app, that can read several documents as but can’t save them, it has > a native file format is can save to. If I open such a file, it shows a > "locked" in the title bar. If I unlock it and make some changes and close the > document, it just saves to the same url as the opened file. As it saves in > another file type, the file is rendered useless as the extension is wrong > now. > > I suppose it should bring up a save panel either when I unlock it or when I > close it, much like it does when duplicating. > > Can someone shed some light on this? > > Best > Georg Seifert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
LSSharedFileListInsertItemURL/SMLoginItemSetEnabled and sandbox
I am a little confused about login items and the sandbox. The documentation says: "With App Sandbox, you cannot create a login item using functions in the LSSharedFileList.h header file. For example, you cannot use the function LSSharedFileListInsertItemURL." Yet after enabling the sandbox it still seems to work just fine. Maybe the sanbox is not active? Is there a good way to check for the sandbox at runtime? Anyone aware of sample code for the suggested helper app that manages the login items via SMLoginItemSetEnabled? cheers, Torsten ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: LSSharedFileListInsertItemURL/SMLoginItemSetEnabled and sandbox
On Jan 12, 2012, at 16:00, Torsten Curdt wrote: > I am a little confused about login items and the sandbox. > > The documentation says: > > "With App Sandbox, you cannot create a login item using functions in > the LSSharedFileList.h header file. For example, you cannot use the > function LSSharedFileListInsertItemURL." > > Yet after enabling the sandbox it still seems to work just fine. Maybe > the sanbox is not active? > > Is there a good way to check for the sandbox at runtime? > > Anyone aware of sample code for the suggested helper app that manages > the login items via SMLoginItemSetEnabled? > Well, you can check your app in Activity Monitor if you choose to display the "Sandbox" column... -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys Software laur...@nemesys-soft.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Forcing autosave
I have a situation where I need my document's contents on disk, even if it's a new document with no changes, so I thought I would just make sure that the document had autosaved before I complete my action on the file, and just pick up the URL of the last autosave from the document and use that. (I'm running this on Lion) I use: - (void)autosaveWithImplicitCancellability:(BOOL)autosavingIsImplicitlyCancellable completionHandler:(void (^)(NSError *errorOrNil))completionHandler Now this is fine, except that it only works if the user has made at least one change to the document. The documentation says that it invokes the - (BOOL)hasUnautosavedChanges method to determine whether to save the document. So I overrode that method so that during my operation, it will return YES. I expected this to ensure that the document would be saved, but it ignores this and doesn't autosave it. It does actually call this method during the autosave call, but seems to not take notice that I returned YES. So I tried putting a dummy undo action in just before calling autosave, and then undoing it afterwards, just to ensure that the document was dirty. That didn't work either. I put it in an undo group, but that didn't work either. I forced a checkpoint in the undo manager, but that didn't work either. So I thought I would try the document updateChangeCount: method, calling NSChangeDone before calling autosave, then NSChangeUndone afterwards. That worked! I removed all the other stuff and *only* had the updateChangeCount: calls in there, and it still autosaved. So I have a solution that works, but I'm thinking that my override of hasUnautosavedChanges should have forced the autosave. Is this a bug that it doesn't? TIA Gideon ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Forcing autosave
On Thu, Jan 12, 2012 at 4:32 PM, Gideon King wrote: > I have a situation where I need my document's contents on disk, even if it's > a new document with no changes, so I thought I would just make sure that the > document had autosaved before I complete my action on the file, and just pick > up the URL of the last autosave from the document and use that. (I'm running > this on Lion) > > > I use: > > - > (void)autosaveWithImplicitCancellability:(BOOL)autosavingIsImplicitlyCancellable > completionHandler:(void (^)(NSError *errorOrNil))completionHandler This seems sketchy. It would be nice if NSDocument gave us access to the logic it uses to decide where to write autosaved untitled documents (rdar://problem/10206220), but if you want to save the document you should almost certainly just call -saveToURL:ofType:forSaveOperation:completionHandler: directly. If you don't already have a -fileURL or an -autosavedContentsFileURL, you should give it a URL somewhere inside your Application Support directory. > > Now this is fine, except that it only works if the user has made at least one > change to the document. > > The documentation says that it invokes the - (BOOL)hasUnautosavedChanges > method to determine whether to save the document. So I overrode that method > so that during my operation, it will return YES. > > I expected this to ensure that the document would be saved, but it ignores > this and doesn't autosave it. It does actually call this method during the > autosave call, but seems to not take notice that I returned YES. > > So I tried putting a dummy undo action in just before calling autosave, and > then undoing it afterwards, just to ensure that the document was dirty. That > didn't work either. I put it in an undo group, but that didn't work either. I > forced a checkpoint in the undo manager, but that didn't work either. > > So I thought I would try the document updateChangeCount: method, calling > NSChangeDone before calling autosave, then NSChangeUndone afterwards. That > worked! I removed all the other stuff and *only* had the updateChangeCount: > calls in there, and it still autosaved. > > So I have a solution that works, but I'm thinking that my override of > hasUnautosavedChanges should have forced the autosave. Is this a bug that it > doesn't? How is NSDocument going to know to call -hasUnautosavedChanges? Something needs to provoke that. The autosave timer only gets scheduled in response to -updateChangeCount:, and that's what checks for -hasUnautosavedChanges. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Forcing autosave
On Jan 12, 2012, at 4:43 PM, Kyle Sluder wrote: > On Thu, Jan 12, 2012 at 4:32 PM, Gideon King wrote: >> I have a situation where I need my document's contents on disk, even if it's >> a new document with no changes, so I thought I would just make sure that the >> document had autosaved before I complete my action on the file, and just >> pick up the URL of the last autosave from the document and use that. (I'm >> running this on Lion) >> >> >> I use: >> >> - >> (void)autosaveWithImplicitCancellability:(BOOL)autosavingIsImplicitlyCancellable >> completionHandler:(void (^)(NSError *errorOrNil))completionHandler > > This seems sketchy. And now that I remember to distinguish between Mac and iOS document models, I realize I'm the one giving terrible advice. Don't do what I suggested, since it will update the document's permanent fileURL to point to the Application Support directory. I believe the point about it not being a bug, but a consequence of the design, still stands. --Kyle Sluder___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: checking if directory is writable
Hi Rick, On 10/01/2012, at 7:49 PM, Rick C. wrote: > Just looking for confirmation, I can use NSFileManager isWritableAtPath: if I > want to check if a directory can be written to correct? Or do I have to use > attributesOfItemAtPath:error:? I don't need to change permissions just to > see if it's writable. Thanks! I was of the understanding that Apple's recommendation was just to try the operation you wanted to perform, and handle the error if there is one. This is taken from the NSFileManager header, directly above the isWriteableAtPath: declaration: "The following methods are of limited utility. Attempting to predicate behavior based on the current state of the filesystem or a particular file on the filesystem is encouraging odd behavior in the face of filesystem race conditions. It's far better to attempt an operation (like loading a file or creating a directory) and handle the error gracefully than it is to try to figure out ahead of time whether the operation will succeed." (Sorry for the resend — my original reply only went to Rick, not the entire list) all the best, Tony -- Tony Arnold http://thecocoabots.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Messed up UTIs in NSDocument-based application
So I recently shipped a document based application to the App Store with an unfortunate oversight: the UTI for the main document type was left blank, and wasn't exported. I had a name for it, but the identifier was straight up empty. Everything still worked great, but then I went to add another file type to the mix in the next version. The new file type is simply xml (conforms to public.xml). I set that up and dropped it into the document. This is when I caught the oversight on the first document type's UTI. I entered an appropriate identifier for my main document type, and added it to my exported UTI list. Now when I try to open my document types from my application, they are grayed out in the open dialog. To recap, I released a document-based application with this: Document Types: 1.) Name: "My Document", Extension: "myext", Identifier: "" Exported UTIs: (none) Imported UTIs: (none) And now I have this: Document Types: 1.) Name: "My Document", Extension: "myext", Identifier: "com.mycompany.myext" 2.) Name: "My XML Document", Extension: "xml", Identifier: "public.xml" Exported UTIs: "com.mycompany.myext" Imported UTIs: "public.xml" However, I my main document type is grayed out in the open dialog now. I'm at a loss as to how file types are associated with applications, and how to fix this issue. I really want to clean this up, so what's the best way to do so? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Adding NSControl to IKImageBrowserCell
Hi All, I've built a custom IKImageBrowserCell which is displaying my images in an IKImageBrowser without any issues. I'd like to add an NSButton to IKImageBrowserCell enable the delete functionality on each image. So that when I click the button, I can remove item at selected index and reload IKImageBrowser. Any help would be appreciated. Thanks and regards, VinPai ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: What makes OS X generate a hang report?
Hi ! Well, I am no expert, so I can't answer your question. But I do have a suggestion (fix): have you tried loading your QuickTime movie on an other thread, and then attaching it to your main thread ? (you have to detach it first). Jean On 11 janv. 2012, at 21:56, Mark Woods wrote: > Does anyone know the criteria OS X uses to determine an application has hung? > The reason I ask is that I've seen lots of inconsistencies. For example, OS X > will kill a process and show the log if it hangs for 5 seconds, other times > less than 1 second (is this even counted as a hang?) and sometimes the app > hangs forever and I have to force-quit it myself. > > Lion seems to be much more sensitive than previous versions and it will > occasionally kill my app when doing simple things like loading a QuickTime > movie into a QTMovieView, which has to be done on the main thread. (The hang > report reports a hang of less than 1 second.) > > Has anyone else seen this? Is this a bug I should report to Apple or am I > doing something wrong? > > Any light anyone can shed on this would be > appreciated.___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/jean.lists%40gmail.com > > This email sent to jean.li...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Is slowing down bindings updates possible?
I have a download controller with an NSMutableArray and an NSArrayController hooked up to a NSTableView with a view based setup. My array contains custom download objects. Each of those has a NSURLDownload instance. Basically, I am showing a browser-download like interface with size downloaded, total expected size, a progress bar, time elapsed, download rate and estimated time left. It is all working wonderfully, but actually too well. Right now, I am using will/didChangeValueForKey messages to notify observers when the number of bytes downloaded changes. I am doing this in the callback method: - (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length { [self willChangeValueForKey:@"bytesDownloaded"]; _bytesDownloaded += length; [self didChangeValueForKey:@"bytesDownloaded"]; } The result of this is that the UI updates really frequently and the estimated time to complete and the download rate jump around a lot. I would love it if I could tell cocoa to only update the UI once per second instead of immediately when the property key changes. With a bit of work I could probably set up a proxy object for each download that would do something like that and use timer, but it would be a lot of messy code. I could also just delay updating the _bytesDownloaded on a queue. Or a third idea is to cache the estimated calc time and rate and then only recalculate the value at most once per second. Any other brighter ideas? Thoughts? Thank you, Andrew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: checking if directory is writable
> I was of the understanding that Apple's recommendation was just to try the > operation you wanted to perform, and handle the error if there is one. This > is taken from the NSFileManager header, directly above the isWriteableAtPath: > declaration: > > "The following methods are of limited utility. Attempting to predicate > behavior based on the current state of the filesystem or a particular file on > the filesystem is encouraging odd behavior in the face of filesystem race > conditions. It's far better to attempt an operation (like loading a file or > creating a directory) and handle the error gracefully than it is to try to > figure out ahead of time whether the operation will succeed." There's a tendency to create a false dichotomy there, though. It's true that only checking in advance is erroneous, but advanced checks can be useful if done appropriately. For example, when the user first selects a file you could sanity check it, and if it looks like something is wrong you can subtly warn the user. The key is to not stop them actually trying - the only true gauge is whether the real operation succeeds or not - and not to be too invasive. For example, think about the standard Open dialog which by default disables files of unsupported formats. Or the variant of the same which doesn't disable them, but shows a passive warning message within the dialog window if you select one. It's not something to be considered too lightly, though, because to do a really good job of it takes more work than you might think. For example, if you're going to indicate that the user can't seemingly write to the target folder, you really should be watching that folder for changes. When it does become readable, you can remove the warning immediately, providing clear feedback to the user that a) they've fixed the issue correctly, and b) your app is paying attention. Think about installers that require you to quit certain open apps, and compare the ones that make you re-run the installer manually versus those that will get immediately underway as soon as the apps are closed. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: checking if directory is writable
On Tue, Jan 10, 2012 at 1:39 AM, Tony Arnold wrote: > Hi Rick, > > On 10/01/2012, at 7:49 PM, Rick C. wrote: > >> Just looking for confirmation, I can use NSFileManager isWritableAtPath: if >> I want to check if a directory can be written to correct? Or do I have to >> use attributesOfItemAtPath:error:? I don't need to change permissions just >> to see if it's writable. Thanks! > > I was of the understanding that Apple's recommendation was just to try the > operation you wanted to perform, and handle the error if there is one. This > is taken from the NSFileManager header, directly above the isWriteableAtPath: > declaration: Preflighting parent directory permissions is useful so you don't offer the user the ability to do something you know is impossible. For example, if a folder is not writeable, you can disable the "Save" button, as long as you recheck often enough to reenable it when the permissions change in your favor. The opposite scenario, where you assume that you have permission to write a file because of results of a check you made some milliseconds ago, is the more problematic one. You need to be able to handle that. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Is slowing down bindings updates possible?
> The result of this is that the UI updates really frequently and the > estimated time to complete and the download rate jump around a lot. I > would love it if I could tell cocoa to only update the UI once per > second instead of immediately when the property key changes. I don't believe there is such a feature. Though I wouldn't be surprised if someone out there has already implemented a proxy like you suggest. > With a bit of work I could probably set up a proxy object for each > download that would do something like that and use timer, but it would > be a lot of messy code. I could also just delay updating the > _bytesDownloaded on a queue. Or a third idea is to cache the estimated > calc time and rate and then only recalculate the value at most once > per second. I think if you're going to follow the MVC paradigm, you should be sure to update _bytesDownloaded immediately - that's your model, which should always be accurate. Any smoothing or aggregation or whatever else you want for UI purposes should be handled in your controller. So, either a reusable proxy object (if you'd like to stick with bindings), or just coded in your controller such that it won't update the view at more than N Hz (in which case simply modifying the UI "manually" from your controller is probably the easiest option). Either way the implementation shouldn't be that tricky - just a timer and a last-updated timestamp. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Messed up UTIs in NSDocument-based application
On Tue, Jan 10, 2012 at 7:26 PM, Donald Ness wrote: > To recap, I released a document-based application with this: > > Document Types: > 1.) Name: "My Document", Extension: "myext", Identifier: "" > > Exported UTIs: (none) > Imported UTIs: (none) > > And now I have this: > > Document Types: > 1.) Name: "My Document", Extension: "myext", Identifier: "com.mycompany.myext" > 2.) Name: "My XML Document", Extension: "xml", Identifier: "public.xml" > > Exported UTIs: "com.mycompany.myext" > Imported UTIs: "public.xml" You should really post your exact plists here. It is important to be precise about which plist keys we're talking about. > > However, I my main document type is grayed out in the open dialog now. I'm at > a loss as to how file types are associated with applications, and how to fix > this issue. > > I really want to clean this up, so what's the best way to do so? You should start by removing the CFBundleTypeExtensions keys, assuming that's what "Extension" means here. The UTI declaration is responsible for declaring the extensions. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com