Re: A directory site for open-source Cocoa components?
There is also http://codebeach.org/ On May 22, 2008, at 10:29 AM, Jens Alfke wrote: There are quite a lot of open source Cocoa components these days — everything from small utility classes, to new controls, to entire frameworks — but no easy way to find them all. I keep running into various people's websites that list a handful of components, some of them extremely useful, and I'm sure there are more I haven't seen. I don't know of any website that acts as a directory of these. If there really isn't one, maybe we should create one. It wouldn't necessarily need to be the whole ___Forge deal, with source hosting and bug tracking and all, though that wouldn't hurt; the main thing is just to provide a way to register these projects and their descriptions, and then search the directory. Anyone interested? (Or know of an existing site that I've overlooked?) —Jens ___ 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 [EMAIL PROTECTED]
Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
On 23 May 2008, at 01:38, [EMAIL PROTECTED] wrote: On May 22, 2008, at 11:15 AM, Jonathan Hendry wrote: Perhaps a better way of doing this would be a web or WebKit app with two panes. One that shows the Apple docs at Apple's site, and the other pane points to a page at a non-Apple wiki site that corresponds to the currently displayed Apple site. That would ensure that the Apple content stays up to date, while allowing unlimited wiki commenting. This is not just better, it is probably the best idea I've ever heard on this subject. if this was integrated into something like AppKido with the current CocoaDev.com wiki you could create everything you want without relying on Apple's involvement or buy-in. 1. For me the documentation would be very hard to use without the excellent AppKiDo. 2. It really should be Apple's job to provide something like AppKiDo. 3. What I really want: NextStep's Digital Librarian + AppKiDo + a pane pointing to a a non-Apple wiki site that corresponds to the currently displayed info, as suggested by Jonathan Hendry + a pane pointing to some information on my local disk, where I keep all those remarks which I would write on the margin of the document if it would be a printed one. Kind regards, Gerriet. ___ 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 [EMAIL PROTECTED]
Re: DirWatch
On 23.5.2008, at 6:42, Ken Thomases wrote: On May 22, 2008, at 10:56 PM, Ken Thomases wrote: On May 22, 2008, at 6:57 PM, Lorenzo wrote: I can't. Think about the FNSubscribe tells me that there is something new because the user copied 2 new files into that folder, but only one file is totally copied, the other one is still in copying. So now I scan the folder with directoryContentsAtPath I compare with the previous list and I know that there are 2 new files. Well, one file is totally copied and the other one could be still in copying. You can try FSGetCatalogInfo() and the kFSNodeForkOpenBit of the nodeFlags field of the FSCatalogInfo structure to test if the file is still open. I'm not sure if this is supported on all filesystems that Mac OS X supports. It's actually very unusual for an OS or filesystem implementation to keep that sort of information in application-accessible form. The problem on a preemptively multi-tasking system is that the file's status can change between when you test and when you act on the results of the test. Generally speaking, sometimes the solution to a race condition like that is to attempt to grab the contended resource for exclusive access. If you succeed, you know that nobody else was using the resource, nor will they be able to start using it while you're using it. Again, it's quite unusual for modern OSes to support mandatory locking of files in this way. Most only provide advisory locking. However, Mac OS X's File Manager still maintains provisions for it. Once again, they may not work on all filesystems. In addition to the File Manager Reference, you can check out Technical Note FL37 http://developer.apple.com/technotes/fl/fl_37.html, although it's nearly archaic. (Not as archaic as the date it claims, though! :) OK, so none of the above actually works in the general case on Mac OS X. I checked the nodeFlags thing myself with a little test program and it doesn't work. The bits indicating if forks are open are never set. Also, I found a more recent technote regarding exclusive file access: http://developer.apple.com/technotes/tn/tn2037.html . That technote, though, does indicate that the frameworks perform and respect advisory locking. So, this is pretty good. It covers the most common cases. The exception would be a program using the BSD/ POSIX file access routines directly. Regards, Ken ___ I remember a utility which I wrote several years ago and I solved the problem using timer. I had a preference setting allowing to set 'how many seconds should I wait, until I take the file as complete'. Robert ___ 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 [EMAIL PROTECTED]
Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
On May 23, 2008, at 2:23 AM, Gerriet M. Denkmann wrote: 1. For me the documentation would be very hard to use without the excellent AppKiDo. 2. It really should be Apple's job to provide something like AppKiDo. There is new browsing facilities in Xcode 3.0. Research Assistant, and the class browser.. I believe those are intended to provide something in that direction... 3. What I really want: NextStep's Digital Librarian May I ask at this point why? Given the current integration of search and viewing in various apps I'm not sure how DL would really fit with the modern system. There are various third party apps that allow you to collect and index PDFs as well.. that would give you DL functionality almost completely. ___ 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 [EMAIL PROTECTED]
Re: DirWatch
Thank you so much Ken, I would like to use the BSD/POSIX file access routines. May you give me a pointer? Best Regards -- Lorenzo email: [EMAIL PROTECTED] From: Ken Thomases [EMAIL PROTECTED] Date: Thu, 22 May 2008 23:42:00 -0500 To: Lorenzo [EMAIL PROTECTED] Cc: Jens Alfke [EMAIL PROTECTED], Cocoa Development cocoa-dev@lists.apple.com Subject: Re: DirWatch On May 22, 2008, at 10:56 PM, Ken Thomases wrote: On May 22, 2008, at 6:57 PM, Lorenzo wrote: I can't. Think about the FNSubscribe tells me that there is something new because the user copied 2 new files into that folder, but only one file is totally copied, the other one is still in copying. So now I scan the folder with directoryContentsAtPath I compare with the previous list and I know that there are 2 new files. Well, one file is totally copied and the other one could be still in copying. You can try FSGetCatalogInfo() and the kFSNodeForkOpenBit of the nodeFlags field of the FSCatalogInfo structure to test if the file is still open. I'm not sure if this is supported on all filesystems that Mac OS X supports. It's actually very unusual for an OS or filesystem implementation to keep that sort of information in application-accessible form. The problem on a preemptively multi-tasking system is that the file's status can change between when you test and when you act on the results of the test. Generally speaking, sometimes the solution to a race condition like that is to attempt to grab the contended resource for exclusive access. If you succeed, you know that nobody else was using the resource, nor will they be able to start using it while you're using it. Again, it's quite unusual for modern OSes to support mandatory locking of files in this way. Most only provide advisory locking. However, Mac OS X's File Manager still maintains provisions for it. Once again, they may not work on all filesystems. In addition to the File Manager Reference, you can check out Technical Note FL37 http://developer.apple.com/technotes/fl/fl_37.html , although it's nearly archaic. (Not as archaic as the date it claims, though! :) OK, so none of the above actually works in the general case on Mac OS X. I checked the nodeFlags thing myself with a little test program and it doesn't work. The bits indicating if forks are open are never set. Also, I found a more recent technote regarding exclusive file access: http://developer.apple.com/technotes/tn/tn2037.html. That technote, though, does indicate that the frameworks perform and respect advisory locking. So, this is pretty good. It covers the most common cases. The exception would be a program using the BSD/ POSIX file access routines directly. Regards, Ken ___ 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 [EMAIL PROTECTED]
Re: DirWatch
On 23 May 2008, at 00:33, Jerry Krinock wrote: On 2008 May, 22, at 15:45, Robert Cerny wrote: On 23.5.2008, at 0:32, Lorenzo wrote: I need to watch at a given folder and check whenever a new file has been copied therein. At the beginning, I fired a timer periodically getting the list of the contents of that folder with directoryContentsAtPath Don't do that. The solution for this problem has been built into the system since Mac OS 10.2 or .3, as noted by Robert: UKQueue by Uli http://www.zathras.de/angelweb/sourcecode.htm And if your target is Mac OS 10.5 or later, look into FSEvents. And if you do that, Stuart Connolly has written a nice wrapper called SCEvents: http://stuconnolly.com/projects/source-code/ Simon smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Query about Zip command
Hi all, I am developing cocoa application using NSApplescript class to do shell scripting which involves zip command. I am using zip command for zipping the files because there is no framework api available for it. Even though libz is available, it is not easy to use. (I can't use NSData because I am using output zip file for distribution as an alternate to pkg). My query is Is it possible that any Mac system will not have zip command? because if there is then my code will fail. I went through docs came to know that Finder uses its own code for archiving the files. I hope this is right mailing list, if not then sorry. Thanks, Palav -- There are many things in your life that will catch your eye but only a few will catch your heartpursue those'. ___ 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 [EMAIL PROTECTED]
Re: PDFPage Creation query
Heya... That completely does it!! I had overlooked - (Class) pageClass Thanks a ton. There are a couple of other queries I have. 1. How to display the thumbnails in a PDFThumbnailView without their corresponding labels ? 2. On double clicking on a PDFPage in an document I want to change the color of the page,eg. On Thu, May 22, 2008 at 2:35 PM, Antonio Nunes [EMAIL PROTECTED] wrote: On May 22, 2008, at 10:20 AM, Amrit Majumdar wrote: I was planning to create a new PDFDocument, with my own PDF Page that I generate after subclassing PDFPage Accordingly I subclassed PDFPage and have over-riden [initWithImage] [...] MyPDFPageClass *myPDFPage = [[ MyPDFPageClass alloc ]initWithImage:img]; You did not post the code in the overriden initWithImage:, which is likely to be the crucial factor in the situation you describe. Having said that, I wonder why you would need to override initWithImage:. In the code you posted I see no need for that. You also want to check out and read up on PDFDocument's pageClass method. From the header file's commentary: // This is the class that will be allocated and initialized when page objects are created for the document. The // default implementation returns [PDFPage class] but if you want PDFDocument to use your own custom class you can // subclass PDFDocument and implement this method to return your own custom class. Your class should be a subclass of // PDFPage (otherwise the behavior is undefined). Further, you may have your reasons for wanting to create an image based PDF page from any PDF page source, but if you don't, your process can be much simpler: Subclass PDFDocument, and override the pageClass method to return your custom PDFPage subclass. - (Class) pageClass { // Instruct PDFDocument to create MyPDFPageClass objects instead of the default PDFPage objects. return [MyPDFPageClass class]; } Then load PDF data into your PDFDocument's subclass: [[MySubclassedPDFDocument alloc] initWithXXX:yyy]; ... and the pages will already be of type MyPDFPageClass. António --- What you have inside you expresses itself through both your choice of words and the level of energy you assign to them. The more healed, whole and connected you feel inside, the more healing your words will be. --Rita Goswami --- ___ 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 [EMAIL PROTECTED]
Re: Properties GC (was Re: Cocoa et al as HCI usability problem)
On Fri, May 23, 2008 at 4:30 PM, Sherm Pendley [EMAIL PROTECTED] wrote: Obviously - but *which* Cocoa developers? I suspect that many veterans would categorize these additions as premature optimization - I can't speak for anyone else, but it's been years since I needed to write an accessor method by hand, or put a significant amount of thought into memory management. This veteran really likes GC. It's delightfully liberating not to have to think about memory management. Of course retain/release is not a great deal of effort in the first place, but it's great to have that bit of mental overhead go away. The irony, of course, is that my day job involves doing lots of realtime audio processing with Objective-C code, thus completely eliminating any possibility of using GC. But I'll be using it for any projects where I can get away with it. For the rest, I can take it or leave it. They're mildly nice but not compelling and I have a hard time figuring out why Apple has decided to refer to *this* particular set of ObjC additions as 2.0. Under the 64 bit runtime, properties can also be used to synthesize the storage associated with a particular property. Does this work like inside-out objects? What I'm referring to is a concept found in some Perl OOP modules, to work around its lack of access limiters such as private or protected. For each property, a hash (a dictionary, in Cocoa lingo) is created, and accessor methods that store and fetch values from it, using the object itself as the key. It's much simpler than that. Class sizes are simply looked up at runtime rather than at compile time, which means that a subclass no longer needs to know the size of its superclass when it's built. Does this sound similar? Objective-C obviously already has access limiters, but disassociating the object and property storage would eliminate the last remnants of the fragile base class problem. It would also allow categories to add ivars, would it not? Categories could only add ivars if they were loaded at the same time as the main class, otherwise they could change the size of already instantiated objects which is Very Bad. As far as I know even this is not currently allowed by the language, though. Mike ___ 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 [EMAIL PROTECTED]
Re: Query about Zip command
On 23 May 08, at 01:26, parag vibhute wrote: I am developing cocoa application using NSApplescript class to do shell scripting which involves zip command. I am using zip command for zipping the files because there is no framework api available for it. Even though libz is available, it is not easy to use. (I can't use NSData because I am using output zip file for distribution as an alternate to pkg). My query is Is it possible that any Mac system will not have zip command? because if there is then my code will fail. I went through docs came to know that Finder uses its own code for archiving the files. Two answers: 1. The zip binary is a required component on 10.4 and above. It was optional but installed by default on 10.3, and was not installed by default on 10.2 and earlier. Statistics from Adium and the Omni Group both suggest that anything before 10.3 is basically nonexistent in the wild, so you're safe assuming it's there. 2. While libz may get you part of the way to reading PKZip archives, it only implements the deflate compression algorithm - it won't read the directory components of the archive for you. So don't expect it to do all the work for you. ___ 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 [EMAIL PROTECTED]
Re: Query about Zip command
I was looking for this answer only. Thanks a lot. Palav On Fri, May 23, 2008 at 2:23 PM, Andrew Farmer [EMAIL PROTECTED] wrote: On 23 May 08, at 01:26, parag vibhute wrote: I am developing cocoa application using NSApplescript class to do shell scripting which involves zip command. I am using zip command for zipping the files because there is no framework api available for it. Even though libz is available, it is not easy to use. (I can't use NSData because I am using output zip file for distribution as an alternate to pkg). My query is Is it possible that any Mac system will not have zip command? because if there is then my code will fail. I went through docs came to know that Finder uses its own code for archiving the files. Two answers: 1. The zip binary is a required component on 10.4 and above. It was optional but installed by default on 10.3, and was not installed by default on 10.2 and earlier. Statistics from Adium and the Omni Group both suggest that anything before 10.3 is basically nonexistent in the wild, so you're safe assuming it's there. 2. While libz may get you part of the way to reading PKZip archives, it only implements the deflate compression algorithm - it won't read the directory components of the archive for you. So don't expect it to do all the work for you. -- There are many things in your life that will catch your eye but only a few will catch your heartpursue those'. ___ 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 [EMAIL PROTECTED]
Re: Properties GC (was Re: Cocoa et al as HCI usability problem)
On Fri, May 23, 2008 at 4:45 AM, Michael Ash [EMAIL PROTECTED] wrote: On Fri, May 23, 2008 at 4:30 PM, Sherm Pendley [EMAIL PROTECTED] wrote: Does this sound similar? Objective-C obviously already has access limiters, but disassociating the object and property storage would eliminate the last remnants of the fragile base class problem. It would also allow categories to add ivars, would it not? Categories could only add ivars if they were loaded at the same time as the main class, otherwise they could change the size of already instantiated objects which is Very Bad. That's just the problem that inside-out objects would solve! With the ivars stored separately from the isa pointer, adding an ivar would simply add another ivar storage dictionary to the heap. Since inside-out objects are nothing more than keys into the ivar storage dictionaries, adding another dictionary doesn't change the size of any objects past, present, or future. As far as I know even this is not currently allowed by the language, though. It's not, because of the problem you describe - an object's isa pointer and all its ivar storage is allocated in one contiguous block. 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 [EMAIL PROTECTED]
RE:PDFPage Creation query
Appologise for shooting an incomplete email earlier! There are a couple of other queries I have. 1. How to display the thumbnails in a PDFThumbnailView without their corresponding labels? 2. On double clicking on a PDFPage in an document I want to change the color of the page,eg. I double click on page 2 of an Doc ,the doc displays all other pages in their original form except page 2 which is displayed let's say in blue color. Right now I have managed to turn all the pages of the Doc to blue and reflect the change in their corresponding thumbnails. I have modified the following method in my PDFPage Subclass - (void) drawWithBox: (PDFDisplayBox) box The drawWithBox: contains some code like if (b_turnCurrnetPageBlue ) // set to TRUE in mouseDown method { // page is the current page. //NSRect rect = [page boundsForBox: kPDFDisplayBoxMediaBox]; NSRect rect = [self boundsForBox: box]; [[[NSColor blueColor]colorWithAlphaComponent:0.5] set]; NSRectFillUsingOperation(rect,NSCompositeSourceOver); } Now on double clicking on any page in my doc, the entire doc changes in appearence.How do I identify a single page and apply these changes only to the particular page ? Thanks everyone for helping me out till this point. TIA, Amrit ___ 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 [EMAIL PROTECTED]
Re: DirWatch
On May 23, 2008, at 2:37 AM, Lorenzo wrote: Thank you so much Ken, I would like to use the BSD/POSIX file access routines. Wait, what? Why? The BSD/POSIX routines are the ones which _won't_ (by default) be useful for detecting if a file is still open in another program. If you attempt to open a file using the frameworks (Cocoa or Carbon), they will automatically attempt exclusive access. Therefore, you can use that to test if another program has the file open for writing, on some filesystems. Except that, if the other program is using the BSD/ POSIX file access routines and has not been coded to respect advisory locks, then you won't be able to tell that it has the file open. I see no advantage for you to use the BSD/POSIX routines. May you give me a pointer? Sure, if you really think that's what you want. You should just read the man pages for open, read, write, etc. Or you can mix stdio fopen, fread, fwrite, etc. with the flock system call. Cheers, Ken ___ 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 [EMAIL PROTECTED]
Re: Appkido support for Iphone dev
On May 23, 2008, at 6:28 AM, nishant jain wrote: Hi all,I am little bit into iphone native application dev. Can anybody help me with xcode support for iphone API just like appkido or any other such tool. http://www.cocoabuilder.com/archive/message/cocoa/2008/5/15/206811 -- I.S. ___ 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 [EMAIL PROTECTED]
Re: Appkido support for Iphone dev
Thanks for reminding me. On Fri, May 23, 2008 at 4:16 PM, I. Savant [EMAIL PROTECTED] wrote: On May 23, 2008, at 6:28 AM, nishant jain wrote: Hi all,I am little bit into iphone native application dev. Can anybody help me with xcode support for iphone API just like appkido or any other such tool. http://www.cocoabuilder.com/archive/message/cocoa/2008/5/15/206811 -- I.S. ___ 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 [EMAIL PROTECTED]
NSProgressIndicator
I have successfully been able to create a small project whose GUI consists of a NSProgressIndicator, or wheel, and a Button, titled Spin. In the .nib window, the Controller is ctrl-dragged to the wheel, specifying an outlet wheel and the Button is ctrl-dragged to the Controller, specifying an action :spin:. Within the Controller.h file, I have: @interface Controller:NSObject { IBOutlet NSProgressIndicator *spinner; BOOL start; } - (IBAction) spin:(id)sender; Within the Controller.m file, I have: @implementation Controller - (id) init { if (self = [super init]) { spinner = [[[NSProgressIndicator alloc] init] autorelease]; start = TRUE; } return self; } - (void) awakeFromNib { // [theIndicator setStyle:NSProgressIndicatorSpinningStyle]; // already there [spinner setUsesThreadedAnimation:YES]; } - (IBAction) spin:(id)sender { if (start) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; start = !start; } @end == Works like a champ .. pressing the Button starts, stops the spinning like it should. NOW .. another speed bump .. how to control the spinning from other objects, i.e., no IBAction .. so, remove the Button. Changing the spin method to look like: - (void) spinIt:(BOOL)begin { if (begin) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; } Here is what I've tried, to no success: ___ 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 [EMAIL PROTECTED]
NSProgressIndicator -- delete the first message with same title
I have successfully been able to create a small Cocoa multiple document project whose GUI consists of a NSProgressIndicator, or wheel, and a Button, titled Spin. In the .nib window, the Controller is ctrl-dragged to the wheel, specifying an outlet wheel and the Button is ctrl-dragged to the Controller, specifying an action :spin:. Within the Controller.h file, I have: @interface Controller:NSObject { IBOutlet NSProgressIndicator *spinner; BOOL start; } - (IBAction) spin:(id)sender; Within the Controller.m file, I have: @implementation Controller - (id) init { if (self = [super init]) { spinner = [[[NSProgressIndicator alloc] init] autorelease]; start = TRUE; } return self; } - (void) awakeFromNib { [spinner setUsesThreadedAnimation:YES]; } - (IBAction) spin:(id)sender { if (start) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; start = !start; } @end == Works like a champ .. pressing the Button starts, stops the spinning like it should. NOW .. another speed bump .. how to control the spinning from other objects, i.e., no IBAction .. so, remove the Button. Changing the spin method to look like: - (void) spinIt:(BOOL)begin { if (begin) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; } Here is what I've tried, with no success: Within MyDocument.h @interface MyDocument:NSDocument { IBOutlet Controller *theControl; } @end Within MyDocument.m - (id) init { if (self = [super init]) { theControl = [[Controller alloc] init]; } return self; } - (void) awakeFromNib { [theControl spinIt:TRUE]; } As I said above, it does not work; that is, I am not presented with a spinning wheel when the new window shows. Now, I have read about Notifications, Delegates in the Apple docs. Clearly, I do not understand YET all of the info, but I'm getting there. If I need to factor in Notifications and Delegates, I sure would appreciate a few snippets of guidance and in the process be able to more completely understand these beasts. Thanks in advance, John 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 [EMAIL PROTECTED]
RE: programmatically changing IKImageView's tool mode?
I have tried to figure out how to change the tool mode of an IKImageView's View programmatically. I have a simple button setup to cause the change in Mode from the user interface, and at the moment, I'm just printing to the Console what the current mode is. - (IBAction)rotateAction:(id)sender { NSString *findTool = [imageViewOutletcurrentToolMode]; NSLog(findTool); //NSString *rotateTool = @IKToolModeRotate; //[imageViewOutlet currentToolMode:rotateTool]; //IKToolModeRotate.currentToolMode; } I have tried to read the IKImageView.h header file to understand how to change the tool, but as I'm still quite new to cocoa, I can't figure it out. There must be a way to programmatically change the tool. This is what the IKImageView.h specifies: extern NSString *const IKToolModeNone; extern NSString *const IKToolModeMove; extern NSString *const IKToolModeSelect; extern NSString *const IKToolModeCrop; extern NSString *const IKToolModeRotate; extern NSString *const IKToolModeAnnotate; I'm guessing these are constants which cannot be changed directly?? I have tried to do so in a number of ways and failed! However, can I create a copy of these and then set a new value to them? I did notice the @property NSString* currentToolMode; notation as specified in the IKImageView Class Reference. I still haven't fully understood the new Property notation usage as it applies to here, so I am asking for help with this. How do I programmatically change the currentToolMode from say IKToolModeMove to IKToolModeRotate? Many thanks Karl ___ 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 [EMAIL PROTECTED]
Re: CocoaDev spamming me?
On May 23, 2008, at 12:23 AM, [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 10:13 PM, Duncan Campbell [EMAIL PROTECTED] wrote: Hey Guys - very off-topic, but is there a reason CocoaDev has gone from 1(ish) per day to every-40-minutes-or-so? Cocoa-Dev has always been pretty high volume.. Did you change your settings away from digest mode, or were you perhaps losing most of the messages to a spam filter previously? Duncan's observation is accurate. I've been on digest mode (and paying attention to the issue #s) as long as I've been on this list and recently there's been an increase in the number of digests per day. But looking at the topic lists I infer it's because there's been an increase in the number of messages per day. People not in digest mode have gone from a bunch to a bigger bunch so might not notice as much as those of us who've gone from one or two to 5-7, sometimes in clusters. ___ 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 [EMAIL PROTECTED]
Re: NSProgressIndicator -- delete the first message with same title
Why are you autoreleasing the NSProgressIndicator? That means that when the pool is released, your spinner pointer will go stale. Odds are it will crash - not sure why it isn't doing so in the first case. Also, if it's an IBOutlet why are you assigning to it? This isn't actually harmful, but it looks a bit odd - normally IBOutlets are set up using Interface Builder. The probable reason that the second case doesn't work is because the init method of MyDocument isn't being called (log it or set a breakpoint). It's hard to be sure because I can't tell if the idea is that this is instantiated from the nib. If the controller isn't instantiated, the call to spinIt isn't going anywhere. Check if theControl is nil here - log it, set a breakpoint or NSAssert it. But you need to fix the autorelease problem first. Why it's not crashing now I don't know - sheer luck? hth, G. On 23 May 2008, at 9:43 pm, John Love wrote: @interface Controller:NSObject { IBOutlet NSProgressIndicator *spinner; BOOL start; } - (IBAction) spin:(id)sender; Within the Controller.m file, I have: @implementation Controller - (id) init { if (self = [super init]) { spinner = [[[NSProgressIndicator alloc] init] autorelease]; start = TRUE; } return self; } ___ 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 [EMAIL PROTECTED]
Re: NSProgressIndicator -- delete the first message with same title
On a further check of the docs this is probably not it, because init is the designated initializer. But in any case, you ought to start logging and/or asserting your expectations, so that any invalid pointers and so on stand out like a sore thumb in the log - you'll get to the bottom of this sort of problem in an instant. My second thought is that the awakeFromNib calls are not occurring in the order you think they are. Log 'em, and find out. G. On 23 May 2008, at 9:53 pm, Graham Cox wrote: The probable reason that the second case doesn't work is because the init method of MyDocument isn't being called ___ 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 [EMAIL PROTECTED]
'Configure Sheet' fails when containing a WebView
Hi I have a screensaver which I'm building, I have created a 'configure sheet' accessed by the 'options' button in 'system preferencesscreensaver'. In IB I drag WebView onto my 'configure sheet', then when I test the screensaver the 'options button' fails to open the sheet. If I delete the WebView in IB, and add any other view it works fine... Any ideas? ___ 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 [EMAIL PROTECTED]
Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
On 22 May 2008, at 23:19, Scott Anguish wrote: On May 22, 2008, at 10:39 AM, Julius Guzy wrote: On 22 May 2008, at 4:55, David Casseres wrote: That's a really good idea, your wiki-that's-more-than-a-wiki. You're in charge! 8^{) Ha Ha But just as a matter of interest, how would one set about talking to apple about such a thing? I would guess one would need first to demonstrate some kind of a consensus and then thrash out a suitable format and mechanism within the group? Developing the consensus externally (let alone the format and mechanism) would not likely work. I would think that sort of thing would need to be developed internally. (that said, Jon Hendry's followup is an excellent idea) If you want to see something like this, you'd best best off to contact WWDR and let them know. I agree about Jon Hendry's idea being good. It solves major problem of having to get an agreement from apple before being able to start. Also agree that something like a wiki (of whatever shape or form) based on the apple docs would be best done by themselves. Personally I would feel unable personally to go asking anyone (WWDR) to start doing anything before I had taken the trouble to consider the problem to a greater extent than I have so far. My emails to this list concerning difficulties getting into the system were initially just expressions of solidarity with someone whose posting I came accross when starting to read this list for the first time. I have done no analysis of what my learning problems were because I failed to keep a log. All I have to go on so far are vague memories of frustration with Interface Builder primarily but that is no basis upon which to specify an application. I have started to keep such a log now and would willingly contribute to any endeavour which aimed to make getting into the system easier than it had been for me. I would be happy to collate a list of the types of difficulties people encountered if they were to send them to me. These would contribute to the analysis. It was this which was my primary motive for suggesting an FAQ approach because it would provide exactly this sort of information. The advantage of the FAQ over the manually compiled list would be that it does not rely on impresions of difficulties but actually documents them as they occur. So one question perhaps is how to adapt this FAQ to Jon's suggestion. But I am not wedded to the FAQ idea, it is simply that I think none of us has much time to contribute and therefore given the uncertainties of how effective any given approach might be, we would be wise to choose an approach both easy to implement and easy to modify as our understanding increases. With regard to analysis one could ofcourse do a sweep of the problems reported on this list but given that it takes me a long time to read through its daily output it is a task I would balk at tackling alone - I think even a team of ten would find it hard. Julius I may have difficulties replying to emails over next five weeks as i'm off to Poland without a laptop. http://juliuspaintings.co.uk ___ 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 [EMAIL PROTECTED]
Re: 'Configure Sheet' fails when containing a WebView
On 23.5.2008, at 14:28, harry greenmonster wrote: Hi I have a screensaver which I'm building, I have created a 'configure sheet' accessed by the 'options' button in 'system preferencesscreensaver'. In IB I drag WebView onto my 'configure sheet', then when I test the screensaver the 'options button' fails to open the sheet. If I delete the WebView in IB, and add any other view it works fine... Any ideas? Did you add WebKit.framework to your project? HTH Robert ___ 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 [EMAIL PROTECTED]
Weird visibleRect
Hi, What cases make visibleRect.origin to be NSZeroPoint? Since my matrix view didn't draw its cells, I put a log code before and after its super view's drawRect to show the visible rectangle like following: @interface MyMatrix : NSMatrix @implement MyMatrix -(void)drawRect:(NSRect)rect { ___ 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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
IMHO Objective-C 2.0 looks like Apple's attempt to make Objective-C competitive with existing scripting languages, given the addition of the dot syntax for accessors and garbage collection changes. Given that the real strength of scripting languages is tons of useful community supplied modules, real database functionality, and most importantly, regular expressions, and that you get virtually all of those things right-out-of the-box when you download said scripting language, I think Apple's really missed the mark with Objective-C 2.0 (if competitiveness with scripting languages is what they were shooting for). -- Ilan On May 22, 2008, at 9:36 PM, Graham Cox wrote: On 23 May 2008, at 3:20 am, Andy Lee wrote: That may be, but that is different from demanding that Apple lower the barriers by changing Cocoa itself to resemble those platforms. I think many of the additions in Object-C 2.0 and the addition of garbage collection is *precisely* a case of changing Cocoa to resemble other platforms (i.e. Java). Personally I don't find any of the new features all that compelling, though they are no doubt worthwhile for many. Since veteran Cocoa programmers have managed fine without any of these for a long time, I can only deduce that these changes were added by Apple for the express purpose of lowering the barriers to entry for programmers coming from a Java or .NET background. G. ___ 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/listboy%40clarux.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Weird visibleRect
On 23 May 2008, at 11:04 pm, Norio wrote: Hi, What cases make visibleRect.origin to be NSZeroPoint? The common case when your view's top,left (or bottom, left if unflipped) corner is visible. Did you expect something else? What? G. ___ 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 [EMAIL PROTECTED]
a Weird visibleRect
Hi, Sorry for the previous incomplete message. By the way, what I want to know is: What cases make visibleRect.origin to be NSZeroPoint? Since my matrix view didn't draw its cells, I put a log code before and after its super view's drawRect to show the visible rectangle like following: @interface MyMatrix : NSMatrix @implement MyMatrix -(void)drawRect:(NSRect)rect { mynslog_1 [super drawRect:rect]; mynslog_2 } The former log (mynslog_1) showed its origin like 300,0, for instance, but latter (mynslog_2) did 0,0. Actually the visibleRect was surely contained the bounds rectangle. Would you tell me what cause it? Any suggestion and comment would be very appreciated. Thanks, Noiro ___ 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 [EMAIL PROTECTED]
Re: a Weird visibleRect
Let me correct some of the previous. The bound rectangle of the view contains the visibleRect. And argument was also the same as the visibleRect. The matrix was on a clip view and the clip view was on a scrollview. And the scrollview is usually hidden when the window where the scroll view is located opens. When user presses a button, the scroll view scrolls at the end of the view , then the scroll view becomes visible and it's supposed to show its cells. However, the trouble happened as I mentioned in the last message. Thanks, norio On 2008/05/23, at 22:13, Norio wrote: Hi, Sorry for the previous incomplete message. By the way, what I want to know is: What cases make visibleRect.origin to be NSZeroPoint? Since my matrix view didn't draw its cells, I put a log code before and after its super view's drawRect to show the visible rectangle like following: @interface MyMatrix : NSMatrix @implement MyMatrix -(void)drawRect:(NSRect)rect { mynslog_1 [super drawRect:rect]; mynslog_2 } The former log (mynslog_1) showed its origin like 300,0, for instance, but latter (mynslog_2) did 0,0. Actually the visibleRect was surely contained the bounds rectangle. Would you tell me what cause it? Any suggestion and comment would be very appreciated. Thanks, Noiro ___ 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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
Le 23/05/08 à 15:26, Ilan Volow [EMAIL PROTECTED] a écrit : IMHO Objective-C 2.0 looks like Apple's attempt to make Objective-C competitive with existing scripting languages, given the addition of the dot syntax for accessors and garbage collection changes. No scripting languages, maybe Java and C#, I think :) Gerard ___ 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 [EMAIL PROTECTED]
Re: a Weird visibleRect
FYI, When the scroll view doesn't need to scroll at all, the documentView is shown, this is, its cells are visible. 2008/5/23 norio [EMAIL PROTECTED]: Let me correct some of the previous. The bound rectangle of the view contains the visibleRect. And argument was also the same as the visibleRect. The matrix was on a clip view and the clip view was on a scrollview. And the scrollview is usually hidden when the window where the scroll view is located opens. When user presses a button, the scroll view scrolls at the end of the view , then the scroll view becomes visible and it's supposed to show its cells. However, the trouble happened as I mentioned in the last message. Thanks, norio On 2008/05/23, at 22:13, Norio wrote: Hi, Sorry for the previous incomplete message. By the way, what I want to know is: What cases make visibleRect.origin to be NSZeroPoint? Since my matrix view didn't draw its cells, I put a log code before and after its super view's drawRect to show the visible rectangle like following: @interface MyMatrix : NSMatrix @implement MyMatrix -(void)drawRect:(NSRect)rect { mynslog_1 [super drawRect:rect]; mynslog_2 } The former log (mynslog_1) showed its origin like 300,0, for instance, but latter (mynslog_2) did 0,0. Actually the visibleRect was surely contained the bounds rectangle. Would you tell me what cause it? Any suggestion and comment would be very appreciated. Thanks, Noiro ___ 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 [EMAIL PROTECTED]
Re: 'Configure Sheet' fails when containing a WebView
I believe there is an issue where WebViews don't work quite right under a modal panel (they rely on certain specifics of the run loop). Have a look through the archives, I know someone posted a link to a solution recently. Mike. On 23 May 2008, at 13:28, harry greenmonster wrote: Hi I have a screensaver which I'm building, I have created a 'configure sheet' accessed by the 'options' button in 'system preferencesscreensaver'. In IB I drag WebView onto my 'configure sheet', then when I test the screensaver the 'options button' fails to open the sheet. If I delete the WebView in IB, and add any other view it works fine... Any ideas? ___ 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/cocoadev%40mikeabdullah.net This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Breakpoint for unknown selector
In the same way that there are that there are breakpoints that will catch all the Objective C exceptions that are thrown... Is there a good place to set a breakpoint to catch selectors that aren't recognised by the receiving object? I want to get in and have a good look around when it occurs. ___ 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 [EMAIL PROTECTED]
inter process NSView sharing
Hi I have 2 applications, one is written in java, the other in C. For reasons I wont go into to I need to have the C application perform hardware accelerated opengl rendering to a window created by the Java application. This is currently working on Windows. On this platform the java application sends the hwnd of the java canvas to the C application via a bridge. The C application then creates an opengl rendering context using this hwnd and all is fine. Now, on OSX the java app gets a NSView/cocoaviewref. Is there some member of NSView similar to the HWND on windows that I can pass to my C process? The C process can then create a hardware accelerated opengl rendering context from this 'handle' and render to the java apps NSView. I've looked at using Distributed Objects, however the C application would need quite a bit of rework to make it fit into the Cocoa application framework, so this is not an option. So, can a non cocoa application communicate with a distributed object ? If distributed objects are not the way to go, I presume there must be another way to do it as I've seen reference to NSWindowSharingReadWrite in the apple dev docs. If I use the setSharingType approach, what does my C application need to be able to create a rendering context on the java applications shared window. Perhaps there is some way to access this window using the OSX window server API ? many thanks Jonathan ___ 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 [EMAIL PROTECTED]
Re: IB outlets and NSCollectionViews
Could you give a bit more information on how you solved this. I'm trying to do something similar, but I can't get it to work. Hm ...I had to bind it to a NSCollectionItemView subclass that routes to the AppController. cheers -- Torsten On Apr 7, 2008, at 18:04, Torsten Curdt wrote: Hm ...I was trying to bind a button inside a NSCollectionItemView view to an action in my AppController. This obviously does not work. Of course the view is only a prototype that gets cloned per item in the collection but I was expecting to just get the instance passed on the call. So how would I need to do something like this? 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/marcel%40mass-it.nl This email sent to [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Gaussian blur with core image, using CPU or GPU?
First, I sent this once but I don't think it made it onto the list. I've done a quick search of the archives and couldn't find it. I apologize in advance if this end up being a double post. Hi everyone, I'm trying to write a bilateral filter using Core Image with the specific goal of having it preform the filter on the GPU for high performance as this will be for large 4d data sets. I started out by reading the Core Image Programming Guide and came to the Writing Nonexecutable Filters page and came across this sentence: Core Image assumes that the ROI coincides with the domain of definition. This means that nonexecutable filters are not suited for such effects as blur or distortion. Does this mean that it is not possible to write a bilateral filter which does the computations on the GPU? I've looked at the Core Image gaussian filter. Thus far I cannot find out whether it is executed on the CPU or GPU and I was wondering if there is a way to determine this. Is there source code available for this filter and if so where is it? I have had no luck finding it so far. Also, if anyone has experience with this type of filter and could point me in the right direction for implementing it with Core Image it would be much appreciated. Lots of questions I know, but I hope someone can help. Thank you, Jordan ___ 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 [EMAIL PROTECTED]
Re: Breakpoint for unknown selector
Try the NSObject method -doesNotRecognizeSelector: The runtime system invokes this method whenever an object receives an aSelector message it can’t respond to or forward. This method, in turn, raises an NSInvalidArgumentException, and generates an error message. Hank On May 23, 2008, at 9:51 AM, Paul Sargent wrote: In the same way that there are that there are breakpoints that will catch all the Objective C exceptions that are thrown... Is there a good place to set a breakpoint to catch selectors that aren't recognised by the receiving object? I want to get in and have a good look around when it occurs. ___ 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/hank.list %40runbox.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: inter process NSView sharing
On Fri, May 23, 2008 at 9:59 AM, Jonathan Cochrane [EMAIL PROTECTED] wrote: Now, on OSX the java app gets a NSView/cocoaviewref. Is there some member of NSView similar to the HWND on windows that I can pass to my C process? The C process can then create a hardware accelerated opengl rendering context from this 'handle' and render to the java apps NSView. So you have taken a pointer that points to your Cocoa app's virtual memory and passed it to a different process? Do you really expect this to work? A process is not allowed to draw in another process's window on OS X. You cannot do what you want to do the same way you have on Windows. You must refactor your application to compensate for the enhanced separation between processes on OS X. --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 [EMAIL PROTECTED]
Re: check if app opens with a document on startup
Note that these delegate methods will not work properly until your Info.plist has been updated to reflect the file types which your app supports. I've recently opened a radar on this because it doesn't appear to be well-documented and I spent a while trying to figure out why my delegates were never being called. Jens Alfke wrote: On 20 May '08, at 6:31 AM, Torsten Curdt wrote: All good. But I was wondering if it is possible to find out if the application has been opened by dragging a document onto it. Your delegate will get one of these calls: - (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename; #if MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3 - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames; #endif I think you get openFiles: if you implement that method, else it falls back to calling openFile: one or more times. If you don't get any of these calls before -applicationDidFinishLaunching:, you don't have any docs to open. ---Jens ___ 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/johnstiles%40gmail.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: NSTExtView
On 22 May '08, at 9:34 PM, [EMAIL PROTECTED] wrote: I hope you could understand my question, You didn't understand my answer, unfortunately. But at least you've finally posted enough information that I can see what's going on. NSStrings don't have any formatting, of course, just plain characters. When you initiaze your NSAttributedString using -initWithString:, all it gets is the plain characters of your text, not any of the formatting. So what you have is an unformatted NSAttributedString. That's why you don't get any style tags. (You only get the font tags because AppKit assumes Helvetica is the default font.) You need to create the attributed string in some way that won't lose all the formatting. What you probably want is to simply use the NSTextView's textStorage, which is an attributed string. Or if it's an NSTextField, call -attributedStringValue on it. —Jens smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: inter process NSView sharing
apologies if ive been misunderstood, but no, i havent taken a pointer from the java app and passed it to the c app, i know that wont work. what i was asking if there something similar to the MS Windows HWND, or a window id, i could pass between processes, not a pointer ive just had a look at 'son of a grab' source and it seems there is the concept of a CGWindowID, maybe this is what i need ? below is an excerpt from the NSWindow Class Reference: These constants and data type represent the access levels other processes can have to a window's content. typedef enum { NSWindowSharingNone http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingNone = 0, NSWindowSharingReadOnly http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingReadOnly = 1, NSWindowSharingReadWrite http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingReadWrite = 2 }; typedef NSUInteger NSWindowSharingType; NSWindowSharingReadWrite The window's contents can be read and modified by another process. Available in Mac OS X v10.5 and later. Declared in NSWindow.h If a process is not allowed to draw in another process's window on OS X, have i misunderstood the concept of NSWindowSharingType ? thanks again Jonathan- Show quoted text - On Fri, May 23, 2008 at 3:48 PM, Kyle Sluder [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Fri, May 23, 2008 at 9:59 AM, Jonathan Cochrane [EMAIL PROTECTED] wrote: Now, on OSX the java app gets a NSView/cocoaviewref. Is there some member of NSView similar to the HWND on windows that I can pass to my C process? The C process can then create a hardware accelerated opengl rendering context from this 'handle' and render to the java apps NSView. So you have taken a pointer that points to your Cocoa app's virtual memory and passed it to a different process? Do you really expect this to work? A process is not allowed to draw in another process's window on OS X. You cannot do what you want to do the same way you have on Windows. You must refactor your application to compensate for the enhanced separation between processes on OS X. --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 [EMAIL PROTECTED]
Re: inter process NSView sharing
On Fri, May 23, 2008 at 11:14 AM, Jonathan Cochrane [EMAIL PROTECTED] wrote: apologies if ive been misunderstood, but no, i havent taken a pointer from the java app and passed it to the c app, i know that wont work. Ok, good. :) what i was asking if there something similar to the MS Windows HWND, or a window id, i could pass between processes, not a pointer Yep, Core Graphics has a window list that is one step lower than the abstraction NSWindow provides. below is an excerpt from the NSWindow Class Reference: These constants and data type represent the access levels other processes can have to a window's content. This (-[NSWindow sharingType]) is new in Leopard, which is why I didn't know about it. I retract what I've said, though this question has come up in the recent past and people have made the same argument. --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 [EMAIL PROTECTED]
Re: Gaussian blur with core image, using CPU or GPU?
On 23-May-08, at 7:41 PM, Jordan Woehr wrote: First, I sent this once but I don't think it made it onto the list. I've done a quick search of the archives and couldn't find it. I apologize in advance if this end up being a double post. Hi everyone, I'm trying to write a bilateral filter using Core Image with the specific goal of having it preform the filter on the GPU for high performance as this will be for large 4d data sets. I started out by reading the Core Image Programming Guide and came to the Writing Nonexecutable Filters page and came across this sentence: Core Image assumes that the ROI coincides with the domain of definition. This means that nonexecutable filters are not suited for such effects as blur or distortion. Does this mean that it is not possible to write a bilateral filter which does the computations on the GPU? I've looked at the Core Image gaussian filter. Thus far I cannot find out whether it is executed on the CPU or GPU and I was wondering if there is a way to determine this. Is there source code available for this filter and if so where is it? I have had no luck finding it so far. Have you gone through the FunHouse sample app in development examples. I tried this for you: I used FunHouse to apply the Gausian Blur (It uses Core Image) on a very heavy image. I had Activity Monitor opened showing me the CPU usage. With FunHouse, there was no evident increase in CPU usage. But then on the same heavy Image I used PhotoShop to apply Gausian Blur. There was clear shoot in CPU usage. So, I think this kinda shows, that the FunHouse implementation, which uses Core Image uses GPU for processing. I'm using MacBook Pro with ATI Radeon X1600 Graphics Card. See if this helps. There is another way of tiling the huge image data-set for better processing. I dun remember right now, but I'll come back to you with that. Also, if anyone has experience with this type of filter and could point me in the right direction for implementing it with Core Image it would be much appreciated. Lots of questions I know, but I hope someone can help. Thank you, Jordan ___ 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/vijay.malhan%40gmail.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: IB outlets and NSCollectionViews
I solved a similar problem when putting a pop up menu into a collectionView item. There might be an easier way, but I assume that to put a button in a collectionViewItem, the button would have to send a message to a subclass of NSCollectionViewItem, which you would then cause to send a similar message along with a copy of the representedObject to a subclass of NSCollectionView. (Note that an NSCollectionViewItem knows both its representedObject and its NSCollectionView.) You would write your NSCollectionView subclass to have an outlet for File's Owner, so you could forward the message from the button to File's Owner, which could then take some action on the representedObject. On May 23, 2008, at 8:01 AM, Marcel Borsten wrote: Could you give a bit more information on how you solved this. I'm trying to do something similar, but I can't get it to work. Hm ...I had to bind it to a NSCollectionItemView subclass that routes to the AppController. cheers -- Torsten On Apr 7, 2008, at 18:04, Torsten Curdt wrote: Hm ...I was trying to bind a button inside a NSCollectionItemView view to an action in my AppController. This obviously does not work. Of course the view is only a prototype that gets cloned per item in the collection but I was expecting to just get the instance passed on the call. So how would I need to do something like this? 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/marcel%40mass-it.nl This email sent to [EMAIL PROTECTED] ___ 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/davidcar1%40mstarmetro.net This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Query about Zip command
On 23 May '08, at 1:26 AM, parag vibhute wrote: I am developing cocoa application using NSApplescript class to do shell scripting which involves zip command. Don't use AppleScript to run a command-line tool! It's incredibly wasteful, like chartering an airliner to take you to the grocery store. Just use NSTask to run /usr/bin/zip. —Jens smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: NSBrower selectedCells lies
I instrumented all my delegate methods, and they don't seem to get called at all during the redraw in either the normal or pathological cases. looking at the case where NSFocusRingTypeNone causes the same symptoms, I put a breakpoint on drawInteriorWithFrame, and then set it to dump a backtrace. What I see in both the normal and pathological cases is an initial call like this, for the clicked cell #0 -[MMICleanerBrowserCell drawInteriorWithFrame:inView:] (self=0x270200, _cmd=0x93ff8bd4, cellFrame={origin = {x = 0, y = 36}, size = {width = 131, height = 18}}, controlView=0x26eb30) at /Users/martin/Documents/MMI/Cleaner/MoreBrowser/MMICleanerBrowserCell.m:126 #1 0x95141ef2 in -[NSBrowserCell highlight:withFrame:inView:] () #2 0x95141d16 in -[NSMatrix _highlightCell:atRow:column:andDraw:] () #3 0x95141b0e in -[NSMatrix highlightCell:atRow:column:] () #4 0x952066be in -[NSMatrix _selectRange] () #5 0x95206283 in -[NSMatrix _selectRectRange::] () #6 0x95205df6 in -[NSMatrix _mouseLoop::] () #7 0x95205d4d in -[NSMatrix _normalListmodeDown] () #8 0x95205c54 in -[NSMatrix _mouseDownListmode:] () #9 0x9513f8d7 in -[NSMatrix mouseDown:] () #10 0x94fc3ac3 in -[NSWindow sendEvent:] () #11 0x94f90714 in -[NSApplication sendEvent:] () #12 0x94eee0f9 in -[NSApplication run] () #13 0x94ebb30a in NSApplicationMain () #14 0x0001affc in main (argc=1, argv=0xb7e8) at /Users/martin/Documents/MMI/Cleaner/MoreBrowser/main.m:13 2008-05-23 15:43:58.659 MoreBrowser[8591:613] Drawn interiorWithFrame for 2-2 (1) and then other cells update as a direct result of the mouse down #0 -[MMICleanerBrowserMatrix drawRect:] (self=0x253bc0, _cmd=0x94001630, rect={origin = {x = 0, y = 0}, size = {width = 131, height = 36}}) at /Users/martin/Documents/MMI/Cleaner/MoreBrowser/MMICleanerBrowserMatrix.m:102 #1 0x94fbdbbe in -[NSView _drawRect:clip:] () #2 0x94fbc751 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () Some calls deleted ... #8 0x94fbcaa5 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () #9 0x9512e850 in -[NSBrowser _recursiveDisplayAllDirtyWithLockFocus:visRect:] () #10 0x94fbb0b4 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #11 0x95132097 in -[NSBrowser _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #12 0x94fbbf05 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #13 0x94fbbf05 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #14 0x94fba9f7 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #15 0x94fb752d in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] () #16 0x94ef7f09 in -[NSView displayIfNeeded] () #17 0x94ef7ab9 in -[NSWindow displayIfNeeded] () #18 0x94ef78e0 in _handleWindowNeedsDisplay () #19 0x9593c9c2 in __CFRunLoopDoObservers () #20 0x9593dd25 in CFRunLoopRunSpecific () #21 0x9593ed18 in CFRunLoopRunInMode () #22 0x95b326a0 in RunCurrentEventLoopInMode () #23 0x95b323f2 in ReceiveNextEventCommon () #24 0x95b3232d in BlockUntilNextEventMatchingListInMode () #25 0x94ef57d9 in _DPSNextEvent () #26 0x94ef508e in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #27 0x94fc67ff in -[NSWindow nextEventMatchingMask:] () #28 0x95205e85 in -[NSMatrix _mouseLoop::] () #29 0x95205d4d in -[NSMatrix _normalListmodeDown] () #30 0x95205c54 in -[NSMatrix _mouseDownListmode:] () #31 0x9513f8d7 in -[NSMatrix mouseDown:] () #32 0x94fc3ac3 in -[NSWindow sendEvent:] () #33 0x94f90714 in -[NSApplication sendEvent:] () #34 0x94eee0f9 in -[NSApplication run] () #35 0x94ebb30a in NSApplicationMain () #36 0x0001affc in main (argc=1, argv=0xb7e8) at /Users/martin/Documents/MMI/Cleaner/MoreBrowser/main.m:13 In the pathological case, no further updates are received, but normally, a number of further calls to [NSMatrix drawRect] are made, with the following stack trace. #0 -[MMICleanerBrowserMatrix drawRect:] (self=0x253bc0, _cmd=0x94001630, rect={origin = {x = 0, y = 0}, size = {width = 131, height = 36}}) at /Users/martin/Documents/MMI/Cleaner/MoreBrowser/MMICleanerBrowserMatrix.m:102 #1 0x94fbdbbe in -[NSView _drawRect:clip:] () #2 0x94fbc751 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () Some calls deleted #8 0x94fbcaa5 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () #9 0x9512e850 in -[NSBrowser _recursiveDisplayAllDirtyWithLockFocus:visRect:] () #10 0x94fbb0b4 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #11 0x95132097 in -[NSBrowser _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #12 0x94fbbf05 in -[NSView
Re: NSProgressIndicator -- delete the first message with same title
On 23 May '08, at 4:43 AM, John Love wrote: Changing the spin method to look like: - (void) spinIt:(BOOL)begin { if (begin) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; } Looks good. @interface MyDocument:NSDocument { IBOutlet Controller *theControl; } @end This is fine, assuming you still have a 'Controller' object in your nib and you wire the MyDocument instance's 'theControl' outlet to point to it. - (id) init { if (self = [super init]) { theControl = [[Controller alloc] init]; } return self; } This part is wrong. If theControl is an IBOutlet, that means it's a pointer to an object in the nib, which will be set up for you by the nib when it loads. Assigning to it doesn't make any sense, generally. (Especially because your -init method runs before the nib sets up outlets, so whatever you assign here will be overwritten.) Also, if you create a Controller object from scratch at runtime, that Controller won't have a spinner, since (I assume) its 'spinner' variable is an IBOutlet wired to a control in the nib. That only gets set up if there's a Controller instance in the nib, with that outlet wired up, and you use that instance. What you want to do, I think, is to go back to the earlier working version, and replace the Controller's -spin method with your new one. Then add the 'theControl' outlet to your MyDocument class, as you already did, and wire it up in IB. That's all you need. Now in your MyDocument methods, you can simply call [theControl spinIt: YES]. —Jens smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: check if app opens with a document on startup
On May 23, 2008, at 16:52, John Stiles wrote: Note that these delegate methods will not work properly until your Info.plist has been updated to reflect the file types which your app supports. Sure All good. But I was wondering if it is possible to find out if the application has been opened by dragging a document onto it. Your delegate will get one of these calls: - (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename; #if MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3 - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames; #endif I think you get openFiles: if you implement that method, else it falls back to calling openFile: one or more times. If you don't get any of these calls before - applicationDidFinishLaunching:, you don't have any docs to open. Hm ...somehow missed that response. But got it working myself. It's actually much simpler: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { int documentCount = [[[NSDocumentController sharedDocumentController] documents] count]; 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 [EMAIL PROTECTED]
Re: Cocoa-dev Digest, Vol 5, Issue 885
-- Message: 3 Date: Fri, 23 May 2008 07:43:31 -0400 From: John Love [EMAIL PROTECTED] Subject: NSProgressIndicator -- delete the first message with same title To: Cocoa Development cocoa-dev@lists.apple.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 I have successfully been able to create a small Cocoa multiple document project whose GUI consists of a NSProgressIndicator, or wheel, and a Button, titled Spin. In the .nib window, the Controller is ctrl-dragged to the wheel, specifying an outlet wheel and the Button is ctrl-dragged to the Controller, specifying an action :spin:. Within the Controller.h file, I have: @interface Controller:NSObject { IBOutlet NSProgressIndicator *spinner; BOOL start; } - (IBAction) spin:(id)sender; Within the Controller.m file, I have: @implementation Controller - (id) init { if (self = [super init]) { spinner = [[[NSProgressIndicator alloc] init] autorelease]; start = TRUE; } return self; } - (void) awakeFromNib { [spinner setUsesThreadedAnimation:YES]; } - (IBAction) spin:(id)sender { if (start) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; start = !start; } @end == Works like a champ .. pressing the Button starts, stops the spinning like it should. NOW .. another speed bump .. how to control the spinning from other objects, i.e., no IBAction .. so, remove the Button. Changing the spin method to look like: - (void) spinIt:(BOOL)begin { if (begin) [spinner startAnimation:nil]; else[spinner stopAnimation:nil]; } Here is what I've tried, with no success: Within MyDocument.h @interface MyDocument:NSDocument { IBOutlet Controller *theControl; } @end Within MyDocument.m - (id) init { if (self = [super init]) { theControl = [[Controller alloc] init]; } return self; } - (void) awakeFromNib { [theControl spinIt:TRUE]; } As I said above, it does not work; that is, I am not presented with a spinning wheel when the new window shows. Now, I have read about Notifications, Delegates in the Apple docs. Clearly, I do not understand YET all of the info, but I'm getting there. If I need to factor in Notifications and Delegates, I sure would appreciate a few snippets of guidance and in the process be able to more completely understand these beasts. Thanks in advance, John Love Hi John, There are several problems in your code which show, that you don not yet have an understanding how freeze-drying and then thawing of objects in the nib works. First a couple of questions. What are your controller and document? Is the document a real subclass of NSDocument or you just name it so? Is the document an owner of the nib (Files's owner)? Now to the comments: 1. You shouldn't create new NSProgressIndicator in the -init method of your Controller. The NSProgressIndicator outlet will get written into at the nib loading time because you control-dragged from controller to the indicator in your window: the instance in your window will get thawed. 2. Your code does work and does not crash because the outlet that you assigned in -init of your Controller gets overwritten later by nib loading code. 3. NSProgressIndicator that you allocated in the -init method and assigned to the outlet would crash your app if #2 didn't happen because you -autoreleased it (read memory management section in introductoryy docs for Cocoa). 4. You are allocating a new Controller in your -init of the Document that has absolutely no connection with the Controller that you created in the nib. You need to establish the connection with the one in the nib and you can do that in several ways. If your document is a File's owner of the nib, simply create an outlet for you controller in it and control-drag from Document to the Controller to establish connection. Then, in -awakeFromNib you should see, that your controller outlet is populated with instance of Controller from the nib and second part of your code should work. In short: You should review do documentation about nib loading, outlets and actions. I am not at my development computer right now, so someone else can point you to relevant sections in introductory docs. Hope that helps, Gorazd __ Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.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:
Removing the Filename flag in Doc. based Application
thanks. How do I set my document based application to omit the filename reference at the top of each opened document window? thanks again. v. ___ 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 [EMAIL PROTECTED]
Re: NSControllers, NSLocks, NSThread, Setters and Getters
On May 22, 2008, at 9:21 PM, Ken Thomases wrote: KVO change notifications are sent and received on the same thread where the change is made. Thanks! Yeah, that will definitely screw up my plans. Thanks for the heads up. Ideally, a background thread should be given all of the data it needs to do its work at the beginning and it would work in isolation until its job is done and only then provide results in a lump to the main thread. In my case, I am constantly looking for more data to be added to a file that is being written to by another process, then read the additional data, and potentially update some data structures. I wanted to put the code to check and process the file data in a separate thread, but I think I will just try an NSTimer for now. Thanks again! I could have seen my efforts leading to a major headache as I tried to figure out why the Controller wasn't properly updating the GUI. Todd ___ 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 [EMAIL PROTECTED]
Re: Appkido support for Iphone dev
On 23 May 2008, at 5:28 AM, nishant jain wrote: Hi all,I am little bit into iphone native application dev. Can anybody help me with xcode support for iphone API just like appkido or any other such tool. For business reasons, I have kept myself free of iPhone exposure, so I can answer out of general knowledge on your question, which I think is not specific to the iPhone, to-wit: How do I get browser-style access to documentation that has recently been written or revised, such as for new API? In the specific case of AppKiDo (which I dearly love), only Andy Lee can say for sure. I have the impression that the new-style documentation has recently been changing format every couple of months, and in ways that make it harder to scrape for method-by-method access. Third-party tools will have a lot of trouble for the foreseeable future. The Class Browser (Project - Class Browser) is a 90% substitute. You can set the class list to hierarchical or flat. There's no way to set a favorites list, or a category list (like frameworks, or AppKiDo's Strings, data, collections list). Selecting one yields one of the defining headers, and a list of methods that summons the definition of a method when you select it. Clicking on the book next to a class name shows you the class documentation; on the book next to a method name, the documentation for the method. Class documents include most of AppKiDo's browsing categories, and inherited symbols are available as an option. — F ___ 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 [EMAIL PROTECTED]
Re: Gaussian blur with core image, using CPU or GPU?
Just FYI, Core Image is normally dealt with n the Quartz list rather than here, but not to worry. On 22 May 2008, at 22:36, Jordan Woehr wrote: Does this mean that it is not possible to write a bilateral filter which does the computations on the GPU? Filters of variable kernel size are tricky (to say the least). Apple's blur filter seems to generate different GPU programs depending on the radius parameter, but it does run on the GPU. It might also be multi-pass. You can see that varying the radius of the blur is quite low performance compared to changing the image it's blurring. If your filter has a fixed kernel size (that isn't too big), then it can normally be coded. The key problem is the the kernel language has no conditional branching, so loops of variable length aren't allowed. Fixed length You may have more luck coding for OpenGL rather than CoreImage, and using GLSL. Unfortunately Apple decided to remove the parts of GLSL that the hardware of the time didn't support when they created the CIKernel language. Now that hardware is more capable CI is stuck with those limitations. That said, getting a OpenGL solution running will probably need you to be familiar with Pixel Buffer Objects (PBOs), Frame Buffer Objects (FBOs) and devising some way of putting your 4D data into textures (which you'd have to do for CoreImage anyway). Another advantage of going the OpenGL route is that you've be able to use 3D textures, rather than just 2D images that you'll be working with in CoreImage. At least that's only one dimension off. Is there source code available for this filter and if so where is it? I have had no luck finding it so far. You won't find it, it's in a framework that isn't open-source. ___ 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 [EMAIL PROTECTED]
Re: NSTextField does not lose focus
On May 23, 2008, at 03:32, Ken Thomases wrote: On May 22, 2008, at 5:53 AM, Torsten Curdt wrote: On May 22, 2008, at 11:15, Torsten Curdt wrote: I've got a NSTextField (on a NSTabView). I open the window. I click the text field and enter some text. Now I click on a button next to it. The value has still not been committed and it still has the cursor. Then I click outside of the text field (just somewhere in the view) and still the NSTextField does not lose it's focus. What's going on? I looked through options in IB3. What do I need to read up on? Got it ...I had to set the firstResponder to nil in the IBAction before I access the text field [[self window] makeFirstResponder: nil]; If your intent was to have the text field set the value of a model key via bindings, that's not the recommended way of doing it. You should invoke the -commitEditing method of the controller. Do a full-text search for that method and the NSEditor informal protocol for more info. This link http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html#//apple_ref/doc/uid/20002372-177085 actually refers to your exact scenario with a text field and a button. Thanks, Ken!! Indeed commitEditing sounds exactly like what I was after. 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 [EMAIL PROTECTED]
Re: inter process NSView sharing
On May 23, 2008, at 10:14 AM, Jonathan Cochrane wrote: ive just had a look at 'son of a grab' source and it seems there is the concept of a CGWindowID, maybe this is what i need ? below is an excerpt from the NSWindow Class Reference: These constants and data type represent the access levels other processes can have to a window's content. typedef enum { NSWindowSharingNone http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingNone = 0, NSWindowSharingReadOnly http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingReadOnly = 1, NSWindowSharingReadWrite http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSWindowSharingReadWrite = 2 }; typedef NSUInteger NSWindowSharingType; NSWindowSharingReadWrite The window's contents can be read and modified by another process. Available in Mac OS X v10.5 and later. Declared in NSWindow.h If a process is not allowed to draw in another process's window on OS X, have i misunderstood the concept of NSWindowSharingType ? Those declarations are indeed intriguing and tantalizing. However, I don't know of any supported way to make use of them the way you want. Maybe it's planned for the future. There's some additional stuff like that in /System/Library/Frameworks/ApplicationServices.framework/ Frameworks/CoreGraphics.framework/Headers/CGWindow.h. In particular, CGWindowSharingType seems like the Core Graphics equivalent of that Cocoa enum. A CGWindowID is documented there as being valid across the user session. However, I don't know of any way to create a Carbon or Cocoa window from a CGWindowID. The HIToolbox Release Notes for Mac OS X 10.5 includes this, though: The HIWindowGetCGWindowID API has been added to allow access to the window server's global window identifier for a WindowRef. This number is not usable with any other Carbon APIs, but may be passed to other APIs that do take window numbers, such as OpenGL. Oooh, that's quite close! Unfortunately, I can't see where OpenGL could take a window number. Now, I am familiar with a completely different approach to this. Apple provides a special library for implementing X11 and allowing direct GL rendering by an X11 client into windows owned by the X11 server, provided they're both running on the same machine. That library is /usr/lib/libXplugin.dylib. It's only documentation is its header file /usr/lib/Xplugin.h. It also provides windows which require a lot more manual handling than anything provided by Carbon, Cocoa, or Java. Truthfully, I recommend you avoid this whole hassle until Apple provides complete support for what you're trying to do. Instead, I suggest that you refactor your app to avoid the need for one process to draw into a window created by another. Can you host your C code inside your Java program? Or, replace what is currently a Java front- end (I'm guessing) with a Cocoa front-end, and then have your C code be that program's back-end? Good luck, Ken ___ 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 [EMAIL PROTECTED]
Contextual menu on an NSTableView
I've got some working code that puts up a Contextual menu on my own NSView subclass. Works like a charm. When I try to call setMenu on a NSTableView using the same menu, I crash. How do I put up a contextual menu on an NSTableView? Thanks, Allan ___ 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 [EMAIL PROTECTED]
NSTextView without word wrap?
I've spent the last few hours trying to create an NSTextView without word wrap. The BiScrollAspect.m file in the textSizingExample project file is no help at all. Searching on wrap is no help either. I've checked and unchecked various settings in IB. After much searching I settled on the following approach, which also doesn't work. So where am I going wrong, and (optionally for documentation defenders) where in the documentation was I supposed to find the right answer? - (void) awakeFromNib { NSMutableParagraphStyle *style = [[theTextView defaultParagraphStyle] mutableCopy]; [style setLineBreakMode:NSLineBreakByClipping]; [theTextView setDefaultParagraphStyle:style]; [style release]; } ___ 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 [EMAIL PROTECTED]
Re: NSTextView without word wrap?
On May 23, 2008, at 10:33 AM, David Carlisle wrote: I've spent the last few hours trying to create an NSTextView without word wrap. The BiScrollAspect.m file in the textSizingExample project file is no help at all. No help in that it doesn't do what you want, or no help in that you can't get it working in your app, or no help in some other way? Douglas Davidson ___ 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 [EMAIL PROTECTED]
Re: Query about Zip command
Thanks for suggestion. I will definitely give a try. Palav On 5/23/08, Jens Alfke [EMAIL PROTECTED] wrote: On 23 May '08, at 1:26 AM, parag vibhute wrote: I am developing cocoa application using NSApplescript class to do shell scripting which involves zip command. Don't use AppleScript to run a command-line tool! It's incredibly wasteful, like chartering an airliner to take you to the grocery store. Just use NSTask to run /usr/bin/zip. —Jens -- There are many things in your life that will catch your eye but only a few will catch your heartpursue those'. ___ 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 [EMAIL PROTECTED]
File's Owner
I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely uh-huh, yep, but the File's Owner, my nemesis, comes up again. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_3.html You connect an outlet in Interface Builder, but the procedure starts in Xcode. The following steps describe the procedure: When defining your custom class, declare an outlet by tagging the instance variable with the IBAction qualifier. In Interface Builder, drag a generic object into the top level of the nib file window (if one doesn’t already exist for your custom class). If an instance of your custom class is to be the File’s Owner for the nib file, this step is not necessary. Also, if you’re defining a custom NSView object, select that object instead. Import the custom class into Interface Builder. With the generic object (or File’s Owner) selected, type the name of your custom class in the Class field of the Identify pane of the Interface Builder inspector. This assigns your custom class as the class of the selected object. This step has to be done only once. Select your custom instance (or File’s Owner). Right-click or Control-click this object to display the connections panel. Find your outlet under Outlets and drag a connection line from the circle next to the outlet to the object on the user interface that you want that outlet to reference. I sent feedback on this as File's Owner is mentioned several times and not defined. There seems to be some huge problem with File's Owner. Even Aaron Hillegass says that people have trouble understanding File's Owner - and sure enough, when I read his explanation, I remained clueless. I can follow making a generic NSObject set to my custom class, but why File's Owner? My birthday is coming up and if I can understand File's Owner, I will consider that one of the best presents. As usual, I can recite the documentation without understanding it : File's Owner is a proxy object that is set at nib load time to the object that loaded the nib (I don't know what object loaded my nib, so that does not help me). In MainMenu.nib, this is the application instance, which is a shared singleton instance of NSApplication (how all applications can share this is beyond me), which is also set to the global variable NSApp (uhh, OK...). That's all well and good, but what exactly is this thing? Why would I succeed in having an outlet in my class if I set the Class Identity of File's Owner to my custom class? Why should I set File's Owner's Class Identity rather than the Class Identity of a plain NSObject that I drag out of the Library in IB? ___ 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 [EMAIL PROTECTED]
Re: File's Owner
I'm trying to figure out why the big hang up on needing to understand it fully. Not understanding it should not prevent you from developing applications. So why the hangup? What is the actual problem? Just set your own NSObject based app delegate as the File's Owner delegate in IB and start adding your code to it. That's really all you *need* to know. -Matt -- Matt Long [EMAIL PROTECTED] http://www.matthew-long.com/ On May 23, 2008, at 12:49 PM, Johnny Lundy [EMAIL PROTECTED] wrote: I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely uh-huh, yep, but the File's Owner, my nemesis, comes up again. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_3.html You connect an outlet in Interface Builder, but the procedure starts in Xcode. The following steps describe the procedure: When defining your custom class, declare an outlet by tagging the instance variable with the IBAction qualifier. In Interface Builder, drag a generic object into the top level of the nib file window (if one doesn’t already exist for your custom class). If an instance of your custom class is to be the File’s Owner for the nib file, this step is not necessary. Also, if you’re defining a custom NSView object, select that object instead. Import the custom class into Interface Builder. With the generic object (or File’s Owner) selected, type the name of your custom class in the Class field of the Identify pane of th e Interface Builder inspector. This assigns your custom class as t he class of the selected object. This step has to be done only once. Select your custom instance (or File’s Owner). Right-click or Control-click this object to display the connections panel. Find your outlet under Outlets and drag a connection line from the circle next to the outlet to the object on the user interface that you want that outlet to reference. I sent feedback on this as File's Owner is mentioned several times and not defined. There seems to be some huge problem with File's Owner. Even Aaron Hillegass says that people have trouble understanding File's Owner - and sure enough, when I read his explanation, I remained clueless. I can follow making a generic NSObject set to my custom class, but why File's Owner? My birthday is coming up and if I can understand File's Owner, I will consider that one of the best presents. As usual, I can recite the documentation without understanding it : File's Owner is a proxy object that is set at nib load time to the object that loaded the nib (I don't know what object loaded my nib, so that does not help me). In MainMenu.nib, this is the application instance, which is a shared singleton instance of NSApplication (how all applications can share this is beyond me), which is also set to the global variable NSApp (uhh, OK...). That's all well and good, but what exactly is this thing? Why would I succeed in having an outlet in my class if I set the Class Identity of File's Owner to my custom class? Why should I set File's Owner's Class Identity rather than the Class Identity of a plain NSObject that I drag out of the Library ___ 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 [EMAIL PROTECTED]
Re: Setting iTunes album art with ScriptingBridge
On May 23, 2008, at 10:06 AM, Jens Alfke wrote: The biggest issue with the album art is simply getting the image into PICT format, since last I checked, iTunes won't accept any other format. Unfortunately NSImage can read but not generate PICT. The only way I found to do it was to use ick QuickDraw APIs to create a GWorld, then draw the NSImage into it, and then create a PICT from the GWorld. True, though actually the OP showed a clever little technique using NSPasteboard, much easier than a GWorld and works great. In the past I've used Image Events, it'll convert many formats to a PICT file, then read from offset 513 (skipping the PICT header) to get the data iTunes wants. Works fine. The difficulty isn't with the PICT data, it's that a script like this, which works under Tiger: tell application iTunes tell current track try set data of artwork 1 to myPICTData on error error_msg number error_num display dialog error_msg error_num end try end tell end tell does not work under Leopard. On Leopard, you get param err instead. Other variants I tried didn't work either, often getting good old Unknown object type error, so something sure seems to have changed. Makes it difficult to write the corresponding Scripting Bridge code... This works up to the -addObject, which throws error -10014: Handler only handles single objects. // Make a test image from an icon NSImage* icon = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kAppleLogoIcon)]; NSData *tiffData = [icon TIFFRepresentation]; // Convert to PICT NSPasteboard *pboard = [NSPasteboard pasteboardWithName:@Sample]; [pboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:nil]; [pboard setData: tiffData forType:NSTIFFPboardType]; NSData *pictData = [pboard dataForType:NSPICTPboardType]; [pboard releaseGlobally]; // Prove it's valid PICT data by writing to file with // 512 bytes header of zeroes. Opens fine in Preview. NSMutableData *pictFileData = [NSMutableData dataWithLength:512]; [pictFileData appendData:pictData]; [pictFileData writeToFile:@/test.pict atomically:NO]; // Create the new artwork's properties. I also tried a dictionary // with various combinations 4 artwork properties, but it didn't // make any difference, and that isn't how it's done in Applescript anyway. NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@data, pictData, nil]; // (Note to OP, this line won't work in SB) //iTunesArtwork *artwork = [[SBObject alloc] init]; // Instead, use this. // Note the class name artwork is the name from the Applescript dictionary, // NOT the classname from the generated SB header file! Sure, it's documented somewhere... // iTunesArtwork *artwork = iTunesApp classForScriptingClass:@artwork] alloc] initWithProperties:dict] autorelease]; @try { // According to SB docs, the new object has to be // added to its container before it becomes 'real'. // This looks like the sample code, seems like // it should work, but throws instead. / // Since the analogous Applescript doesn't work // either (under Leopard, does on Tiger) // it's hard to know where the problem is. [[currentTrack artworks] addObject:artwork]; } @catch(NSException *e) { NSLog( @Error:[EMAIL PROTECTED]:[EMAIL PROTECTED]:%@, [e name], [e reason], [e userInfo] ); } NSLog output: Error:NSGenericException Reason:Apple event returned an error. Event = 'core'\'crel'{ 'kocl':'cArt', 'insh':'insl'{ 'kobj':'obj '{ 'want':'cArt', 'from':'obj '{ 'want':'prop', 'from':'null'(), 'form':'prop', 'seld':'pTrk' }, 'form':'indx', 'seld':'abso'($206C6C61 $) }, 'kpos':'end ' }, 'prdt':{ 0x:'utxt'(data) } } Error info = { ErrorNumber = -10014; } Info:{ ErrorNumber = -10014; } ___ 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 [EMAIL PROTECTED]
Re: NSTableView
On Fri, May 23, 2008 at 4:03 PM, john darnell [EMAIL PROTECTED] wrote: - (id) directoryTable: (NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int) rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } You're not using the proper method name. You need to implement - (id)tableView: objectValueForTableColum: row: The name of your table has nothing to do with anything. The first argument will contain a pointer to the table that is currently asking for an object value; you can use that pointer to determine (if you have multiple tables) which table to provide data for. -- - David T. Wilson [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
NSTableView header offsets when scrolled
Hi all, I've got a strange problem with a programatically created NSTableView (inside a programatically created NSScrollView). The table is showing three columns and has a standard header, each showing the title of the column. Columns are set to resize proportionally with the table. The problem: When I scroll the list, the header suddenly offsets to the left about the width of a scroll bar. Clicking in the header and rearranging or resizing columns (using the mouse) doesn't fix it, but resizing the list makes it pop back into place. It never moves any farther over and it leaves a blank space between the header view and the corner view. I can't easily post the code that creates and manipulates the list because it's scattered about in a library. Also, I don't seem to be able to reproduce the problem in a small sample app. So, I'm not looking for specific solutions. I'm more hoping someone might have some idea where to look or what might cause this specific symptom... Thanks for any help. Ken -- Ken Worley Software Engineer, Tiberius, Inc. ___ 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 [EMAIL PROTECTED]
Core Data, transient properties and saving
Hi Guys, Has anyone come across this before? I've looked online and I think I know the problem but the solution is evading me! I have an NSManagedObject that represents a text file, the text itself is saved to a text file and the file's attributes are stored in the persistent store (much the same way Xcode works). The file has a non- optional, transient property isEdited (default is NO) that gets updated to YES when the text is edited and then set to NO when the text itself is saved to the locations specified by the file's path property. However if I want to save an individual file and then save any changes to the object graph subsequent fetches with the predicate @isEdited == YES does not return any other edited files. So saving the store has turned all my file objects into faults. However as all my files are in a source list, after saving one file selecting one of the other files I know to be edited and then trying to fetch again returns the selected file. Therefore the fault seems to be fired by my tree controller and the isEdited value is correct. In practice a user will edit multiple files and then save one of them, then try to quit the program which tries to fetch any edited files and throw up a dialog asking the user to save all the other edited files, but as the other edited files are faults the fetch returns no edited files and the program quits. How can I work around this? I could always walk the tree and ask each file if they're edited, but a fetch seems cleaner. Thanks for any pointers, Jon smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: NSTableView
Your question was very good. My only criticism of the way you asked you question is the vague title of the post. Ask as many questions like this per day as you want. change the following: - (id) directoryTable: (NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int) rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } to this: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return file; } A data source can be any object you specify, but the names of the data source methods are not optional. You must provide the correctly named methods. http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingTableDataSource.html#/ /apple_ref/doc/uid/2117 By changing the name of the method, you provided no way for the NSTableView to find the needed data. ___ 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 [EMAIL PROTECTED]
Re: Query about Zip command
On Fri, May 23, 2008 at 2:13 PM, parag vibhute [EMAIL PROTECTED] wrote: I tried using NSTask but it failed. I think NSTask is only useful to launch plain unix exectuable (which does not resources, info.plist) This isn't strictly true (you were probably improperly using NSTask), but for launching GUI apps, you should really use Launch Services. --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 [EMAIL PROTECTED]
NSCollectionView problems
Hello List, I have an NSCollectionView set up with bindings to visualize an NSMutableArray. When I call arrayController:setContent: the view (which initially doesn't have a content assigned) displays the items. So far so good. The problems are these: If there are two many items for one page to display, the vertical scroller appears. However, it's not the correct size. It's displayed as if all items would fit into the view (all but an imaginary 10 pixel row). It doesn't get the correct size until after the view is resized. Is there some way to force the view to recalculate it's scroll bar sizes? Or could this be caused by how the content is assigned (I'm using an array controller)? The second problem is when the view is resized (due to window resizing or any other reason). When the collection view is scrolled down with some item in the middle of the collection selected (so the scrollbar is not on it's topmost position), the resize causes the collection display to jump to the first item row. This problem can be observed in the Apple supplied IconCollection demo. Is there a way to prevent that? Thanks for any input! I'm using Xcode 3.0 on 10.5.2 Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: NSTableView
On May 23, 2008, at 4:03 PM, john darnell wrote: The code meant to be used in response for the requirement in the Companion article to return the value of a given cell in the table looks like this: - (id) directoryTable: (NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int) rowIndex Your method name is wrong. The name of the datasource method must be: tableView:objectValueForTableColumn:row: This is documented in the NSTableDataSource Protocol Reference and the Table View Programming Guide. { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } Your line return [file self] is odd. Just: return file; -- Brian Stern [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
RE: NSTableView
David: Thank you. That works. To be sure, my first attempt used that name, and it did not work. Obviously, I had more than one thing wrong with the code waay back then... I need to ask for just a little bit of clarification, however. Your last line says, you can use that pointer to determine (if you have multiple tables) which table to provide data for. If I did have, say, three tables on a dialog, how would the code know which function was for which table if that first element (or some other element) is not differentiated? R, John -Original Message- From: David Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, May 23, 2008 3:13 PM To: john darnell Cc: Cocoa-dev@lists.apple.com Subject: Re: NSTableView On Fri, May 23, 2008 at 4:03 PM, john darnell [EMAIL PROTECTED] wrote: - (id) directoryTable: (NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int) rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } You're not using the proper method name. You need to implement - (id)tableView: objectValueForTableColum: row: The name of your table has nothing to do with anything. The first argument will contain a pointer to the table that is currently asking for an object value; you can use that pointer to determine (if you have multiple tables) which table to provide data for. -- - David T. Wilson [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: File's Owner
On Fri, May 23, 2008 at 11:49 AM, Johnny Lundy [EMAIL PROTECTED] wrote: I sent feedback on this as File's Owner is mentioned several times and not defined. There seems to be some huge problem with File's Owner. Even Aaron Hillegass says that people have trouble understanding File's Owner - and sure enough, when I read his explanation, I remained clueless. So ask some questions (personally without all the banter and unneeded tone). I can follow making a generic NSObject set to my custom class, but why File's Owner? You do this so Interface Builder knows what class the owner of the nib will be so it can expose the correct outlets and actions when you attempt to make connections to/from the file's owner proxy object with other objects in the nib. That's all well and good, but what exactly is this thing? It is a proxy object that allows objects instantiated in the nib to be connected with an object outside of the nib, in this case the object that has been specified as the owner of the nib when it was loaded. So the real question you likely have is who is loading my nib? We can only help answer that if you outline more about the nib and the code involved. However as a guess I assume you are talking about MainMenu.nib (default name for the NSMainNibFile entry that you specify in your Info.plist). This nib is loaded by the NSApplication instance the represents your Cocoa application (created when you call NSApplicationMain() in you main entry point). NSApplication is the owner of that nib, hence the file's owner proxy object represents it. Why would I succeed in having an outlet in my class if I set the Class Identity of File's Owner to my custom class? Please restate since I don't follow the question. Why should I set File's Owner's Class Identity rather than the Class Identity of a plain NSObject that I drag out of the Library in IB? See my first answer. -Shawn ___ 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 [EMAIL PROTECTED]
RE: How to change Tool modes programmatically for a Image View?
Posted this question last night and maybe it was missed by most??!! Hi, I'm trying to find out if it's possible to change the tool mode of an IKImageView's View programmatically? These are the tool modes provided by IKImageView's header file IKToolModeNone; IKToolModeMove; IKToolModeSelect; IKToolModeCrop; IKToolModeRotate; IKToolModeAnnotate; Obviously these can be set in IB but I would like to have a single button in the user interface that would let the user cycle through the various tool options. Can this be done? Many thanks Karl ___ 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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
On May 22, 2008, at 9:36 PM, Graham Cox wrote: On 23 May 2008, at 3:20 am, Andy Lee wrote: That may be, but that is different from demanding that Apple lower the barriers by changing Cocoa itself to resemble those platforms. I think many of the additions in Object-C 2.0 and the addition of garbage collection is *precisely* a case of changing Cocoa to resemble other platforms (i.e. Java). Personally I don't find any of the new features all that compelling, though they are no doubt worthwhile for many. Since veteran Cocoa programmers have managed fine without any of these for a long time, I can only deduce that these changes were added by Apple for the express purpose of lowering the barriers to entry for programmers coming from a Java or .NET background. I think it would a stretch to conclude that GC and properties have opened the door to a flood of bad applications which will devalue the Mac platform. I know you didn't go so far as to say this, but that's the concern I was addressing when I responded to the phrase lowering the barriers. I can understand the desire to keep the Cocoa community small and select (especially if one is already part of that community) and perhaps to benefit from what Paul Graham calls the Python paradox: http://paulgraham.com/pypar.html . On the other hand, it seems like we're stuck with an increasingly popular platform, and one that's fun and free to develop for. Tough luck, I guess. :) --Andy ___ 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 [EMAIL PROTECTED]
Re: Properties GC (was Re: Cocoa et al as HCI usability problem)
On May 22, 2008, at 11:21 PM, Bill Bumgarner wrote: The design goals of properties and GC were to make Cocoa developers more productive and to give Cocoa developers a better set of tools to take advantage of modern Macintosh hardware. That the technologies lower the barriers to entry is certainly true and desirable, but that was secondary to the goals of the features. Of course, any improvements to a development environment that *don't* reduce complexity and *don't* make developer more productive is likely of questionable value. [...interesting and informative notes snipped...] Thanks for the interesting and informative notes. --Andy ___ 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 [EMAIL PROTECTED]
RE: NSTableView
Thanks for the feedback on my messages. I'll work to do better on the subject. And as you can see from other responses, your answer was correct (but you already know that). Take care, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erik Buck Sent: Friday, May 23, 2008 3:18 PM To: cocoa-dev@lists.apple.com Subject: Re: NSTableView Your question was very good. My only criticism of the way you asked you question is the vague title of the post. Ask as many questions like this per day as you want. change the following: - (id) directoryTable: (NSTableView *) aTableView objectValueForTableColumn:(NSTableColumn *) aTableColumn row: (int) rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } to this: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { NSLog(@Row index is %d, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return file; } A data source can be any object you specify, but the names of the data source methods are not optional. You must provide the correctly named methods. http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Task s/UsingTableDataSource.html#/ /apple_ref/doc/uid/2117 By changing the name of the method, you provided no way for the NSTableView to find the needed data. ___ 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/john.darnell%40walswort h.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: NSTableView
On Fri, May 23, 2008 at 1:22 PM, john darnell [EMAIL PROTECTED] wrote: If I did have, say, three tables on a dialog, how would the code know which function was for which table if that first element (or some other element) is not differentiated? An example of one way to do it follows... @interface MyController : NSObject { IBOutlet NSTableView* tableView1; // connected to table 1 in your nib IBOutlet NSTableView* tableView2; // connected to table 2 in your nib IBOutlet NSTableView* tableView3; // connected to table 3 in your nib } @end @implementation MyController - (id) tableView:(NSTableView*)aTableView ...blah... { if (aTableView == tableView1) { ... } else if (aTableView == tableView2) { ... } else if (aTableView == tableView3) { ... } } @end ___ 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 [EMAIL PROTECTED]
Pasteboard question
helo guys. I wanted to use the PasteBoard to use for may drag'n drop table view, and I wish to save a mutable array i the pastboard. I wrote this but I get null back: = CODE = [pboard declareTypes:[NSArray arrayWithObject:NSGeneralPboard] owner:self]; NSMutableArray *rowCopies = [NSMutableArray arrayWithCapacity: [rowIndexes count]]; unsigned int currentIndex = [rowIndexes firstIndex]; while (currentIndex != NSNotFound){ [rowCopies addObject:[[self arrangedObjects] objectAtIndex:currentIndex]]; currentIndex = [rowIndexes indexGreaterThanIndex: currentIndex]; } [pboard setPropertyList:rowCopies forType:NSGeneralPboard]; NSMutableArray *fly = [pboard propertyListForType:NSGeneralPboard]; NSLog(@%@,fly); = CODE = any idea where I made a mistake? and how can I make my kind of datas? ive read a few tutorials without understand how exactly. thanks,bye ___ 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 [EMAIL PROTECTED]
Re: How to change Tool modes programmatically for a Image View?
On May 23, 2008, at 2:31 PM, Karl von Moller wrote: Posted this question last night and maybe it was missed by most??!! Hi, I'm trying to find out if it's possible to change the tool mode of an IKImageView's View programmatically? These are the tool modes provided by IKImageView's header file IKToolModeNone; IKToolModeMove; IKToolModeSelect; IKToolModeCrop; IKToolModeRotate; IKToolModeAnnotate; Obviously these can be set in IB but I would like to have a single button in the user interface that would let the user cycle through the various tool options. Can this be done? -setCurrentToolMode:, as in [myView setCurrentToolMode:IKToolModeSelect]; which can also be written as myView.currentToolMode = IKToolModeSelect; Review the documentation on ObjC-2.0 Properties to see why, even though the documentation does not list this specific method name, the object will respond to that message. ___ 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 [EMAIL PROTECTED]
Re: Pasteboard question
On Fri, May 23, 2008 at 1:36 PM, Davide Scheriani [EMAIL PROTECTED] wrote: helo guys. I wanted to use the PasteBoard to use for may drag'n drop table view, and I wish to save a mutable array i the pastboard. I wrote this but I get null back: = CODE = [pboard declareTypes:[NSArray arrayWithObject:NSGeneralPboard] owner:self]; NSGeneralPboard is the name of a pasteboard not a type of data you can place on the pasteboard. It is the pasteboard instance you get back when you use +[NSPasteboard generalPasteboard] (aka generalPasteboard uses pasteboardWithName:NSGeneralPboard). Also since you appear to be talking about dragging I believe you want the dragging paste board which is named NSDragPboard. Anyway have you read over the following? http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/UsingDragAndDrop.html#//apple_ref/doc/uid/2726-BABFIDAB -Shawn ___ 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 [EMAIL PROTECTED]
Re: How to change Tool modes programmatically for a Image View?
Many thanks for this. I read through the documentation and some how missed this. I knew there had to be a simple answer and this works perfectly! Cheers Karl [myView setCurrentToolMode:IKToolModeSelect]; which can also be written as myView.currentToolMode = IKToolModeSelect; ___ 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 [EMAIL PROTECTED]
Re: File's Owner
On May 23, 2008, at 2:49 PM, Johnny Lundy wrote: I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely uh-huh, yep, but the File's Owner, my nemesis, comes up again. I tried to answer your File's Owner and NSApp questions last week (copied below). If you can indicate at what point in my explanations you start getting lost, I can try to explain better. Again, I'm sensing a very fundamental disconnect, perhaps more fundamental than you realize. Anybody can recite documentation, so there's no need to tell us that and no need to recite the documentation. I think it would be more helpful to tell us at what *part* of the documentation you start to get lost, and what specifically is confusing about it, perhaps as relates to your other programming experience. If the answer is that you draw a complete blank, then we shouldn't be addressing that issue at all; you need to step back to a more fundamental level and see if you feel fluent at that level. --Andy Here's my reply from last week: On May 15, 2008, at 11:11 AM, Andy Lee wrote: On May 14, 2008, at 10:33 PM, Johnny Lundy wrote: So it's the application instance. I don't understand what the application instance is. I can recite the documentation, which says it is a shared instance of NSApplication, also known as NSApp which is a global variable, none of which help me. To me this indicates a very fundamental disconnect, because what you recited explains NSApp perfectly. I can't tell where the disconnect is, so I'll try to spell this out quickly. No offense intended here -- I honestly don't know where the disconnect is. You are writing a Cocoa application. There is a class called NSApplication that represents the concept of a Cocoa application. That's the purpose of a class in an object-oriented language, to describe a *class* of things conceptually. Classes are usually named for the thing they describe -- hence NSApplication. NSApplication handles the generic things that Cocoa applications do: managing the main menu, managing the window list, dealing with mouse and keyboard events, and so on. Cocoa applications create objects (instances of classes). That's what they do all day. Objects get created, they send messages to each other, they get dealloc'ed. Thousands and thousands of objects, all day long. In your application there is one special object that is an instance of NSApplication. It represents the application itself. I repeat: there is an object in your application that represents the running application itself. There is only one such object, and it is stored in a global variable called NSApp. That is what application instance means. Why would someone bind to File's Owner? What specifically is it? Unlike most other objects in a nib file (First Responder being the exception), File's Owner is not a specific object. It is a placeholder for an owner object that will be specified when the nib file is loaded. You edit a nib file knowing that it will be loaded at some point in your program, and *at that future time* the owner of the file (hence File's Owner) will be specified. The file's owner gives your program access to the objects in the nib file, through the connections you made to it in the nib. I think newcomers sometimes assume that when you load a nib you get some sort of NibObject that you can query to get at the objects in the nib, perhaps using the name you assigned in the nib file. This is an understandable assumption, but you don't get any such object. You need to specify a file's owner for the nib (using the second argument to +loadNibNamed:owner:), and you need to have constructed the nib so it connects the file's owner to at least one of its objects. --Andy ___ 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 [EMAIL PROTECTED]
Re: NSTextView without word wrap?
I made some guesses at which statements to copy from BiScrollAspect.m and came up with the following awakeFromNib. I'm not sure which statements are the most relevant, and why, but it seems to do what I need. - (void) awakeFromNib { const CGFloat LargeNumberForText = 1.0e7; [[textView textContainer] setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; [[textView textContainer] setWidthTracksTextView:NO]; [[textView textContainer] setHeightTracksTextView:NO]; [textView setAutoresizingMask:NSViewNotSizable]; [textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; [textView setHorizontallyResizable:YES]; [textView setVerticallyResizable:YES]; } On May 23, 2008, at 12:03 PM, Douglas Davidson wrote: On May 23, 2008, at 10:33 AM, David Carlisle wrote: I've spent the last few hours trying to create an NSTextView without word wrap. The BiScrollAspect.m file in the textSizingExample project file is no help at all. No help in that it doesn't do what you want, or no help in that you can't get it working in your app, or no help in some other way? Douglas Davidson ___ 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 [EMAIL PROTECTED]
Re: Synching Animations Across CALayers
On May 23, 2008, at 11:18 AM, Bridger Maxwell wrote: Perhaps there is a way to see how far along the animation is for a given layer, and be able to make another layer synch to the same time. Surely this has to be possible. Haven't tried this myself but it should be possible to get currently displayed animation values using CALayer presentationLayer property. -Dmitri ___ 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 [EMAIL PROTECTED]
Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
On 23 May 2008, at 11:49, Ken Thomases wrote: On May 23, 2008, at 3:09 AM, Gerriet M. Denkmann wrote: I do seem to remember that there was something to write files and folders to a CDs using an Objective-C interface. - entered disk into AppKido - nothing except NSURLCache. - entered disk recording into Xcode - Help - Documentation - nothing at all - entered disk recording into Spotlight - got 360 things, about 250 are .html with names like index-topic0.html or similar. Unfortunately, you've been bitten by a quirk of technical terminology. Apple consistently uses disk with a 'k' to refer to magnetic storage media, and disc with a 'c' to refer to optical storage media. If you had searched for disc recording, you would have found what you needed right away. Most interesting - never would have thought of this! So I - entered disc recording into Xcode - Help - Documentation - nothing at all - entered disc recording into Spotlight - got 860 things, and the top folder contains the documentation I was looking for. Wonderful thing this English language! Kind regards, Gerriet. ___ 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 [EMAIL PROTECTED]
Re: Cover Flow in Cocoa?
On May 23, 2008, at 3:33 PM, Wayne Shao wrote: I am thinking to use Cover Flow in cocoa app. - Is this a good idea for a desktop/laptop app? Why not? - What APIs are available? The only built-in one is private. You can make your own using CoreAnimation though; search your drive for the CovertFlow sample. Nick Zitzmann http://www.chronosnet.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 [EMAIL PROTECTED]
Re: Cover Flow in Cocoa?
Thanks, On Fri, May 23, 2008 at 2:37 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On May 23, 2008, at 3:33 PM, Wayne Shao wrote: I am thinking to use Cover Flow in cocoa app. - Is this a good idea for a desktop/laptop app? Why not? I never tried this on non-touch based devices. Not sure on the scrolling/selection experience. Any standard Apple apps with this interface? - What APIs are available? The only built-in one is private. You can make your own using CoreAnimation though; search your drive for the CovertFlow sample. Nick Zitzmann http://www.chronosnet.com/ -- Wayne Shao ___ 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 [EMAIL PROTECTED]
Re: Setting iTunes album art with ScriptingBridge
Bill Monk wrote: The biggest issue with the album art is simply getting the image into PICT format, since last I checked, iTunes won't accept any other format. Unfortunately NSImage can read but not generate PICT. The only way I found to do it was to use ick QuickDraw APIs to create a GWorld, then draw the NSImage into it, and then create a PICT from the GWorld. True, though actually the OP showed a clever little technique using NSPasteboard, much easier than a GWorld and works great. In the past I've used Image Events, it'll convert many formats to a PICT file, then read from offset 513 (skipping the PICT header) to get the data iTunes wants. Works fine. The difficulty isn't with the PICT data, it's that a script like this, which works under Tiger: tell application iTunes tell current track try set data of artwork 1 to myPICTData on error error_msg number error_num display dialog error_msg error_num end try end tell end tell does not work under Leopard. I rather suspect it is a data problem, although exactly what is hard to say. Unfortunately, the 'standard' AEDesc image types (typePicture, typeTIFF, typeEPS, etc.) lack any sort of formal definition from Apple, which really doesn't help things. In theory, they should just be the image data stuffed into the descriptor's data handle plus the appropriate four char code for the descriptor type. In practice, it's pretty much up to individual applications what they do, and since it's not a common feature you can likely expect even more screw-ups than usual. All I can really suggest is that you try to reverse-engineer what's going on in iTunes' cranky internals and then work back from there. e.g. I dragged a small PICT file, test.pict, onto iTunes to create an album cover, and then ran the following: #!/usr/bin/ruby require 'osax'; include OSAX; include Appscript d = osax.read(MacTypes::Alias.path('/Users/has/ test.pict'), :as=:PICT_picture) p d.data puts d = app('itunes').current_track.artworks[1].data.get() p d.data Looking at the two dumps, it's pretty obvious that what's coming back from iTunes isn't the same data as the original file; the latter actually looks like PNG data with a PICT file header, which I've a sneaking suspicion is different to before. I wouldn't be surprised if iTunes' internal implementation had been changed recently only for the developers to forget to update its scripting API to accommodate this change (the artwork-related APIs have long been notoriously rough). On Leopard, you get param err instead. Other variants I tried didn't work either, often getting good old Unknown object type error, so something sure seems to have changed. File bugs on iTunes' artwork APIs, and go jump up and down on the AppleScript team to spec this stuff properly so that application developers know what they're meant to do. This works up to the -addObject, which throws error -10014: Handler only handles single objects. SB's -addObject: method, along with its whole object creation process, is defective by design and is already known to fail on iTunes and various other applications which don't march lock-step to Cocoa Scripting's tune. Go use objc-appscript instead; unlike SB, it's designed for maximum compatibility with existing AppleScriptable applications, and on the very, very rare occasion that its high-level API does choke its multi-layer design allows you to fall back to its mid-level APIs fairly gracefully. And once you get over the initial paradigm shift (Apple event IPC is RPC plus queries, not OOP), appscript's approach just makes a whole load more sense since you're dealing directly with the application's own APIs without having to dig through a whole load of obfuscatory faux-OOP crap to get there. You getter documentation and developer tools too; plus the whole codebase is completely open and hackable (MIT license) should you feel the urge for that sort of thing. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.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 [EMAIL PROTECTED]
Re: Cover Flow in Cocoa?
On May 23, 2008, at 3:39 PM, Wayne Shao wrote: I never tried this on non-touch based devices. Not sure on the scrolling/selection experience. Any standard Apple apps with this interface? Finder and iTunes both use cover flow. Nick Zitzmann http://www.chronosnet.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 [EMAIL PROTECTED]
Re: Cover Flow in Cocoa?
On Fri, May 23, 2008 at 2:40 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On May 23, 2008, at 3:39 PM, Wayne Shao wrote: I never tried this on non-touch based devices. Not sure on the scrolling/selection experience. Any standard Apple apps with this interface? Finder and iTunes both use cover flow. oh! I did not know this until now. thanks! Nick Zitzmann http://www.chronosnet.com/ -- Wayne Shao ___ 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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
Sherm Pendley wrote: I think Apple is interested in making Cocoa in general more competitive, not just Objective-C. In fact, I suspect that their recent increased interest in supporting scripting bridges for Cocoa may be at least partly motivated by a need to compete with .NET's multi-language CLR. Absolutely, and don't forget Apple's longstanding and ongoing lack of a credible mid-level language to compete with Visual Basic. Love it or hate it, a good chunk of the software development world rotates around VB. Bringing the Unixy scripting languages on-board would go a good way towards filling in that gap, and without the need to create whole new user-bases and community resources completely from scratch. Also worth noting for those that aren't already aware of it that Laurent Sansonetti, the Apple engineer behind Leopard's Ruby support, has been working on a version of Ruby that runs directly on top of the ObjC runtime, obviating the need for bridging altogether: http://ruby.macosforge.org/trac/wiki/MacRuby has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.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 [EMAIL PROTECTED]
How to tell if iTunes is running.
How can I tell if iTunes is running with cocoa. I am working on a program for iTunes and I am going to add a Quit iTunes and Start iTunes menu. ___ 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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
On Fri, May 23, 2008 at 5:34 PM, Bill Bumgarner [EMAIL PROTECTED] wrote: On May 23, 2008, at 3:49 PM, Sherm Pendley wrote: The implementation of foreach appears almost expressly designed to better support scripting languages. The ObjC foreach() syntax is just chrome - the fast comes from under the hood. It compiles down to a single method that's called to get a count of items and a C array of ids. For a scripting bridge, an opportunity to replace several trips across the bridge per iteration with a single round trip for the whole array is *huge*. That for(... in ...) supports more efficient bridging is a benefit of the design, but not the initial goal. Sure, I understand that. We bridge builders are a very small audience - I'm under no illusions that Apple put in that kind of effort just for us. Still, for all that it *wasn't* purpose-built for efficient bridging, it may as well have been as far as the end result it concerned. I don't think you could have hit that target more squarely even if it had been. 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 [EMAIL PROTECTED]
Re: How to tell if iTunes is running.
On May 23, 2008, at 4:01 PM, Mr. Gecko wrote: How can I tell if iTunes is running with cocoa. In this particular case, you should be able to get that information using -[NSWorkspace launchedApplications]... Nick Zitzmann http://www.chronosnet.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 [EMAIL PROTECTED]
Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
The documentation is for the most part oriented around the implementation of the technologies offered (inside out view) rather than the solving of the challenged faced (outside in view). For experts this is no great barrier, because they are already arguably inside. But see how this trips non-experts up and makes it hard to find things: On May 23, 2008, at 3:09 AM, Gerriet M. Denkmann wrote: Yes. I even can give you a concrete example: I do seem to remember that there was something to write files and folders to a CDs using an Objective-C interface. - entered disk into AppKido - nothing except NSURLCache. - entered disk recording into Xcode - Help - Documentation - nothing at all - entered disk recording into Spotlight - got 360 things, about 250 are .html with names like index-topic0.html or similar. Now I start reminiscing about the good old times with Digital Librarian: - I would enable the Conceptual Guides or the Reference (or both) enter my string and am quite confident to get some references (if NeXTStep 3.3 only would have had disk recording). - Ok so I open /Developer/ADC Reference Library/index.html and look at the choices (Note: there is no search offered). Cocoa (because I am looking for an Objective-C interface) or Storage look promising. Carbon is absolutely wrong, because everybody knows that Carbon contains only C-APIs. Well, the answer is of course: look under Carbon then Audio (I want to backup the data of my hard disk - I am not interested in burning audio CDs at all) - then you will see the Disc Recording Framework Reference which Describes the Objective-C and C API for burning audio and data CDs and DVDs. Yes: Carbon, because there also is a C-API; Audio because it also can burn audio CDs. This took me just now quite some time (almost half an hour?) to find (even though I have looked for it several times before). On May 23, 2008, at 2:49 AM, Ken Thomases wrote: Unfortunately, you've been bitten by a quirk of technical terminology. Apple consistently uses disk with a 'k' to refer to magnetic storage media, and disc with a 'c' to refer to optical storage media. If you had searched for disc recording, you would have found what you needed right away. Search fails miserably when you don't know what to search for. Had there been problem-based top level choices not only would the information have been found sooner, but the error of terminology either never made or corrected before it became a burden. Examples of the kind of topics needed for beginners, the things they encounter very early without knowing how they are implemented: Disks Files Strings Tables Windows Menus Buttons Text fields Fonts There *are* some top-level topics, but the organization is odd. If I want to do some Cocoa Networking, do I look at Cocoa Networking, or Networking Cocoa? ___ 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 [EMAIL PROTECTED]
Re: How to capture data from NSImageView and display in NSView
On May 23, 2008, at 3:32 PM, Stephen Herron wrote: The goal: A window with two views. The view on the left, NSImageView, displays the NSImage from - (void)openPanelDidEnd:. The right view, NSView, displays the result of a CIFilter using the pixel data displayed in the right-hand view. The problem: I cannot convert the NSImage used in the NSImageView to a CIImage because: 1. I do not know how to access the NSImage pixel data You can make an NSBitmapImageRep and draw the NSImage into that. 2. I do not know how to convert NSImage data to CIImage data. (The developer site has code samples for CGImage to CIImage but nothing for NSImage to CIImage?) There's a handful of ways and depends what works best for you. One is to get an NSData with TIFFRepresentation and use that data to initWithData: a CIImage. Or make it with the bitmap created from the above. There's also ways to do these using CoreGraphics if you need those types as well. If so I can give examples using those. ___ 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 [EMAIL PROTECTED]
Re: File's Owner
The hang up that I see is that this documentation give no clue as to the reason for File's Owner's existence. What problem does it solve? Fundamentals mean nothing unless they read like a story: you have to give each thing a reason to exist so that the reader has a place to mentally hang them. On May 23, 2008, at 12:13 PM, Matt Long wrote: I'm trying to figure out why the big hang up on needing to understand it fully. Not understanding it should not prevent you from developing applications. So why the hangup? What is the actual problem? Just set your own NSObject based app delegate as the File's Owner delegate in IB and start adding your code to it. That's really all you *need* to know. -Matt -- Matt Long [EMAIL PROTECTED] http://www.matthew-long.com/ On May 23, 2008, at 12:49 PM, Johnny Lundy [EMAIL PROTECTED] wrote: I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely uh-huh, yep, but the File's Owner, my nemesis, comes up again. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_3.html You connect an outlet in Interface Builder, but the procedure starts in Xcode. The following steps describe the procedure: When defining your custom class, declare an outlet by tagging the instance variable with the IBAction qualifier. In Interface Builder, drag a generic object into the top level of the nib file window (if one doesn’t already exist for your custom class). If an instance of your custom class is to be the File’s Owner for the nib file, this step is not necessary. Also, if you’re defining a custom NSView object, select that object instead. Import the custom class into Interface Builder. With the generic object (or File’s Owner) selected, type the name of your custom class in the Class field of the Identify pane of the Interface Builder inspector. This assigns your custom class as the class of the selected object. This step has to be done only once. Select your custom instance (or File’s Owner). Right-click or Control-click this object to display the connections panel. Find your outlet under Outlets and drag a connection line from the circle next to the outlet to the object on the user interface that you want that outlet to reference. I sent feedback on this as File's Owner is mentioned several times and not defined. There seems to be some huge problem with File's Owner. Even Aaron Hillegass says that people have trouble understanding File's Owner - and sure enough, when I read his explanation, I remained clueless. I can follow making a generic NSObject set to my custom class, but why File's Owner? My birthday is coming up and if I can understand File's Owner, I will consider that one of the best presents. As usual, I can recite the documentation without understanding it : File's Owner is a proxy object that is set at nib load time to the object that loaded the nib (I don't know what object loaded my nib, so that does not help me). In MainMenu.nib, this is the application instance, which is a shared singleton instance of NSApplication (how all applications can share this is beyond me), which is also set to the global variable NSApp (uhh, OK...). That's all well and good, but what exactly is this thing? Why would I succeed in having an outlet in my class if I set the Class Identity of File's Owner to my custom class? Why should I set File's Owner's Class Identity rather than the Class Identity of a plain NSObject that I drag out of the Library ___ 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/bagelturf%40mac.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Core Data, transient properties and saving
Thanks for the quick reply Ben and your explanation of what's going on. I've just re-read the Fetching section of the Core Data Programming Guide and its glaring at me not to fetch using transient attributes. I appreciate your help. Jon On 23 May 2008, at 22:32, Ben Trumbull wrote: As a summary, you can't fetch or sort against transient properties reliably. They don't exist in the persistent store (database). The in memory filtering will apply your predicate to any dirty objects to reconcile unsaved changes with the results from the persistent store. So saving the store has turned all my file objects into faults. Not exactly, the managed objects are marked clean (not dirty) after saving. Since the objects are no longer dirty, the MOC's filtering will not post process them for unsaved changes. How can I work around this? I could always walk the tree and ask each file if they're edited, but a fetch seems cleaner. You should probably keep an NSSet of edited objects. Alternatively, you could make it a persistent property and manage the consequences of that. -- -Ben smime.p7s Description: S/MIME cryptographic signature ___ 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 [EMAIL PROTECTED]
Re: Errors from NSTreeController (or NSOutlineView?)
On Fri, May 23, 2008 at 6:11 PM, Brent Fulgham [EMAIL PROTECTED] wrote: I'm not sure if this: a) indicates IP address conflicts that cause the same IP address to attempt to be added multiple times This should not be causing you to add the same object more than once. Your model or controller should be handling this so that the view is only getting unique objects. This may mean using some other class as your model representation. --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 [EMAIL PROTECTED]
Re: Cocoa et al as HCI usability problem
On Fri, May 23, 2008 at 5:58 PM, has [EMAIL PROTECTED] wrote: Sherm Pendley wrote: I think Apple is interested in making Cocoa in general more competitive, not just Objective-C. In fact, I suspect that their recent increased interest in supporting scripting bridges for Cocoa may be at least partly motivated by a need to compete with .NET's multi-language CLR. Absolutely, and don't forget Apple's longstanding and ongoing lack of a credible mid-level language to compete with Visual Basic. Love it or hate it, a good chunk of the software development world rotates around VB. Bringing the Unixy scripting languages on-board would go a good way towards filling in that gap We're getting there. What we have works, but speaking strictly for my own project, I'm well aware that there's more to be done. Perl's DBI database module, and drivers for MySQL, PostgreSQL, and SQLite are included with CamelBones, as well as a collection of Perl's object-relational modules built around DBIx::Class. I can do a lot of things with CamelBones for which I would use Access or VB on Windows - in my opinion there's a lot of opportunity in that area as the Mac presence increases in business. Still, it's not as smooth as I would like it yet. CamelBones' KVC/KVO support is limited to scalar types, and I would like to add indexed accessors for Perl arrays. For now, we have to write the old school methods by hand to provide rows of data for a table - lots of boring, error-prone boilerplate. And there's an object mapping layer (DBIx::Class::Schema::Loader) that generates Perl classes for database tables - I'd like to extend it to generate classes that are exported to ObjC. Also worth noting for those that aren't already aware of it that Laurent Sansonetti, the Apple engineer behind Leopard's Ruby support, has been working on a version of Ruby that runs directly on top of the ObjC runtime, obviating the need for bridging altogether: http://ruby.macosforge.org/trac/wiki/MacRuby That's a great idea, and I've been watching that project with interest. Sadly, even though I've known C for nearly 20 years, looking inside perl.c scares me nearly as much as the idea of writing a Perl parser from scratch. :-( 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 [EMAIL PROTECTED]