Saving NSDocument concurrently
Hi, Since saving a document can be a lengthy process in one of my apps, I am switching it to a concurrent thread. My idea is to do the following: - (void)saveToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo { NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock: ^{ [super saveToURL:absoluteURL ofType:typeName forSaveOperation:saveOperation delegate:delegate didSaveSelector:didSaveSelector contextInfo:contextInfo]; }]; [((MyAppDelegate *)[NSApp delegate]).operationQueue addOperation:operation]; } This allows the Save panel to be presented, if needed, on the main thread, and performs the actual saving in the background. Initial testing suggests that this is a workable solution and even allows multiple documents to be saved concurrently within the app. The recent menu appears to be correctly updated, as well as document dirty status, etc. My question is: can anyone see any possible gotchas with this technique? Any subtle ways in which things might not work as dependably as they appear? Cheers, António It isn't so important to do great things, as to do what you do with great love. ___ 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
UITableView with only 1 row selectable
Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. Regards, Remco Poelstra ___ 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: UITableView with only 1 row selectable
Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. Regards, Remco Poelstra ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: UITableView with only 1 row selectable
Hi, Thanks for your e-mail. I've considered this, but I think it's ugly that the rows flash blue momentarily. Is there a way to avoid that? Regards, Remco Op 24 dec 2010, om 11:01 heeft Roland King het volgende geschreven: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. Regards, Remco Poelstra ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: UITableView with only 1 row selectable
again read the documentation - it's all there .. quoting from it .. apple deals with that exact case This method is not called until users touch a row and then lift their finger; the row isn't selected until then, although it is highlighted on touch-down. You can use UITableViewCellSelectionStyleNone to disable the appearance of the cell highlight on touch-down. This method isn’t called when theediting property of the table is set to YES (that is, the table view is in editing mode). On 24-Dec-2010, at 6:03 PM, Remco Poelstra wrote: Hi, Thanks for your e-mail. I've considered this, but I think it's ugly that the rows flash blue momentarily. Is there a way to avoid that? Regards, Remco Op 24 dec 2010, om 11:01 heeft Roland King het volgende geschreven: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. Regards, Remco Poelstra ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: UITableView with only 1 row selectable
Yes, stupid me. I did search the documentation for a related problem: How can I detect whether the will and didAppear methods are called moving upwards or downwards through the viewControllers array of a navigationController? I mean I want to detect whether a TableViewController is shown because it's pushed on the stack or because a higher level TableView is just popped. Do I need custom logic to track that? Regards, Remco Op 24 dec 2010, om 11:11 heeft Roland King het volgende geschreven: again read the documentation - it's all there .. quoting from it .. apple deals with that exact case This method is not called until users touch a row and then lift their finger; the row isn't selected until then, although it is highlighted on touch-down. You can use UITableViewCellSelectionStyleNone to disable the appearance of the cell highlight on touch-down. This method isn’t called when theediting property of the table is set to YES (that is, the table view is in editing mode). On 24-Dec-2010, at 6:03 PM, Remco Poelstra wrote: Hi, Thanks for your e-mail. I've considered this, but I think it's ugly that the rows flash blue momentarily. Is there a way to avoid that? Regards, Remco Op 24 dec 2010, om 11:01 heeft Roland King het volgende geschreven: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. Regards, Remco Poelstra ___ 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/rols%40rols.org This email sent to r...@rols.org ___ 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: UITableView with only 1 row selectable
On Dec 24, 2010, at 4:01 AM, Roland King wrote: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. Actually, tableView:shouldSelectRow: should be used instead. Have it return YES only for rows that are selectable. I'll also assume that the OP is presenting the non-selectable rows differently (e.g. dimming them) to ensure that users will understand what is selectable and what is not. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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
Re: UKKQueue and CVS
Hi Uli, I did try various combinations of the flags, and I even tried listening for all events: UKKQueueNotifyAboutRename | UKKQueueNotifyAboutWrite | UKKQueueNotifyAboutDelete | UKKQueueNotifyAboutAttributeChange I din't receive events having done a cvs commit on a file. However, I do get notified if I edit the file externally using vi or some other editor. I googled quite a bit but I can't find out what CVS actually does during a commit. I guess I'll try to dig some more. Perhaps I can get the source code for CVS and check there. Cheers, Martin On Dec 24, 2010, at 12:22 AM, Uli Kusterer wrote: On 21.12.2010, at 11:58, Martin Hewitson wrote: I have implemented an editor where I use UKKQueue to handle changes to the file by other apps. The problem is that I don't get a notification if the file is committed to a CVS repository (or an SVN repository, for that matter). Many applications create a second file, write to that, then swap the two out afterwards. That way, if the write fails, you don't lose the file. Since kqueues work at a low level, you'll get a 'delete' or 'rename/move' notification in that case only. Have you checked if that's the case? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://www.zathras.de Martin Hewitson Albert-Einstein-Institut Max-Planck-Institut fuer Gravitationsphysik und Universitaet Hannover Callinstr. 38, 30167 Hannover, Germany Tel: +49-511-762-17121, Fax: +49-511-762-5861 E-Mail: martin.hewit...@aei.mpg.de WWW: http://www.aei.mpg.de/~hewitson ___ 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: Colored Pattern example problems
Thanks for reply Mr. Duncan, but it doesn't matter how you spin it. The title of the para. reads: A complete Colored Pattern Painting Function followed by: The function incorporates all the steps discussed previously - and this is what I expected. If the piece meal approach was taken to explanation, then a complete working example would be very helpful. I strongly believe that I'm not alone who finds playing with the working code the best, fastest and most rewarding way of learning. I hate as much reading instructions stretching over several pages, especially on the computer screen, as I hate reading ubiquitous programming soap-opera books, trying to teach by developing a single project over few hundred pages, often with missing information (D. Shaffer and few ADC books I own) and examples which don't work, often because the author didn't do any proof reading. As to the forums like this one, all questions should be answered. If the owner and moderators care about keeping it alive, they could appoint enough deputies to handle the workload. I'm also curious, but do not understand motivation of those who waste time with comments like: it should be obvious//clear, especially if the poster says he's a newbie. This may be an instant ego massage therapy for the respondent, but for the poster it is unhelpful. My expectation was that someone would copypaste the lines from the e-manual into a complete working example without error(s). This wouldn't take much more effort then what was written and would definitely earn him a big Thank you note. Finally, please do not construe the above as a request for such an effort. I printed the pages and am reading. Once again thank you and Merry Xmas. Jack. On 2010-12-23, at 6:01 PM, David Duncan wrote: On Dec 23, 2010, at 1:09 PM, FF wrote: On 2010-12-23, at 12:56 PM, David Duncan wrote: On Dec 23, 2010, at 5:58 AM, FF wrote: I copied this example from Apple docs. Generally the examples are there to show you how to use an API, not necessarily to be complete standalone code. You shouldn't necessarily expect doc examples to compile without doing extra work or cross referencing with another example. I thought, naively, that examples and tutorials in the docs are also aimed at beginners and showing them working examples, which compile without hiccups, is the best way to speed up the learning process. The examples are intended to demonstrate how the API works but have a greater context. In particular the example you saw is but one of a few in the same section describing different parts of the pattern creation. Listing 6-1 and 6-2 also have critical parts of the code that you should understand before being able to use listing 6-5. Because these listings are shown first, it is expected that by the time you get to listing 6-5 that you understand the parts that are being glazed over in that example – that is, you cannot just jump to listing 6-5 and use it without having read the entire section describing how patterns work. This isn't unlike a textbook on algorithms that expects you to have a familiarity with data structures (either via earlier chapters or externally) before you are able to understand how to perform operations on them. -- David Duncan ___ 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: Colored Pattern example problems
Hi Jack, Without getting into the merits of what expectations one should have regarding Apple's documentation, I just want to point out that the documentation pages have links available for the reader to make suggestions for improvements. If you think that Apple's docs should be presented differently then you might want to consider offering some suggestions directly to those who can do something about it, by filling out the forms available through those links. Have a good holiday. WT On Dec 24, 2010, at 2:06 PM, FF wrote: Thanks for reply Mr. Duncan, but it doesn't matter how you spin it. The title of the para. reads: A complete Colored Pattern Painting Function followed by: The function incorporates all the steps discussed previously - and this is what I expected. If the piece meal approach was taken to explanation, then a complete working example would be very helpful. I strongly believe that I'm not alone who finds playing with the working code the best, fastest and most rewarding way of learning. I hate as much reading instructions stretching over several pages, especially on the computer screen, as I hate reading ubiquitous programming soap-opera books, trying to teach by developing a single project over few hundred pages, often with missing information (D. Shaffer and few ADC books I own) and examples which don't work, often because the author didn't do any proof reading. As to the forums like this one, all questions should be answered. If the owner and moderators care about keeping it alive, they could appoint enough deputies to handle the workload. I'm also curious, but do not understand motivation of those who waste time with comments like: it should be obvious//clear, especially if the poster says he's a newbie. This may be an instant ego massage therapy for the respondent, but for the poster it is unhelpful. My expectation was that someone would copypaste the lines from the e-manual into a complete working example without error(s). This wouldn't take much more effort then what was written and would definitely earn him a big Thank you note. Finally, please do not construe the above as a request for such an effort. I printed the pages and am reading. Once again thank you and Merry Xmas. Jack. On 2010-12-23, at 6:01 PM, David Duncan wrote: On Dec 23, 2010, at 1:09 PM, FF wrote: On 2010-12-23, at 12:56 PM, David Duncan wrote: On Dec 23, 2010, at 5:58 AM, FF wrote: I copied this example from Apple docs. Generally the examples are there to show you how to use an API, not necessarily to be complete standalone code. You shouldn't necessarily expect doc examples to compile without doing extra work or cross referencing with another example. I thought, naively, that examples and tutorials in the docs are also aimed at beginners and showing them working examples, which compile without hiccups, is the best way to speed up the learning process. The examples are intended to demonstrate how the API works but have a greater context. In particular the example you saw is but one of a few in the same section describing different parts of the pattern creation. Listing 6-1 and 6-2 also have critical parts of the code that you should understand before being able to use listing 6-5. Because these listings are shown first, it is expected that by the time you get to listing 6-5 that you understand the parts that are being glazed over in that example – that is, you cannot just jump to listing 6-5 and use it without having read the entire section describing how patterns work. This isn't unlike a textbook on algorithms that expects you to have a familiarity with data structures (either via earlier chapters or externally) before you are able to understand how to perform operations on them. -- David Duncan ___ 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/jrcapab%40gmail.com This email sent to jrca...@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
Re: UKKQueue and CVS
Source control systems may modify hidden files locally when performing a commit; some have historically utilized the resource fork of the particular file instead to keep that commit/modified state. Still others may choose to use an xattr to track this. The bottom line is that the only real guarantee of a file being changed during a commit is within the repository of a source control system, not your local sandbox. - Gary L. Wade (Sent from my iPhone) On Dec 24, 2010, at 6:45 AM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: Hi Uli, I did try various combinations of the flags, and I even tried listening for all events: UKKQueueNotifyAboutRename | UKKQueueNotifyAboutWrite | UKKQueueNotifyAboutDelete | UKKQueueNotifyAboutAttributeChange I din't receive events having done a cvs commit on a file. However, I do get notified if I edit the file externally using vi or some other editor. I googled quite a bit but I can't find out what CVS actually does during a commit. I guess I'll try to dig some more. Perhaps I can get the source code for CVS and check there. Cheers, Martin On Dec 24, 2010, at 12:22 AM, Uli Kusterer wrote: On 21.12.2010, at 11:58, Martin Hewitson wrote: I have implemented an editor where I use UKKQueue to handle changes to the file by other apps. The problem is that I don't get a notification if the file is committed to a CVS repository (or an SVN repository, for that matter). Many applications create a second file, write to that, then swap the two out afterwards. That way, if the write fails, you don't lose the file. Since kqueues work at a low level, you'll get a 'delete' or 'rename/move' notification in that case only. Have you checked if that's the case? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://www.zathras.de Martin Hewitson Albert-Einstein-Institut Max-Planck-Institut fuer Gravitationsphysik und Universitaet Hannover Callinstr. 38, 30167 Hannover, Germany Tel: +49-511-762-17121, Fax: +49-511-762-5861 E-Mail: martin.hewit...@aei.mpg.de WWW: http://www.aei.mpg.de/~hewitson ___ 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/garywade%40desisoftsystems.com This email sent to garyw...@desisoftsystems.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
Re: Colored Pattern example problems
On Dec 24, 2010, at 11:34 AM, WT wrote: Hi Jack, Without getting into the merits of what expectations one should have regarding Apple's documentation, Or any documentation, for that matter. I just want to point out that the documentation pages have links available for the reader to make suggestions for improvements. If you think that Apple's docs should be presented differently then you might want to consider offering some suggestions directly to those who can do something about it, by filling out the forms available through those links. Agreed -- but you might want to wait. The usually-reliable feedback form is broken, at least for me on both Safari and Chrome. I get the message There was an error in processing the feedback you submitted. I just submitted Radar #8805484 about it. You can still submit feedback on the docs using Radar (bugreport.apple.com), which has the benefit that you'll have a ticket you can refer to. The feedback links in the documentation itself make it quick and easy to submit feedback, but communication is one-way. --Andy Have a good holiday. WT On Dec 24, 2010, at 2:06 PM, FF wrote: Thanks for reply Mr. Duncan, but it doesn't matter how you spin it. The title of the para. reads: A complete Colored Pattern Painting Function followed by: The function incorporates all the steps discussed previously - and this is what I expected. If the piece meal approach was taken to explanation, then a complete working example would be very helpful. I strongly believe that I'm not alone who finds playing with the working code the best, fastest and most rewarding way of learning. I hate as much reading instructions stretching over several pages, especially on the computer screen, as I hate reading ubiquitous programming soap-opera books, trying to teach by developing a single project over few hundred pages, often with missing information (D. Shaffer and few ADC books I own) and examples which don't work, often because the author didn't do any proof reading. As to the forums like this one, all questions should be answered. If the owner and moderators care about keeping it alive, they could appoint enough deputies to handle the workload. I'm also curious, but do not understand motivation of those who waste time with comments like: it should be obvious//clear, especially if the poster says he's a newbie. This may be an instant ego massage therapy for the respondent, but for the poster it is unhelpful. My expectation was that someone would copypaste the lines from the e-manual into a complete working example without error(s). This wouldn't take much more effort then what was written and would definitely earn him a big Thank you note. Finally, please do not construe the above as a request for such an effort. I printed the pages and am reading. Once again thank you and Merry Xmas. Jack. On 2010-12-23, at 6:01 PM, David Duncan wrote: On Dec 23, 2010, at 1:09 PM, FF wrote: On 2010-12-23, at 12:56 PM, David Duncan wrote: On Dec 23, 2010, at 5:58 AM, FF wrote: I copied this example from Apple docs. Generally the examples are there to show you how to use an API, not necessarily to be complete standalone code. You shouldn't necessarily expect doc examples to compile without doing extra work or cross referencing with another example. I thought, naively, that examples and tutorials in the docs are also aimed at beginners and showing them working examples, which compile without hiccups, is the best way to speed up the learning process. The examples are intended to demonstrate how the API works but have a greater context. In particular the example you saw is but one of a few in the same section describing different parts of the pattern creation. Listing 6-1 and 6-2 also have critical parts of the code that you should understand before being able to use listing 6-5. Because these listings are shown first, it is expected that by the time you get to listing 6-5 that you understand the parts that are being glazed over in that example – that is, you cannot just jump to listing 6-5 and use it without having read the entire section describing how patterns work. This isn't unlike a textbook on algorithms that expects you to have a familiarity with data structures (either via earlier chapters or externally) before you are able to understand how to perform operations on them. -- David Duncan ___ 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/jrcapab%40gmail.com This email sent to jrca...@gmail.com ___ Cocoa-dev mailing list
Edit text bounding boxes
Hi, I am having trouble with the edit text bounding box for both a NSTextFieldCell and a ImageAndTextCell. The cells are used in a NSOutlineView which has a single NSTableColumn. There are two Interface builder nib files that define the window. The first which is simple defines the window itself (NSWindow) and a single placeholder NSView which fills the content region of the window. The second is a NSView that contains a NSScrollView which contains an NSOutlineView with the single NSTableColumn. At run time the application loads the window defined in interface builder, in the awakeFromNib message for the NSWindowController I have the following code which loads the second nib file by creating its view controller and inserts the view into the window's placeholder view. sitePanelController = [[FWSitePanelViewController alloc] initWithDocument:[self document]]; [sitePanelPlaceHolderView addSubview:[sitePanelController view]]; After doing this and adding some content for the NSOutlineView if the cells are NSTextFieldCell then the bounding box for editing text is correct for top level items is fine, but for all other items the edit text bounding box on the right hand edge is clipped by the vertical scroller of the NSScrollView. If the cells are defined by the class ImageAndTextCell then the bounding box for all items even top level items are clipped by the vertical scroller. This can create some odd text editing behaviour as the insertion point disappears. If the original view containing the NSScrollView was wider than the window then resizing the window using the mouse to be wider than interface builder defined width for the NSScrollView then suddenly the bounding box for the edit text fields works. Once it works it is fine and you can resize the window back down to be less than the width and everything works fine. All the views are setup to autoresize appropriately when changing the size of their superview and this clearly works correctly after the window is resized using the mouse to be big enough for the first time. I have tried all sorts of things to get this to work without success. I added the following code to the awakeFromNib message (originally only the first line of the code): [[sitePanelController view] setFrame:[sitePanelPlaceHolderView frame]]; NSSize viewSize = [[sitePanelController view] frame].size; CGFloat widthDiff = [[sitePanelController view] frame].size.width - [sitePanelPlaceHolderView frame].size.width; [[sitePanelController view] setFrame:[sitePanelPlaceHolderView frame]]; NSSize frameSize = [[sitePanelController sitePanelOutline] frame].size; frameSize.width -= widthDiff; [[sitePanelController sitePanelOutline] setFrameSize:frameSize]; NSTableColumn *column1 = [[sitePanelController sitePanelOutline] tableColumnWithIdentifier:@SITEPANEL_COLUMN1]; [column1 setWidth:[column1 width] - widthDiff]; This didn't help plus I also tried making changes to the selectWithFrame message in the ImageAndTextCell class without success. I've tried making the view defined in the second nib file, bigger, smaller, and the eact size to fit into the frame of the placeholder view in the window. None of it helps. I kind of feel like the view/window needs to be nudged/kicked in some way to achieve the same result that I get when resizing the window using the mouse, but I'm currently at a loss. Thoughts, help please. Kevin ___ 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: Colored Pattern example problems
On Fri, Dec 24, 2010 at 11:06 AM, FF fm...@ncf.ca wrote: As to the forums like this one, all questions should be answered. This is not an official communications channel. If you require a response from Apple, take out a DTS incident. If you're filing a bug, use the bug reporter. --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: UITableView with only 1 row selectable
Hi, I'm unable to find that method. Is it still available? Kind regards, Remco Op 24 dec. 2010 om 14:01 heeft Ricky Sharp rsh...@mac.com het volgende geschreven: On Dec 24, 2010, at 4:01 AM, Roland King wrote: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. Actually, tableView:shouldSelectRow: should be used instead. Have it return YES only for rows that are selectable. I'll also assume that the OP is presenting the non-selectable rows differently (e.g. dimming them) to ensure that users will understand what is selectable and what is not. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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
Re: UITableView with only 1 row selectable
On Dec 24, 2010, at 12:28 PM, Remco Poelstra wrote: Hi, I'm unable to find that method. Is it still available? Are you looking in the delegate docs? http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html Search the page for tableView:shouldSelectRow: --Andy Kind regards, Remco Op 24 dec. 2010 om 14:01 heeft Ricky Sharp rsh...@mac.com het volgende geschreven: On Dec 24, 2010, at 4:01 AM, Roland King wrote: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. Actually, tableView:shouldSelectRow: should be used instead. Have it return YES only for rows that are selectable. I'll also assume that the OP is presenting the non-selectable rows differently (e.g. dimming them) to ensure that users will understand what is selectable and what is not. On 24-Dec-2010, at 5:23 PM, Remco Poelstra wrote: Hi, I've an UITableView with allowsSelection=NO; I was wondering whether it's possible to do allow selection of a specific row. Is there some way I can detect a touch of a row and simulate a select in software? Thanks in advance. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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/aglee%40mac.com This email sent to ag...@mac.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
Re: UITableView with only 1 row selectable
NSTableView ≠ UITableView On Dec 24, 2010, at 9:29 AM, Andy Lee wrote: Are you looking in the delegate docs? http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html Search the page for tableView:shouldSelectRow: ___ 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: UITableView with only 1 row selectable
Whoops, sorry. --Andy On Dec 24, 2010, at 12:31 PM, Dave DeLong wrote: NSTableView ≠ UITableView On Dec 24, 2010, at 9:29 AM, Andy Lee wrote: Are you looking in the delegate docs? http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html Search the page for tableView:shouldSelectRow: ___ 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
NSTextField in NSMenuItem
How can I display an editable NSTextField inside an NSMenuItem? I'm looking to do something similar to Spotlight. Would it work by simply usingsetView: on the menu item? Thanks! ___ 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: UITableView with only 1 row selectable
On Dec 24, 2010, at 11:28 AM, Remco Poelstra wrote: Hi, I'm unable to find that method. Is it still available? Kind regards, Remco Op 24 dec. 2010 om 14:01 heeft Ricky Sharp rsh...@mac.com het volgende geschreven: On Dec 24, 2010, at 4:01 AM, Roland King wrote: Why not do it the other way around. Set allowsSelection to YES and then implement the delegate method tableView:willSelectRowAtIndexPath: to return nil for any row you do NOT want selected (see the documentation). That seems to be apple's designed way to do this. Actually, tableView:shouldSelectRow: should be used instead. Have it return YES only for rows that are selectable. I'll also assume that the OP is presenting the non-selectable rows differently (e.g. dimming them) to ensure that users will understand what is selectable and what is not. Very sorry for this bad info; when searching for APIs, I had both Mac OS X and iOS doc sets enabled. tableView:willSelectRowAtIndexPath: as was pointed out earlier is what you want. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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
UISearchDisplayController in UIToolbar on iPad
Here is the situation. On iOS you must listen to memory warnings and handle them properly. So we have a view controller that we use with a UISearchDisplayController that sits in a UIToolbar on an iPad. If a memory warning occurs while the popover is up, the popover goes away, the search bar goes away and its gone. If I comment out the memory warning code then the OS runs as slow as mollasses and we see this in the console: wait_fences: failed to receive reply: 10004003 Its Christmas Eve and I'm a bit frustrated so perhaps I'm missing something basic/fundamental. I see in the docs it says If a search display controller is destroyed (for example, in response to a memory warning), then you can create a new one and associate it with the original view controller or search bar. but I don't get why that happens when its being shown?___ 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: NSTextField in NSMenuItem
On Fri, Dec 24, 2010 at 12:49 PM, Joshua Garnham joshua.garn...@yahoo.co.uk wrote: How can I display an editable NSTextField inside an NSMenuItem? I'm looking to do something similar to Spotlight. You can't. NSMenu doesn't support the event model necessary for this. Spotlight doesn't use a menu for this; it uses a borderless window. --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: UISearchDisplayController in UIToolbar on iPad
On Fri, 24 Dec 2010 12:12:32 -0600, Alex Kac a...@webis.net said: we have a view controller that we use with a UISearchDisplayController that sits in a UIToolbar on an iPad No, it doesn't. A UISearchDisplayController is a controller. A UIToolbar is a view. A controller can't sit in a view. It is really helpful if your question is formulated so as to use language and concepts accurately. Otherwise everyone has to guess what you really mean, which is difficult and inaccurate. Maybe what you mean is that a UISearchBar sits in a UIToolbar, but it's really hard to tell, and we shouldn't have to guess (and doesn't explain what the UISearchDisplayController has to do with the story). Your misformulation might or might not even mask the source of the problem. If a memory warning occurs while the popover is up, the popover goes away, the search bar goes away and its gone Again - the popover? You never said anything up to this point about a popover, so how does it come in? Basically, it will help if you describe what is really happening. Of course having a problem is frustrating, but don't take it out on the list! :) Taking the time for structure a clear and accurate description of the problem could actually help you towards a solution, as well as allowing others to reproduce or analyze it usefully. It sounds like what you're really complaining about is that when there's a memory warning your popover is dismissed. Is that right? This doesn't happen for me when I'm displaying a popover and I simulate a memory warning in the simulator, so again, how are you generating your warning? Basically, what I'm asking is that you do what a scientist would do in lab notes: say enough to constitute instructions so that someone else can perform the same experiment. Otherwise no one even knows that the problem really is. m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings___ 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: UKKQueue and CVS
On 24 Dec 2010, at 16:43, Gary L. Wade wrote: Source control systems may modify hidden files locally when performing a commit; some have historically utilized the resource fork of the particular file instead to keep that commit/modified state. Still others may choose to use an xattr to track this. The bottom line is that the only real guarantee of a file being changed during a commit is within the repository of a source control system, not your local sandbox. In particular, you should take advantage of any hooks offered by the VCS. Google suggests that CVS has some hooks called after commits are made, which sounds ideal. Cheers, Chris ___ 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: NSTextField in NSMenuItem
NSMenuItem's -setView: method should do what you need. -jcr On Dec 24, 2010, at 11:49 AM, Joshua Garnham wrote: How can I display an editable NSTextField inside an NSMenuItem? I'm looking to do something similar to Spotlight. Would it work by simply usingsetView: on the menu item? Thanks! ___ 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/jcr%40mac.com This email sent to j...@mac.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
Re: [Moderator] Re: Mac Apps
On Dec 24, 2010, at 1:10 PM, Shawn Bakhtiar wrote: Actually I was thinking the same thing, some help on how the Xcode / Cocoa cycle works in regards to distributing via App store would be really cool, and if there are any Cocoa adds to help validate, etc Putting that information here would also aid in future searchers looking at the archives in more readily finding information. http://developer.apple.com/programs/mac/distribution.html Agreed. and next time I can get things approved, I will try and point there. I not sure if you have to be part of the developer program, but once I logged in the start page is: https://developer.apple.com/devcenter/mac/checklist/ A checklist of things to do to get your application read. What you need to do in Xcode, when developing a Cocoa application, to setup the project correctly (which is relevant here (IMHO)): https://developer.apple.com/devcenter/mac/documents/submitting.html I hope this helps, more than No soup for you!!!” I certainly didn’t mean no soup for you. Just you won’t get an official answer here. From: sc...@cocoadoc.com Date: Thu, 23 Dec 2010 22:33:22 -0500 To: k...@highrolls.net CC: cocoa-dev@lists.apple.com Subject: [Moderator] Re: Mac Apps This isn’t the proper forum to get that question answered. d...@apple.com perhaps devforums.apple.com On Dec 23, 2010, at 7:30 PM, k...@highrolls.net wrote: What say you any Apple lurkers is James and me right in our assumption or do I have to pay the $99 to find out if I want to pay the $99? -koko On Dec 23, 2010, at 3:45 PM, James West wrote: Presumably, yes. With the added bonus of app store distribution. - James On Thu, Dec 23, 2010 at 3:57 PM, k...@highrolls.net wrote: I haven't thrown in my $99 yet so I cannot get the details on a 'Mac App'. Is a Mac App just a Cocoa app that is signed? ___ 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/shashaness%40hotmail.com This email sent to shashan...@hotmail.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
Re: [Moderator] Re: Mac Apps
On Fri, Dec 24, 2010 at 9:49 PM, Scott Anguish sc...@cocoadoc.com wrote: On Dec 24, 2010, at 1:10 PM, Shawn Bakhtiar wrote: I hope this helps, more than No soup for you!!!” I certainly didn’t mean no soup for you. Godwin! sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net ___ 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: UKKQueue and CVS
Thanks to all for the pointers and suggestions. I'll do some more research and report back if I find a good solution. Merry Christmas to all, Martin On Dec 24, 2010, at 10:48 PM, Chris Ridd wrote: On 24 Dec 2010, at 16:43, Gary L. Wade wrote: Source control systems may modify hidden files locally when performing a commit; some have historically utilized the resource fork of the particular file instead to keep that commit/modified state. Still others may choose to use an xattr to track this. The bottom line is that the only real guarantee of a file being changed during a commit is within the repository of a source control system, not your local sandbox. In particular, you should take advantage of any hooks offered by the VCS. Google suggests that CVS has some hooks called after commits are made, which sounds ideal. Cheers, Chris ___ 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/martin.hewitson%40aei.mpg.de This email sent to martin.hewit...@aei.mpg.de Martin Hewitson Albert-Einstein-Institut Max-Planck-Institut fuer Gravitationsphysik und Universitaet Hannover Callinstr. 38, 30167 Hannover, Germany Tel: +49-511-762-17121, Fax: +49-511-762-5861 E-Mail: martin.hewit...@aei.mpg.de WWW: http://www.aei.mpg.de/~hewitson ___ 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