From denise at kurisudesign.com Sat Dec 1 10:36:35 2007 From: denise at kurisudesign.com (Denise Eatherly) Date: Sat Dec 1 11:04:33 2007 Subject: CoreServicesUIAg Message-ID: <0AA2A217-88FA-4B02-886F-533A8A4390B6@kurisudesign.com> Hi, Has anyone seen error messages like these? (RCFramework is my embedded framework, so you wouldn't get that line.) I assume that LSQuarantine is behind this - is it called by Launch services?? What does it mean? How can I prevent it? Nov 29 12:02:50 MacProOcto kernel[0]: CoreServicesUIAg[6019] Unable to clear quarantine `Headers': 13 Nov 29 12:02:50 MacProOcto kernel[0]: CoreServicesUIAg[6019] Unable to clear quarantine `RCFramework': 13 Nov 29 12:02:50 MacProOcto kernel[0]: CoreServicesUIAg[6019] Unable to clear quarantine `Resources': 13 Nov 29 12:02:50 MacProOcto kernel[0]: CoreServicesUIAg[6019] Unable to clear quarantine `Current': 13 Thanks, Denise From daniel at highdesertchurch.com Sun Dec 2 11:20:27 2007 From: daniel at highdesertchurch.com (Daniel Hazelbaker) Date: Sun Dec 2 12:22:04 2007 Subject: getBitmapDataPlanes not recognized? Message-ID: <81C32958-596B-4D3B-824D-47CD24AC5BC4@highdesertchurch.com> I have a program that, apparently, calls getBitmapDataPlanes: method on an NSPICTImageRep. Nowhere in my own code is that method called so it must be called from an AppKit or Quicktime APi that I use. About 2 or 3 months ago I installed one of the Quicktime updates on my development computer. Ever since then computers that try to run my program (I am developing using XCode 2.5 and the 10.4uSDK) that do not have the latest Quicktime installed get this exception: *** -[NSPICTImageRep getBitmapDataPlanes:]: selector not recognized [self = 0x1679f030] Is there a way to force my program to use the 10.4 "native" Quicktime API instead of what is available on my computer? I am linking to the QTKit, Quicktime and QuartzCore frameworks in /System/Library/ Frameworks, but shouldn't the linker be using the ones under the SDKROOT automatically? Daniel From sstevenson at mac.com Sun Dec 2 14:37:36 2007 From: sstevenson at mac.com (Scott Stevenson) Date: Sun Dec 2 14:37:42 2007 Subject: getBitmapDataPlanes not recognized? In-Reply-To: <81C32958-596B-4D3B-824D-47CD24AC5BC4@highdesertchurch.com> References: <81C32958-596B-4D3B-824D-47CD24AC5BC4@highdesertchurch.com> Message-ID: <5AF5198E-DFE5-499A-A91E-1E1B9922BE16@mac.com> On Dec 2, 2007, at 11:20 AM, Daniel Hazelbaker wrote: > I have a program that, apparently, calls getBitmapDataPlanes: method > on an NSPICTImageRep. Nowhere in my own code is that method called > so it must be called from an AppKit or Quicktime APi that I use. > About 2 or 3 months ago I installed one of the Quicktime updates on > my development computer. Ever since then computers that try to run > my program (I am developing using XCode 2.5 and the 10.4uSDK) that > do not have the latest Quicktime installed get this exception: > > *** -[NSPICTImageRep getBitmapDataPlanes:]: selector not recognized > [self = 0x1679f030] If you'd like to see how this is getting called, try setting a breakpoint on [NSException raise] - Scott From daniel at highdesertchurch.com Sun Dec 2 16:36:07 2007 From: daniel at highdesertchurch.com (Daniel Hazelbaker) Date: Sun Dec 2 16:36:21 2007 Subject: getBitmapDataPlanes not recognized? In-Reply-To: <5AF5198E-DFE5-499A-A91E-1E1B9922BE16@mac.com> References: <81C32958-596B-4D3B-824D-47CD24AC5BC4@highdesertchurch.com> <5AF5198E-DFE5-499A-A91E-1E1B9922BE16@mac.com> Message-ID: At some point I'll need to dig into that... Unfortunately none of the machines it is crashing on have the dev tools installed... yet. :) Daniel On Dec 2, 2007, at 2:37 PM, Scott Stevenson wrote: > > On Dec 2, 2007, at 11:20 AM, Daniel Hazelbaker wrote: > >> I have a program that, apparently, calls getBitmapDataPlanes: >> method on an NSPICTImageRep. Nowhere in my own code is that method >> called so it must be called from an AppKit or Quicktime APi that I >> use. About 2 or 3 months ago I installed one of the Quicktime >> updates on my development computer. Ever since then computers that >> try to run my program (I am developing using XCode 2.5 and the >> 10.4uSDK) that do not have the latest Quicktime installed get this >> exception: >> >> *** -[NSPICTImageRep getBitmapDataPlanes:]: selector not recognized >> [self = 0x1679f030] > > If you'd like to see how this is getting called, try setting a > breakpoint on [NSException raise] > > - Scott > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev > From edenwaith at mac.com Tue Dec 4 20:21:17 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Tue Dec 4 20:20:43 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <20071127015840.7ED451E7521@forums.omnigroup.com> References: <20071127015840.7ED451E7521@forums.omnigroup.com> Message-ID: <22EFF04F-0204-446B-AE0A-D08F6C47DBCF@mac.com> I have an application which loops an arbitrary number of times (depending on the number of files being handled), which calls an NSTask. I'm encountering an odd error with pre-Leopard systems where if my program loops around 200 times, the following error is called. 2007-11-26 13:43:29.137 MyApp[3595] Exception raised during posting of notification. Ignored. exception: *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value I've done some research, but I cannot find anything which seems to pin point this particular problem. My guess is that this error is being thrown when an NSTaskDidTerminateNotification is called after the task is complete. What I've been able to dig up on this "notification exception" might be related to "too many files being opened at once". Another odd thing about this situation is that I cannot reproduce the problem on Leopard. However, on earlier systems (Tiger, Panther, and Jaguar), the problem exists. This is a pre-existing issue, so it is not something that happened after building on Leopard or anything along those lines. In my code, I also do make one call to an NSMutableDictionary, which does have a [NSDictionary setObject: forKey:] call, but that doesn't seem to be the source of the problem since I eliminated that code, and the problem persists. Any ideas? Regards, Chad From sstevenson at mac.com Tue Dec 4 23:04:12 2007 From: sstevenson at mac.com (Scott Stevenson) Date: Tue Dec 4 23:04:18 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <22EFF04F-0204-446B-AE0A-D08F6C47DBCF@mac.com> References: <20071127015840.7ED451E7521@forums.omnigroup.com> <22EFF04F-0204-446B-AE0A-D08F6C47DBCF@mac.com> Message-ID: <97C1D97F-C112-4A66-8766-04302178D30B@mac.com> On Dec 4, 2007, at 8:21 PM, Chad Armstrong wrote: > I've done some research, but I cannot find anything which seems to > pin point this particular problem. My guess is that this error is > being thrown when an NSTaskDidTerminateNotification is called after > the task is complete. What I've been able to dig up on this > "notification exception" might be related to "too many files being > opened at once". I don't know the exact answer to your question, but there are two kernel settings which are relevant: $ sysctl kern.maxproc 532 $ sysctl kern.maxprocperuid 266 If you're launching all of these NSTasks simultaneously, it might be a problem. It's possible NSTask is somehow smarter about how it spawns processes on Leopard. You can manually override these values if you're working in a controlled setting. > In my code, I also do make one call to an NSMutableDictionary, which > does have a [NSDictionary setObject: forKey:] call, but that doesn't > seem to be the source of the problem since I eliminated that code, > and the problem persists. That could be some code getting called in the frameworks. You can trying breaking on the -[NSException raise] to see what's up. - Scott From antti.karanta at napa.fi Wed Dec 5 00:23:05 2007 From: antti.karanta at napa.fi (Antti Karanta) Date: Wed Dec 5 00:37:14 2007 Subject: Finding out executable location from a c program Message-ID: <680FA370A36D83439E177BDC02F0E8B501CCEC89@nw60.napa.fi> > -----Original Message----- > From: Alastair Houghton [mailto:alastair@alastairs-place.net] > > On 23 Nov 2007, at 20:52, Antti Karanta wrote: > > > On Tue, 20 Nov 2007 14:36:53 +0200, Alastair Houghton > > > wrote: > > > >> It's perhaps worth saying though that using the path of your tool > >> is generally an evil thing to do. > > > > Why is it evil? > > Because you can't guarantee that you can get the path, in general. > You have to use system-specific hacks to obtain it, System specific, yes, but "hack" is a pretty strong word here as (at least on the four os:es I'm currently targeting) there is a well defined and documented way to get the said path. > Even on systems that do let you obtain such a path, you may > find that the path is that of a symlink Not a problem, I just call "realpath" function. > Furthermore, even if you do find the path somehow, a malicious (or > just misguided) user could move things around between the time you > obtain the path and the time your code is actually running. Doesn't this scenario equally apply to the situation where you place the files you need in a "known location"? > For the type of application you're talking about, hard-coded paths > seem the most sensible choice, possibly allowing GROOVY_HOME to > override them if it's set. You can easily find the paths to use when > your users build your program (it looks like the type that's built > from source, right?) Most people would not build the main groovy distribution themselves. ATM people who want to use the native launcher have to build that themselves (except on windows). So the answer is yes(ish), at least for now. > And if you want to package-up pre-built versions of your launcher with > Groovy itself, you can do that too, using the various system-specific > packaging tools (e.g. PackageMaker on OS X). Certainly on OS X, many > users would prefer to be able to double-click a "Groovy.pkg" file > anyway. The same is true, I think, for other systems. You are absolutely right. > If you do that, you can delete all the grotty code to find the > executable path on all the systems you currently support, *and* the > program will be more likely to run without modification on other > systems too. Ok, I see your point - when in Rome, do as the Romans do. = ) BTW, if I made a bundle, the code I have would be exactly the same (as I'm using the bundle API to find the exec location). Why would finding the necessary files by the executable location be any more justified in that case? I.e. is the existence of this part of the bundle API a mistake? -Antti- From alastair at alastairs-place.net Wed Dec 5 03:37:22 2007 From: alastair at alastairs-place.net (Alastair Houghton) Date: Wed Dec 5 03:37:32 2007 Subject: Finding out executable location from a c program In-Reply-To: <680FA370A36D83439E177BDC02F0E8B501CCEC89@nw60.napa.fi> References: <680FA370A36D83439E177BDC02F0E8B501CCEC89@nw60.napa.fi> Message-ID: <365A802B-AE1C-4570-9B5A-4F461A305E34@alastairs-place.net> On 5 Dec 2007, at 08:23, Antti Karanta wrote: >>> Furthermore, even if you do find the path somehow, a malicious (or >> just misguided) user could move things around between the time you >> obtain the path and the time your code is actually running. > > Doesn't this scenario equally apply to the situation where you place > the files you need in a "known location"? No. Because the usual known locations are all protected by their default security settings. The user in question would need access to those locations and if they had that then in many cases they don't need to use these kinds of tricks. The risk with finding the executable path is that it's much more likely that your code can be tricked somehow into thinking the executable is somewhere other than where it really is. Even if you're using realpath(), I can hard link from somewhere that I can write to to your executable file, and then I can substitute whatever files I like for your usual resources. If your program has any security privileges whatsoever, that makes for a nice security hole. >> And if you want to package-up pre-built versions of your launcher >> with >> Groovy itself, you can do that too, using the various system-specific >> packaging tools (e.g. PackageMaker on OS X). Certainly on OS X, many >> users would prefer to be able to double-click a "Groovy.pkg" file >> anyway. The same is true, I think, for other systems. > > You are absolutely right. > >> If you do that, you can delete all the grotty code to find the >> executable path on all the systems you currently support, *and* the >> program will be more likely to run without modification on other >> systems too. > > Ok, I see your point - when in Rome, do as the Romans do. = ) :-) Yeah, sort of. I think my point was really that *not* trying to find the executable path was an easier, safer and more portable solution, and that there aren't really any disadvantages worth mentioning (for your specific application, where it's actually IMO beneficial if its installed in a well-known place). > BTW, if I made a bundle, the code I have would be exactly the same (as > I'm using the bundle API to find the exec location). Why would finding > the necessary files by the executable location be any more justified > in > that case? I.e. is the existence of this part of the bundle API a > mistake? Bundles are there to solve the kind of problem you're trying to solve, certainly; the benefit is that they don't rely on the executable location (or, when they do, it's system code doing so, not your code, so its less likely to contain bugs or security holes and when such things do get found and fixes your app will take advantage of that automatically without you having to release a new version). Of course, they're really only applicable on Mac OS X and NeXT (and maybe a few other esoteric systems---e.g. Acorn RiscOS used to do something similar). So bundles are certainly a good solution for developers writing software specifically for use on Mac OS X. Sometimes they're a good way to go for ported software as well (e.g. having things bundled as a framework rather than installing in /usr/local/include and /usr/local/ lib), and you could certainly use a bundle if you wanted, it's just that on Mac OS X, the usual Unix-like approach will work nicely already (for what you're doing) and if you make it into a bundle on the Mac and then don't put in a load of symlinks in the appropriate places it just makes it incompatible with the same package installed on e.g. Linux. Kind regards, Alastair. -- http://alastairs-place.net From edenwaith at mac.com Wed Dec 5 19:39:50 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Wed Dec 5 19:39:17 2007 Subject: MacOSX-dev Digest, Vol 48, Issue 3 In-Reply-To: <20071205200026.5C662971CC@forums.omnigroup.com> References: <20071205200026.5C662971CC@forums.omnigroup.com> Message-ID: <3BED7D10-283B-4B2A-88E9-C8320FC63C92@mac.com> That's an interesting point, Scott. I'll look into this further. I noticed that Panther's kern.maxprocperuid is set to only 100, whereas Leopard is 266. I'll need to also check other versions of Mac OS X and see how they might different. The only problem with your suggestion is that each task is called sequentially. One is called, and the next one will not start until the previous one has completed. The PID continues to rise with each time the NSTask is launched, but there are not a bunch of tasks being called all at once. Regards, Chad On Dec 5, 2007, at 2:00 PM, macosx-dev-request@omnigroup.com wrote: >> I've done some research, but I cannot find anything which seems to >> pin point this particular problem. My guess is that this error is >> being thrown when an NSTaskDidTerminateNotification is called after >> the task is complete. What I've been able to dig up on this >> "notification exception" might be related to "too many files being >> opened at once". > > I don't know the exact answer to your question, but there are two > kernel settings which are relevant: > > $ sysctl kern.maxproc > 532 > > $ sysctl kern.maxprocperuid > 266 > > If you're launching all of these NSTasks simultaneously, it might be a > problem. It's possible NSTask is somehow smarter about how it spawns > processes on Leopard. You can manually override these values if you're > working in a controlled setting. > >> In my code, I also do make one call to an NSMutableDictionary, which >> does have a [NSDictionary setObject: forKey:] call, but that doesn't >> seem to be the source of the problem since I eliminated that code, >> and the problem persists. > > That could be some code getting called in the frameworks. You can > trying breaking on the -[NSException raise] to see what's up. > > - Scott From alastair at alastairs-place.net Thu Dec 6 03:06:02 2007 From: alastair at alastairs-place.net (Alastair Houghton) Date: Thu Dec 6 03:06:06 2007 Subject: MacOSX-dev Digest, Vol 48, Issue 3 In-Reply-To: <3BED7D10-283B-4B2A-88E9-C8320FC63C92@mac.com> References: <20071205200026.5C662971CC@forums.omnigroup.com> <3BED7D10-283B-4B2A-88E9-C8320FC63C92@mac.com> Message-ID: <49D600F7-B2FF-44FB-8CA6-F033C971ED79@alastairs-place.net> On 6 Dec 2007, at 03:39, Chad Armstrong wrote: > That's an interesting point, Scott. I'll look into this further. I > noticed that Panther's kern.maxprocperuid is set to only 100, > whereas Leopard is 266. I'll need to also check other versions of > Mac OS X and see how they might different. > > The only problem with your suggestion is that each task is called > sequentially. One is called, and the next one will not start until > the previous one has completed. The PID continues to rise with each > time the NSTask is launched, but there are not a bunch of tasks > being called all at once. Does your code call -waitUntilExit on the NSTasks? At the underlying UNIX layer, if you don't check the exit status, you will end up with zombie processes that still take up process table entries. If you want to check for this problem, you can do so by looking at the output of the "ps x" command in Terminal. The STAT column will show "Z" for zombie processes. Kind regards, Alastair. -- http://alastairs-place.net From bob at apple.com Thu Dec 6 14:57:06 2007 From: bob at apple.com (Bob Frank) Date: Thu Dec 6 14:58:07 2007 Subject: MEETING: Chicago CocoaHeads / CAWUG - Dev Tools & ObjC2 - Tuesday December 11th 7:00 PM Message-ID: <67344C17-68F5-4F8C-962C-40791659E740@apple.com> IMPORTANT NOTES: Our meetings will be permanently starting at ** 7:00 ** instead of 6:00 We have a new mailing list URL: http://groups.google.com/group/cawug Email Address: cawug@googlegroups.com You can email here to subscribe immediately: cawug-subscribe@googlegroups.com -------- Hi all, Just a quick reminder. The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group (CAWUG) is holding our next meeting tonight Tuesday, December 11th, at 7:00 PM at the Apple Store on Michigan Ave. Agenda: - Introductions & Announcements - Dave Dribbin with lots Leopard Dev Tools Demos - adjournment to O'Toole's When: Tuesday, December 11th, 6:00 PM Where: Apple Store Michigan Avenue 679 North Michigan Ave. (at the corner of Huron & Michigan Ave.) Chicago, IL 60611 http://maps.yahoo.com/maps_result? ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611 http://tinyurl.com/26z5nb (in case long URL gets cut) - Dave on Leopard Tools Leopard has tons of changes under the hood that will have developers itching to try it out. Dave Dribin will be talking about the highlights of what's new for the developer in Leopard, such as development tools, Objective-C 2.0, and new and improved APIs. Dave Dribin is an independent Mac developer and consultant doing business under Bit Maki, Inc. He is also a regular columnist for MacTech magazine. - O'Tooles We will continue the discussion at our local watering hold Timothy O'Toole's at 622 Fairbanks (2 blocks east of the store). We also wish to thank the folks who run the theater space at the Apple store for letting us have our meetings there, and Jonathan 'Wolf' Rentzsch for hosting the new and revived CAWUG web site. Thanks all. Also, if you are working on a project and would like to talk about it briefly / promote it, I think it would be fun for people to hear about other people's projects. Please email me off line and you can talk at a future meeting or would like a book to review we would welcome that too. Future meetings dates and tentative topics: 1/8/08, 2/12/08, 3/11/08 January - Bob on DTrace & Instruments February - TBD on developing for WebObjects in Leopard with Eclipse and the other new tools March - TBD if the iPhone SDK is out, we hope to talk about it., if not topic TBD CAWUG Resources Mail list: http://groups.google.com/group/cawug Google Site: http://groups.google.com/group/cawug Web Site: http://www.cawug.org/ RSS feed: http://www.cawug.org/rss.xml iCal: http://ical.mac.com/chicagobob/ Chicago-CocoaHeads-CAWUG (view on the web) iCal: webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG.ics (subscribe to in iCal) Cocoa Heads web site: http://cocoaheads.org/us/ChicagoIllinois/index.html Hope to see you at the meeting. --- Bob Frank bob@apple.com (312) 961 - 0509 [cell] (312) 902 - 7393 [office] Senior Consulting Engineer Apple Education Services From edenwaith at mac.com Thu Dec 6 20:02:47 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Thu Dec 6 20:02:12 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <20071206200031.A57B598982@forums.omnigroup.com> References: <20071206200031.A57B598982@forums.omnigroup.com> Message-ID: Thanks for the tip. I ran a check, but no zombie processes were sticking around. I do not call -waitUntilExit for any of the tasks. The NSTask is launched ( [myTask launch] ) and it does its stuff. Once completed, it throws the NSTaskDidTerminateNotification, which then moves onto the next step. I ran my application again, and once again it stopped right around the 250 mark. 2007-12-06 12:20:30.943 MyApp[21317] Exception raised during posting of notification. Ignored. exception: *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value 2007-12-06 12:21:45.765 MyApp[21317] Failed to load NSSystemInfoPanel.nib The last line (Failed to load NSSystemInfoPanel.nib) occurs when I try and open the About MyApp menu, after the program has stalled. Once again, this error seems to point that "too many files are open". When my program calls a new task, it gets assigned a new PID, so the PID number keeps incrementing (which should be correct), but it does not appear that the old task ever stays around, and I am calling the following once each iteration is complete. [myTask release]; myTask = nil; Regards, Chad On Dec 6, 2007, at 2:00 PM, macosx-dev-request@omnigroup.com wrote: > Does your code call -waitUntilExit on the NSTasks? At the underlying > UNIX layer, if you don't check the exit status, you will end up with > zombie processes that still take up process table entries. > > If you want to check for this problem, you can do so by looking at the > output of the "ps x" command in Terminal. The STAT column will show > "Z" for zombie processes. From sstevenson at mac.com Thu Dec 6 20:52:17 2007 From: sstevenson at mac.com (Scott Stevenson) Date: Thu Dec 6 20:52:23 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: References: <20071206200031.A57B598982@forums.omnigroup.com> Message-ID: On Dec 6, 2007, at 8:02 PM, Chad Armstrong wrote: > I ran a check, but no zombie processes were sticking around. I do > not call -waitUntilExit for any of the tasks. The NSTask is > launched ( [myTask launch] ) and it does its stuff. Once completed, > it throws the NSTaskDidTerminateNotification, which then moves onto > the next step. > > I ran my application again, and once again it stopped right around > the 250 mark. > > 2007-12-06 12:20:30.943 MyApp[21317] Exception raised during posting > of notification. Ignored. exception: *** -[NSCFDictionary > setObject:forKey:]: attempt to insert nil value > 2007-12-06 12:21:45.765 MyApp[21317] Failed to load > NSSystemInfoPanel.nib What does the 'lsof' command say? - Scott From natedar at gmail.com Thu Dec 6 21:53:17 2007 From: natedar at gmail.com (Nat Edar) Date: Thu Dec 6 21:53:22 2007 Subject: How to Implement File Encryption with SSCrypto? Message-ID: <11bba2620712062153k636d2cafj15ddd9a96cd3a609@mail.gmail.com> I'm using the SSCrypto framework (http://septicus.com/products/opensource/) which is pretty straightforward and I can encrypt/decrypt NSStrings fine. Apparently it is also capable of encrypting NSData. My idea for encrypting a file before it was written, was to encrypt the output of "NSKeyedArchiver" in my implementation of dataOfType. Here's my code: - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { NSString *publicKeyPath = [[NSBundle mainBundle] pathForResource:@"PUBKEY" ofType:@"pem" inDirectory:@"../.."]; NSString *privateKeyPath = [[NSBundle mainBundle] pathForResource: @"Privatekey" ofType:@"pem" inDirectory:@"../.."]; NSData *publicKeyData = [NSData dataWithContentsOfFile:publicKeyPath]; NSData *privateKeyData = [NSData dataWithContentsOfFile:privateKeyPath]; SSCrypto *crypto = [[SSCrypto alloc] initWithPublicKey:publicKeyData privateKey:privateKeyData]; [personController commitEditing]; NSData *clearData = [NSKeyedArchiver archivedDataWithRootObject:employees]; [crypto setClearTextWithData:clearData]; NSData *encryptedData = [crypto encrypt]; if ( outError != NULL ) { *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; } return encryptedData bytes; } This doesn't work, but my question is two-fold: 1. Where is my logic flawed and why won't this work? 2. Can this code be functional or should I encrypt individual NSStrings in my models (I would rather obfuscate the entire file)? Thanks in advance! From smokinmonkey at yahoo.com Fri Dec 7 08:09:02 2007 From: smokinmonkey at yahoo.com (Michael Dupuis) Date: Fri Dec 7 08:09:06 2007 Subject: Building using the latest OmniFrameworks on Leopard? Message-ID: <728631.11879.qm@web31910.mail.mud.yahoo.com> Greetings, I'm trying to build an application of mine on Leopard, and I can't seem to do it using the latest OmniFrameworks for various reasons. When I try to build using XCode 3, I get this error - sys/version.h: No such file or directory, called from OAPreferenceController.h. I've looked for any updated instructions on installing and using the frameworks, but can't seem to find any, so I'm trying to build as I always have, just replacing my older framework builds with the new ones. I also can't seem to build using the latest frameworks on Tiger either though, for a different reason. When building on Tiger, using XCode 2.4.1, I get a build error stating - pthreads.h: no such file or directory, called from OAPreferenceClient.h. I'm guessing there is some updated information that I'm missing to get applications that use these to build now. Any pointers? I searched the Omni forums and did a search on Cocoabuilder but didn't turn up any recent information. Thanks for any info! Michael ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From stephane at sente.ch Fri Dec 7 09:20:21 2007 From: stephane at sente.ch (=?ISO-8859-1?Q?St=E9phane_Corth=E9sy?=) Date: Fri Dec 7 10:20:27 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <22EFF04F-0204-446B-AE0A-D08F6C47DBCF@mac.com> References: <20071127015840.7ED451E7521@forums.omnigroup.com> <22EFF04F-0204-446B-AE0A-D08F6C47DBCF@mac.com> Message-ID: Hi, Do you have a NSAutoreleasePool inside (not around) your loop, and do you release it? St?phane On 5 Dec 2007, at 05:21 , Chad Armstrong wrote: > I have an application which loops an arbitrary number of times > (depending on the number of files being handled), which calls an > NSTask. I'm encountering an odd error with pre-Leopard systems > where if my program loops around 200 times, the following error is > called. > > 2007-11-26 13:43:29.137 MyApp[3595] Exception raised during posting > of notification. Ignored. exception: *** -[NSCFDictionary > setObject:forKey:]: attempt to insert nil value > > I've done some research, but I cannot find anything which seems to > pin point this particular problem. My guess is that this error is > being thrown when an NSTaskDidTerminateNotification is called after > the task is complete. What I've been able to dig up on this > "notification exception" might be related to "too many files being > opened at once". > > Another odd thing about this situation is that I cannot reproduce > the problem on Leopard. However, on earlier systems (Tiger, > Panther, and Jaguar), the problem exists. This is a pre-existing > issue, so it is not something that happened after building on > Leopard or anything along those lines. > > In my code, I also do make one call to an NSMutableDictionary, which > does have a [NSDictionary setObject: forKey:] call, but that doesn't > seem to be the source of the problem since I eliminated that code, > and the problem persists. > > Any ideas? > > Regards, > > Chad > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From edenwaith at mac.com Fri Dec 7 13:49:17 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Fri Dec 7 13:48:40 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <20071207200025.D8D109A1B4@forums.omnigroup.com> References: <20071207200025.D8D109A1B4@forums.omnigroup.com> Message-ID: <2BD2988C-8422-4A5C-8B68-FE8DF2BA05D0@mac.com> >> 2007-12-06 12:20:30.943 MyApp[21317] Exception raised during posting >> of notification. Ignored. exception: *** -[NSCFDictionary >> setObject:forKey:]: attempt to insert nil value >> 2007-12-06 12:21:45.765 MyApp[21317] Failed to load >> NSSystemInfoPanel.nib > > What does the 'lsof' command say? I have also been using lsof, and I'm not finding anything that looks too suspicious. I when I run it, I see the file that is being worked on currently, but no mention of older files at all. I'll check again, however, just to double-check. > > Do you have a NSAutoreleasePool inside (not around) your loop, and do > you release it? Yes, there is an NSAutoreleasePool that is used in the code (to capture output coming from the NSTask), but I explicitly call a [pool release] at the end of the method that uses the NSAutoreleasePool. - Chad From edenwaith at mac.com Fri Dec 7 15:22:44 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Fri Dec 7 15:22:06 2007 Subject: Odd notification / NSCFDictionary error In-Reply-To: <20071207200025.D8D109A1B4@forums.omnigroup.com> References: <20071207200025.D8D109A1B4@forums.omnigroup.com> Message-ID: On Dec 7, 2007, at 2:00 PM, macosx-dev-request@omnigroup.com wrote: > What does the 'lsof' command say? > > - Scott Under Leopard, lsof wasn't revealing much. However, my problem doesn't seem to appear in Leopard, but I went back to Tiger and tried it again. This finally seems to be pointing in the right direction! My task is making use of a pipe, which is acting as a new "file" or resource and it isn't closing properly. MyApp 1074 admin 0r CHR 3,2 0t0 41792260 /dev/null MyApp 1074 admin 1w CHR 0,0 0t187 41792772 /dev/ console MyApp 1074 admin 2w CHR 0,0 0t187 41792772 /dev/ console MyApp 1074 admin 3r PSXSHM 4096 apple.shm.notification_center MyApp 1074 admin 4r PSXSHM 4096 /tmp/ com.apple.csseed.65 MyApp 1074 admin 5r PSXSHM 4096 apple.shm.notification_center ... MyApp 1074 admin 38 PIPE 0x2ca56c8 16384 MyApp 1074 admin 39 PIPE 0x2ca5680 16384 MyApp 1074 admin 40 PIPE 0x2ca5638 16384 MyApp 1074 admin 41 PIPE 0x2ca55f0 16384 MyApp 1074 admin 42 PIPE 0x2ca55a8 16384 MyApp 1074 admin 43 PIPE 0x2ca5560 16384 ... MyApp 1074 admin 249 PIPE 0x38eeb00 16384 MyApp 1074 admin 250 PIPE 0x38eeab8 16384 MyApp 1074 admin 251 PIPE 0x38eea70 16384 MyApp 1074 admin 252 PIPE 0x38eea28 16384 MyApp 1074 admin 253 PIPE 0x38ee9e0 16384 MyApp 1074 admin 254 PIPE 0x38ee998 16384 After looking back at my code, it appears I forgot to deallocate the pipe except at the very end! Going to test this now, and perhaps this will fix my problem. Best regards, Chad From dunham at mac.com Sat Dec 8 16:51:07 2007 From: dunham at mac.com (David Dunham) Date: Sat Dec 8 16:51:12 2007 Subject: NSTableView of strings Message-ID: <5E279AF6-6503-4677-8824-88B318798FE2@mac.com> I'm trying to set up a list of strings, which the user can edit in an NSTableView. I can bind it to an NSArray which contains NSMutableStrings. This displays the list fine, but when I try to edit one of the strings, it fails. There doesn't seem to be a key that works to both read and write the value of an NSMutableString. There's a setString: but no string, for example. (Displaying works fine with no key at all.) I'm no Cocoa bindings guru, so I'm probably missing something. (The same window has a multi-column NSTableView which is bound to a more complex data structure. This works fine, because my data has setters and getters for each column.) David Dunham A Sharp, LLC Voice/Fax: 206 783 7404 http://a-sharp.com "People seem to misinterpret complexity as sophistication" -- Niklaus Wirth From cmhofman at gmail.com Sat Dec 8 17:00:18 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sat Dec 8 17:00:27 2007 Subject: NSTableView of strings In-Reply-To: <5E279AF6-6503-4677-8824-88B318798FE2@mac.com> References: <5E279AF6-6503-4677-8824-88B318798FE2@mac.com> Message-ID: It's exctly as you say: you cant use a NS(Mutable)String for mutable value binding. You have to wrap it in an object such as NSMutableDictionary. (Well you can define a -string accessor in an NSString category, but I wouldn't recommend it). Christiaan On 9 Dec 2007, at 1:51 AM, David Dunham wrote: > I'm trying to set up a list of strings, which the user can edit in > an NSTableView. I can bind it to an NSArray which contains > NSMutableStrings. This displays the list fine, but when I try to > edit one of the strings, it fails. There doesn't seem to be a key > that works to both read and write the value of an NSMutableString. > There's a setString: but no string, for example. (Displaying works > fine with no key at all.) > > I'm no Cocoa bindings guru, so I'm probably missing something. > > (The same window has a multi-column NSTableView which is bound to a > more complex data structure. This works fine, because my data has > setters and getters for each column.) > > David Dunham A Sharp, LLC > Voice/Fax: 206 783 7404 http://a-sharp.com > "People seem to misinterpret complexity as sophistication" -- > Niklaus Wirth > From cmh at mac.com Sun Dec 9 02:53:52 2007 From: cmh at mac.com (Chris Hanson) Date: Sun Dec 9 02:54:13 2007 Subject: NSTableView of strings In-Reply-To: <5E279AF6-6503-4677-8824-88B318798FE2@mac.com> References: <5E279AF6-6503-4677-8824-88B318798FE2@mac.com> Message-ID: On Dec 8, 2007, at 4:51 PM, David Dunham wrote: > I'm trying to set up a list of strings, which the user can edit in > an NSTableView. I can bind it to an NSArray which contains > NSMutableStrings. This displays the list fine, but when I try to > edit one of the strings, it fails. There doesn't seem to be a key > that works to both read and write the value of an NSMutableString. > There's a setString: but no string, for example. (Displaying works > fine with no key at all.) > > I'm no Cocoa bindings guru, so I'm probably missing something. > > (The same window has a multi-column NSTableView which is bound to a > more complex data structure. This works fine, because my data has > setters and getters for each column.) Think of it this way: A table view allows the user to interact with a collection of objects, one property per column. This is as true for your single-column table view as it is for your multi-column table view. Thus rather than trying to bind the table view directly to a collection of strings, you should bind it to a collection of objects that have some string property. -- Chris From cmhofman at gmail.com Sun Dec 9 03:53:52 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sun Dec 9 03:54:01 2007 Subject: Button in textfieldcell inside a table Message-ID: <76F055A1-871C-4C08-815B-96E2C24067D6@gmail.com> Hi all, I'm trying to get a button inside a text cell in a tableview working on Leopard. A bit like the little Store arrow buttons in iTunes. I was doing this by using an NSTextFieldCell subclass, overriding - drawRect: and -trackMouse:inRect:ofView:untilMouseUp:. This was working fine on Tiger. However on Leopard -trackMouse:... is not called anymore on a mouseDown:, so this approach completely fails. Does anyone on this list have an alternative for doing this, that works both on Tiger and Leopard? Thanks, Christiaan From cmhofman at gmail.com Sun Dec 9 04:10:57 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sun Dec 9 04:11:03 2007 Subject: Button in textfieldcell inside a table Message-ID: Hi all, I'm trying to get a button inside a text cell in a tableview working on Leopard. A bit like the little Store arrow buttons in iTunes. I was doing this by using an NSTextFieldCell subclass, overriding - drawRect: and -trackMouse:inRect:ofView:untilMouseUp:. This was working fine on Tiger. However on Leopard -trackMouse:... is not called anymore on a mouseDown:, so this approach completely fails. Does anyone on this list have an alternative for doing this, that works both on Tiger and Leopard? Thanks, Christiaan From florent.lacheroy at alwancolor.com Mon Dec 10 06:57:25 2007 From: florent.lacheroy at alwancolor.com (Florent Lacheroy) Date: Mon Dec 10 07:02:34 2007 Subject: NSObject - respondsToSelector: behavior has changed under Leopard Message-ID: <7C306F64-409D-4757-AA80-EF4CDBC279B0@alwancolor.com> Hi all, It seems behavior of the respondsToSelector: method of NSObject has changed. We have a code where the method responds "YES" under Tiger and "NO" under Leopard. Please see below a little extract from our code: - we have a "fake" NSBitmapImageRep subclass. It means it's a class derived from NSObject but that implements: - (Class)class { return [NSBitmapImageRep class]; } and: - (NSNumber *)sMaskNumber { .... } - in a NSBitmapImageRep category we have this method: - (NSString*)sMaskNumberString { NSString *smnString = @""; if([self respondsToSelector:@selector(sMaskNumber)]) { NSNumber *sMaskNumber = [self sMaskNumber]; if( sMaskNumber) { .... } } return smnString; } After putting a breakpoint in the "Class" method described above, it seems that now under Leopard, the respondsToSelector method is calling it which was not the case under Tiger. That means the respondsToSelector is now based on the instance's class and not anymore on the methods implemented by the current object in memory? Anyone can confirm? May be this new implementation can bring new limits? Best Regards, Florent Lacheroy Software Engineer Alwan Color Expertise From bbum at mac.com Mon Dec 10 08:53:12 2007 From: bbum at mac.com (Bill Bumgarner) Date: Mon Dec 10 08:53:34 2007 Subject: NSObject - respondsToSelector: behavior has changed under Leopard In-Reply-To: <7C306F64-409D-4757-AA80-EF4CDBC279B0@alwancolor.com> References: <7C306F64-409D-4757-AA80-EF4CDBC279B0@alwancolor.com> Message-ID: <3D3D80DF-DB8C-40AD-8949-49611AD67CC2@mac.com> On Dec 10, 2007, at 6:57 AM, Florent Lacheroy wrote: > It seems behavior of the respondsToSelector: method of NSObject has > changed. We have a code where the method responds "YES" under Tiger > and "NO" under Leopard. > > Please see below a little extract from our code: > > - we have a "fake" NSBitmapImageRep subclass. It means it's a class > derived from NSObject but that implements: > > - (Class)class > { > return [NSBitmapImageRep class]; > } Why are you doing this? -class really isn't intended to be overridden and is certainly not meant to change the class hierarchy. It doesn't make any sense. If you want to add a method to an existing class, use a category. Or use the runtime's API for this purpose. > - in a NSBitmapImageRep category we have this method: > > - (NSString*)sMaskNumberString > { > ... > if([self respondsToSelector:@selector(sMaskNumber)]) { > NSNumber *sMaskNumber = [self sMaskNumber]; > ... That it returned YES on Tiger and that the invocation of -sMaskNumber worked could be construed as a bug on Tiger. That Leopard returns NO is more correct. > That means the respondsToSelector is now based on the instance's > class and not anymore on the methods implemented by the current > object in memory? Anyone can confirm? May be this new implementation > can bring new limits? [self respondsToSelector:] has always been and certainly still is based on the instance's class. b.bum From kusterer at gmail.com Mon Dec 10 10:29:52 2007 From: kusterer at gmail.com (Uli Kusterer) Date: Mon Dec 10 10:30:02 2007 Subject: Broken missing prototypes warning in ObjC? In-Reply-To: References: Message-ID: <7858830A-531F-4C57-9283-A45CCC2B3ACC@gmail.com> On 05.09.2007, at 17:48, Uli Kusterer wrote: > I just encountered a strange problem: I tried to turn on all > warnings in one of my Cocoa projects, and I also turned on the > warning about missing function prototypes (not method, function). > Trouble is, now I get error messages for some functions where I > *know* that there are prototypes for them. I've tried everything to > get rid of these erroneous warnings. I copied the signature of the > function right above the implementation, put a semicolon after it, > and I still get the warning. > > Has anyone experienced that? I tried it on several Macs at work and > it happens everywhere there, but only in .m files, not in .c or .cpp > files. It happens in a fresh Objective C project, even. > > Has anyone heard of this before, or more importantly, found a fix > for this? It's a rather important warning, and I have a bunch of C > code that would really benefit from this warning. Alternately, does > anyone know whether there's a #pragma or so with which I can turn > off this warning in my ObjC files, so I can still leave it on for > the C and C++ code? For future reference, I found the solution and did a short blog posting about it: Cheers, -- M. Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras.de From ben at tanjero.com Tue Dec 11 13:58:38 2007 From: ben at tanjero.com (Benjamin Stiglitz) Date: Tue Dec 11 13:58:54 2007 Subject: Button in textfieldcell inside a table In-Reply-To: References: Message-ID: <9B17EE82-95CF-44C5-9E1E-81D62FE58FA7@tanjero.com> > I was doing this by using an NSTextFieldCell subclass, overriding - > drawRect: and -trackMouse:inRect:ofView:untilMouseUp:. This was > working fine on Tiger. However on Leopard -trackMouse:... is not > called anymore on a mouseDown:, so this approach completely fails. > > Does anyone on this list have an alternative for doing this, that > works both on Tiger and Leopard? On Leopard you can implement this delegate method to enable the cell tracking method to be called: - (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumnrow:(NSInteger)row See the NSTableView documentation: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableView_Class/Reference/Reference.html#/ /apple_ref/occ/instm/NSObject/ tableView:shouldTrackCell:forTableColumn:row: -Ben From cmhofman at gmail.com Tue Dec 11 14:38:35 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Tue Dec 11 14:38:50 2007 Subject: Button in textfieldcell inside a table (SOLVED) In-Reply-To: <9B17EE82-95CF-44C5-9E1E-81D62FE58FA7@tanjero.com> References: <9B17EE82-95CF-44C5-9E1E-81D62FE58FA7@tanjero.com> Message-ID: On 11 Dec 2007, at 10:58 PM, Benjamin Stiglitz wrote: >> I was doing this by using an NSTextFieldCell subclass, overriding - >> drawRect: and -trackMouse:inRect:ofView:untilMouseUp:. This was >> working fine on Tiger. However on Leopard -trackMouse:... is not >> called anymore on a mouseDown:, so this approach completely fails. >> >> Does anyone on this list have an alternative for doing this, that >> works both on Tiger and Leopard? > > On Leopard you can implement this delegate method to enable the > cell tracking method to be called: > - (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell > *)cell forTableColumn:(NSTableColumn *)tableColumnrow:(NSInteger)row > > See the NSTableView documentation: > http://developer.apple.com/documentation/Cocoa/Reference/ > ApplicationKit/Classes/NSTableView_Class/Reference/Reference.html#// > apple_ref/occ/instm/NSObject/ > tableView:shouldTrackCell:forTableColumn:row: > > -Ben That would not do what we want, as it contains only enough information to determine the cell, not the location in the cell (it should only track for the button inside the text cell). However we found that implementing -hitTestForEvent:inRect:ofView: in the NSTextFieldCell subclass does the trick. Christiaan From antti.karanta at napa.fi Thu Dec 13 23:32:19 2007 From: antti.karanta at napa.fi (Antti Karanta) Date: Thu Dec 13 23:34:34 2007 Subject: Finding out executable location from a c program Message-ID: <680FA370A36D83439E177BDC02F0E8B501CCF782@nw60.napa.fi> > -----Original Message----- > From: Alastair Houghton [mailto:alastair@alastairs-place.net] > > > Ok, I see your point - when in Rome, do as the Romans do. = ) > > :-) Yeah, sort of. Sorry, I was overly brief - I meant that as two separate things, i.e. I get your point and that as I am somewhat of a stranger here (in os-x programming, that is), I should do as the natives here do as they probably have a good reason for doing things a certain way. > I think my point was really that *not* trying to > find the executable path was an easier, safer and more portable > solution, and that there aren't really any disadvantages worth > mentioning Easier - definitely. Safer - ok, you've convinced me on this one. Thanks for that. More portable - between *nixes, yes, but in e.g. windows a hard coded path is rare - usually the installers let you choose where you want to install. On windows reading the location based on a registry entry might be more "native". Anyway, thanks for your input. I think I'll change the source so that according to a define given at compile time the executable will use either a "well known location" or lookup based on the executable location (as it's already implemented). But certainly you've convinced me that if (hopefully when) someone makes a package, it will contain the version w/ hard coded path. -Antti- From mikevann at gmail.com Tue Dec 18 00:18:04 2007 From: mikevann at gmail.com (mikevann) Date: Tue Dec 18 00:18:16 2007 Subject: CIFilter blur issues Message-ID: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> I'm doing a gaussian blur using Core Image (CIGaussianBlur). The problem I'm having is the edges are not being extended during the blur so all four edges fade into transparency. Is there a way to control how the CIGaussianBlur treats edges, such as kvImageEdgeExtend does for vImage convolves, or at least set the background color used for the blur? From sstevenson at mac.com Tue Dec 18 00:28:13 2007 From: sstevenson at mac.com (Scott Stevenson) Date: Tue Dec 18 00:28:16 2007 Subject: CIFilter blur issues In-Reply-To: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> References: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> Message-ID: On Dec 18, 2007, at 12:18 AM, mikevann wrote: > I'm doing a gaussian blur using Core Image (CIGaussianBlur). The > problem I'm having is the edges are not being extended during the > blur so all four edges fade into transparency. Is there a way to > control how the CIGaussianBlur treats edges, such as > kvImageEdgeExtend does for vImage convolves, or at least set the > background color used for the blur? The Core Image Filter Reference doesn't mention anything. Can you just manually increase the bounds of the image before blurring? - Scott From psarge at gmail.com Tue Dec 18 00:33:48 2007 From: psarge at gmail.com (Paul Sargent) Date: Tue Dec 18 00:34:02 2007 Subject: CIFilter blur issues In-Reply-To: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> References: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> Message-ID: <53FC53C0-2C35-4854-A7E2-12409F0A60CF@gmail.com> On 18 Dec 2007, at 08:18, mikevann wrote: > I'm doing a gaussian blur using Core Image (CIGaussianBlur). The > problem I'm having is the edges are not being extended during the > blur so all four edges fade into transparency. Is there a way to > control how the CIGaussianBlur treats edges, such as > kvImageEdgeExtend does for vImage convolves, or at least set the > background color used for the blur? I don't think so, as the edge behaviour is a property of the sampler. The code to create the sampler is inside the CIFilter, hence it is only modifiable if you write a custom filter. (That doesn't stop Quartz Composer doing it, so there's a method somewhere, but I don't think it's public) The only solution I've come up with (in theory) is to have another filter add a clamped edge to the image prior to blurring. From mikevann at gmail.com Tue Dec 18 00:40:27 2007 From: mikevann at gmail.com (mikevann) Date: Tue Dec 18 00:40:53 2007 Subject: CIFilter blur issues In-Reply-To: <53FC53C0-2C35-4854-A7E2-12409F0A60CF@gmail.com> References: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> <53FC53C0-2C35-4854-A7E2-12409F0A60CF@gmail.com> Message-ID: Thanks a lot for the clamping tip, this seems to solve my issue. On Dec 18, 2007, at 1:33 AM, Paul Sargent wrote: > On 18 Dec 2007, at 08:18, mikevann wrote: > >> I'm doing a gaussian blur using Core Image (CIGaussianBlur). The >> problem I'm having is the edges are not being extended during the >> blur so all four edges fade into transparency. Is there a way to >> control how the CIGaussianBlur treats edges, such as >> kvImageEdgeExtend does for vImage convolves, or at least set the >> background color used for the blur? > > I don't think so, as the edge behaviour is a property of the > sampler. The code to create the sampler is inside the CIFilter, > hence it is only modifiable if you write a custom filter. (That > doesn't stop Quartz Composer doing it, so there's a method > somewhere, but I don't think it's public) > > The only solution I've come up with (in theory) is to have another > filter add a clamped edge to the image prior to blurring. From cmhofman at gmail.com Tue Dec 18 02:18:21 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Tue Dec 18 02:18:30 2007 Subject: CIFilter blur issues In-Reply-To: <53FC53C0-2C35-4854-A7E2-12409F0A60CF@gmail.com> References: <2A78EF90-F83E-437D-B1EA-14EF7545B3A8@gmail.com> <53FC53C0-2C35-4854-A7E2-12409F0A60CF@gmail.com> Message-ID: Or a clip afterwards. Christiaan On 18 Dec 2007, at 9:33 AM, Paul Sargent wrote: > > On 18 Dec 2007, at 08:18, mikevann wrote: > >> I'm doing a gaussian blur using Core Image (CIGaussianBlur). The >> problem I'm having is the edges are not being extended during the >> blur so all four edges fade into transparency. Is there a way to >> control how the CIGaussianBlur treats edges, such as >> kvImageEdgeExtend does for vImage convolves, or at least set the >> background color used for the blur? > > I don't think so, as the edge behaviour is a property of the > sampler. The code to create the sampler is inside the CIFilter, > hence it is only modifiable if you write a custom filter. (That > doesn't stop Quartz Composer doing it, so there's a method > somewhere, but I don't think it's public) > > The only solution I've come up with (in theory) is to have another > filter add a clamped edge to the image prior to blurring. From ejstembler at ejse.com Tue Dec 18 10:56:56 2007 From: ejstembler at ejse.com (Edward J. Stembler) Date: Tue Dec 18 10:57:00 2007 Subject: Code signing question Message-ID: <4F6C2FED-5FAE-4BFF-8B3F-1F244DDDCFF2@ejse.com> I want to code sign a test app CodeSignTest.app and I'm not sure what I'm doing wrong. I was successfully able to import my company's Authenticode certificate (issued by VeriSign) into the System keychain. I set it to "Always Trust" for code signing. When using the codesign command-line in Terminal, I'm not sure what to enter as the identity for the -s flag. Is it supposed to be the certificate common name? The common name of this certificate is actually the name of my company. I've tried several combinations of: codesign -s "MyCompany, Inc." CodeSignTest.app MyCompany, Inc.: no such identity I've tried it without the quotes and even with a backslash before the space, but none worked. Anyone have any idea what I'm doing wrong? From dunham at mac.com Tue Dec 18 11:21:40 2007 From: dunham at mac.com (David Dunham) Date: Tue Dec 18 11:21:58 2007 Subject: Code signing question In-Reply-To: <4F6C2FED-5FAE-4BFF-8B3F-1F244DDDCFF2@ejse.com> References: <4F6C2FED-5FAE-4BFF-8B3F-1F244DDDCFF2@ejse.com> Message-ID: <9656F192-4283-4955-9452-A9AF8FD404FA@mac.com> On 18 Dec 2007, at 10:56, Edward J. Stembler wrote: > I want to code sign a test app CodeSignTest.app and I'm not sure > what I'm doing wrong. > > I was successfully able to import my company's Authenticode > certificate (issued by VeriSign) into the System keychain. I set > it to "Always Trust" for code signing. > > When using the codesign command-line in Terminal, I'm not sure what > to enter as the identity for the -s flag. Is it supposed to be the > certificate common name? The common name of this certificate is > actually the name of my company. I've tried several combinations of: > > codesign -s "MyCompany, Inc." CodeSignTest.app > MyCompany, Inc.: no such identity I use codesign --sign "GameHouse, Inc." "${BUILT_PRODUCTS_DIR}"/"$ {FULL_PRODUCT_NAME}" where "GamHouse, Inc." is the name of the VeriSign-issued certificate in my keychain. So maybe you need to import it into your keychain, not the system? (I imported a .pfx file if I recall correctly.) David Dunham Macintosh Game Developer GameHouse Studios +1 206 926 5722 www.gamehouse.com "They said it couldn't be done but sometimes it doesn't work out that way." -- Casey Stengel From ejstembler at ejse.com Tue Dec 18 14:27:12 2007 From: ejstembler at ejse.com (Edward J. Stembler) Date: Tue Dec 18 14:27:17 2007 Subject: Code signing question In-Reply-To: <20071218200005.E6D18A4032@forums.omnigroup.com> References: <20071218200005.E6D18A4032@forums.omnigroup.com> Message-ID: I imported my certificate from a .p7b file. When I created a sample self-signed root certificate -- which worked -- I noticed the private key is part of the certificate in the keychain. My imported Authenticode certificate doesn't show a private key in the keychain. I know on the Windows side, the private key was stored in a separate (binary) file; something like: myprivatekey.pvk. In any case, I have en e-mail out to VeriSign to see if they have any guidance or instructions... On Dec 18, 2007, at 11:21 AM, David Dunham wrote: > I use > > codesign --sign "GameHouse, Inc." "${BUILT_PRODUCTS_DIR}"/"$ > {FULL_PRODUCT_NAME}" > > where "GamHouse, Inc." is the name of the VeriSign-issued certificate > in my keychain. So maybe you need to import it into your keychain, > not the system? (I imported a .pfx file if I recall correctly.) > > David Dunham Macintosh Game Developer > GameHouse Studios +1 206 926 5722 www.gamehouse.com > "They said it couldn't be done but sometimes it doesn't > work out that way." -- Casey Stengel From dunham at mac.com Tue Dec 18 17:21:06 2007 From: dunham at mac.com (David Dunham) Date: Tue Dec 18 17:21:12 2007 Subject: Code signing question In-Reply-To: References: <20071218200005.E6D18A4032@forums.omnigroup.com> Message-ID: <87852738-BC39-42C6-B2EF-6FBF4C2FEA76@mac.com> On 18 Dec 2007, at 14:27, Edward J. Stembler wrote: > I imported my certificate from a .p7b file. > > When I created a sample self-signed root certificate -- which > worked -- I noticed the private key is part of the certificate in > the keychain. My imported Authenticode certificate doesn't show a > private key in the keychain. I know on the Windows side, the > private key was stored in a separate (binary) file; something > like: myprivatekey.pvk. I have a self-signing root certificate as well; I ended up with certificate, public key, and private key in my keychain. I just noticed a "PvkTmp..." private key. It's possible this is from myprivatekey.pvk. I don't know where those files came from in the first place. David Dunham Macintosh Game Developer GameHouse Studios +1 206 926 5722 www.gamehouse.com "They said it couldn't be done but sometimes it doesn't work out that way." -- Casey Stengel From ott.tammepuu at skype.net Wed Dec 19 02:44:26 2007 From: ott.tammepuu at skype.net (Mihkel Tammepuu) Date: Wed Dec 19 03:13:38 2007 Subject: Code signing question In-Reply-To: References: <20071218200005.E6D18A4032@forums.omnigroup.com> Message-ID: At 5:27 PM -0500 12/18/07, Edward J. Stembler wrote: >I imported my certificate from a .p7b file. > >When I created a sample self-signed root certificate -- which worked >-- I noticed the private key is part of the certificate in the >keychain. My imported Authenticode certificate doesn't show a >private key in the keychain. I know on the Windows side, the >private key was stored in a separate (binary) file; something like: >myprivatekey.pvk. > >In any case, I have en e-mail out to VeriSign to see if they have >any guidance or instructions... > Indeed, you must have private key and public key, and they should look similar to what you get by creating self signed root cert. It is very important - that the certificate is intended for use for codesigning i.e. it must contain Extensions like: Extension Key Usage Usage Digital Signature Extension Extended Key Usage Purpose #1 Code Signing when viewed in Keychain Access If these extensions are not present then codesign does not recognize the identity, you have to request a new certificate from your CA or switch to another CA if they are not able to generate a proper one. // Mihkel Tammepuu Skype -- From ozone at algorithm.com.au Wed Dec 19 04:28:34 2007 From: ozone at algorithm.com.au (=?ISO-8859-1?Q?Andr=E9_Pang?=) Date: Wed Dec 19 04:28:38 2007 Subject: Archive directory (multiple directory hard links) API In-Reply-To: <22C9185E-E8D3-4C7A-9ADC-43A44D2A37FB@algorithm.com.au> References: <22C9185E-E8D3-4C7A-9ADC-43A44D2A37FB@algorithm.com.au> Message-ID: <90F80699-1BC6-473B-A5B6-76B5C4239F3A@algorithm.com.au> On 19/12/2007, at 11:08 PM, Andr? Pang wrote: > I'm been wondering how to create an "archive directory" (i.e. create > multiple hard links to a directory) on Leopard. Does anyone know of > the proper API calls to do this? Nevermind, I found this exchange between Rosyna and JKH about 30 seconds after I posted to the list: http://lists.apple.com/archives/darwin-dev/2007/Dec/msg00033.html which implies that directory hard links are for the exclusive use of Time Machine. Ah well, better to be safe than sorry :). -- % Andre Pang : trust.in.love.to.save From ozone at algorithm.com.au Wed Dec 19 04:08:23 2007 From: ozone at algorithm.com.au (=?ISO-8859-1?Q?Andr=E9_Pang?=) Date: Wed Dec 19 04:33:37 2007 Subject: Archive directory (multiple directory hard links) API Message-ID: <22C9185E-E8D3-4C7A-9ADC-43A44D2A37FB@algorithm.com.au> Hi all, I'm been wondering how to create an "archive directory" (i.e. create multiple hard links to a directory) on Leopard. Does anyone know of the proper API calls to do this? Thanks, Andre. -- % Andre Pang : trust.in.love.to.save From edenwaith at mac.com Wed Dec 19 19:09:18 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Wed Dec 19 19:09:11 2007 Subject: Compiling for Mac OS 10.2 on Leopard & Intel In-Reply-To: <20071219200530.741A3A4BB8@forums.omnigroup.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> Message-ID: <6F90B8FA-98B6-456F-BF52-4AD387951C18@mac.com> Hello: I'm working on a long-standing project that currently works as far back as Mac OS 10.2. Is it possible to compile a program on Leopard and an Intel-based Mac that can also run on Mac OS 10.2? My current tests allow me to run the currently compiled program as far back as Mac OS 10.3.9. But when I ran a test on 10.2, the icon was the "generic application" icon, and it would not start properly. Regards, Chad Armstrong From edenwaith at mac.com Wed Dec 19 19:25:41 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Wed Dec 19 19:25:35 2007 Subject: Saving license files In-Reply-To: <20071219200530.741A3A4BB8@forums.omnigroup.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> Message-ID: <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Hello: I'm currently trying to implement a licensing solution into one of my applications, and I have some questions about certain implementation and the best way to store the license information. During the day I work with a number of computers (Windows and Macs), which includes installing and configuring software. In the Windows world, it generally seems that once a piece of software has been installed and registered on a machine, anyone can launch the program. However, on the Mac-side of things, I've been noticing that not all programs work this way, and they will only be registered for the one user who entered in the registration info. This is not for all applications, though. Any suggestions on what would be a good method on saving license/ registration info? I'm leaning towards saving a license file in / Library/Application Support/MyProduct/. Can anyone (including Standard users) save to that location, or should there be a back-up method that should just save a copy to their Home ~/Library/ Application Support/MyProduct/, just in case? Granted, I imagine that a lot of computers have just one user, but in some cases (say, a family computer where each person has their own account), there might be multiple users, and each person might want to use a particular application, but it can get pretty annoying after awhile to have to register the application for each and every user. Regards, Chad Armstrong From sstevenson at mac.com Wed Dec 19 21:28:12 2007 From: sstevenson at mac.com (Scott Stevenson) Date: Wed Dec 19 21:28:18 2007 Subject: Saving license files In-Reply-To: <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Message-ID: On Dec 19, 2007, at 7:25 PM, Chad Armstrong wrote: > I'm leaning towards saving a license file in /Library/Application > Support/MyProduct/. Can anyone (including Standard users) save to > that location, or should there be a back-up method that should just > save a copy to their Home ~/Library/Application Support/MyProduct/, > just in case? I believe only admin users can write to /Library. The most correct thing is probably to just save in the home directory. If that's totally unworkable, you could also use ~Shared, but this should really be a last resort. I think it's bad form. - Scott From macosxdevlist at personal.fishh2o.com Wed Dec 19 21:48:43 2007 From: macosxdevlist at personal.fishh2o.com (SD) Date: Wed Dec 19 21:50:09 2007 Subject: Saving license files In-Reply-To: <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Message-ID: You should write to /Library/Application Support and ask for admin privs when needed and set the permissions correctly. -- ========================================== SD WARNING: Programming may be habit forming. From mah at jump-ing.de Wed Dec 19 22:56:15 2007 From: mah at jump-ing.de (Markus Hitter) Date: Wed Dec 19 22:56:21 2007 Subject: Compiling for Mac OS 10.2 on Leopard & Intel In-Reply-To: <6F90B8FA-98B6-456F-BF52-4AD387951C18@mac.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <6F90B8FA-98B6-456F-BF52-4AD387951C18@mac.com> Message-ID: Am 20.12.2007 um 04:09 schrieb Chad Armstrong: > Is it possible to compile a program on Leopard and an Intel-based > Mac that can also run on Mac OS 10.2? You want to use the 10.2 SDK which comes with Xcode 2.5. In principle, it should be possible to integrate the 10.2 SDK into Xcode 3, but this is "unsupported". Markus - - - - - - - - - - - - - - - - - - - Dipl. Ing. Markus Hitter http://www.jump-ing.de/ From dunham at mac.com Wed Dec 19 23:17:43 2007 From: dunham at mac.com (David Dunham) Date: Wed Dec 19 23:17:48 2007 Subject: Saving license files In-Reply-To: <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Message-ID: On 19 Dec 2007, at 19:25, Chad Armstrong wrote: > I'm leaning towards saving a license file in /Library/Application > Support/MyProduct/. Can anyone (including Standard users) save to > that location, or should there be a back-up method that should just > save a copy to their Home ~/Library/Application Support/MyProduct/, > just in case? Only admin users can write there. Allowing an admin to register for the entire machine, or a user to register themselves, seems like a good solution. (I haven't gotten around to this myself...) David Dunham A Sharp, LLC Voice/Fax: 206 783 7404 http://a-sharp.com "People seem to misinterpret complexity as sophistication" -- Niklaus Wirth From tmyers at itainc.com Thu Dec 20 06:42:43 2007 From: tmyers at itainc.com (Thomas Myers) Date: Thu Dec 20 07:14:38 2007 Subject: Saving license files In-Reply-To: References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Message-ID: I found a >I'm leaning towards saving a license file in /Library/Application >Support/MyProduct/. Can anyone (including Standard users) save to >that location, or should there be a back-up method that should just >save a copy to their Home ~/Library/Application Support/MyProduct/, >just in case? I found an apple tech note saying this path. /Users/Shared/Library/Preferences. This location was recommended by Apple Sample code. http://developer.apple.com/samplecode/CFPrefTopScores/ CFPreferences by design only allows write access to the kCFPreferencesAnyUser domain by a user with admin privileges. But occasionally developers have had the need to store user preferences that are both readable and writable by all users (without authorization). Currently the only location that meets this requirement is the directory. This sample demonstrates how to use Core Foundation API's to access (globally readable and writable) preferences in this location. -- Thomas Myers - ITA,Inc. (585)889-9119 5 Wood Sorrel mailto:tmyers@itainc.com Rochester, NY 14624 http://www.itainc.com C/C++, Photoshop Plug-Ins, Filemaker, Filemaker Plug-ins, Visual Basic, Real Basic, SCSI, Firewire, USB, Applescript, XML, TWAIN, Quicktime, Mac/Win cross platform solutions. From clarkcox3 at gmail.com Thu Dec 20 14:06:29 2007 From: clarkcox3 at gmail.com (Clark Cox) Date: Thu Dec 20 14:06:34 2007 Subject: Saving license files In-Reply-To: <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> References: <20071219200530.741A3A4BB8@forums.omnigroup.com> <73ABDD30-F597-4677-9F90-3E0375644497@mac.com> Message-ID: On Dec 19, 2007 10:25 PM, Chad Armstrong wrote: > Any suggestions on what would be a good method on saving license/ > registration info? I'm leaning towards saving a license file in / > Library/Application Support/MyProduct/. Can anyone (including > Standard users) save to that location, or should there be a back-up > method that should just save a copy to their Home ~/Library/ > Application Support/MyProduct/, just in case? Everyone can *read* /Library, but only admin users can *write* there. My recommendation: 1) Give the user the choice of "Register for all users on this Mac" and "Register for me only" 2) If they choose "for all users", then save the registration under "/Library" (asking for admin credentials if required), and if not, save the information under "~/Library". 3) Then, when your program looks for the saved registration information, just use the standard search paths provided by NSSearchPathForDirectoriesInDomains, and use the first one encountered. > Granted, I imagine that a lot of computers have just one user, but in > some cases (say, a family computer where each person has their own > account), there might be multiple users, and each person might want to > use a particular application, but it can get pretty annoying after > awhile to have to register the application for each and every user. In this situation, an admin user (Mom, Dad, a Lab administrator, etc.) would register it once, choosing to register it for all users, and nobody else will ever be asked for registration information. -- Clark S. Cox III clarkcox3@gmail.com From eckert.julius at googlemail.com Sun Dec 23 14:29:35 2007 From: eckert.julius at googlemail.com (Julius Eckert) Date: Sun Dec 23 14:29:38 2007 Subject: Setting MouseCursor Message-ID: <54533ca90712231429l42c54840tf6c89cb0006916f8@mail.gmail.com> Hi, i am doing a code to control the mouse by the iSight cam. Currently I am using CGWarpMouseCursorPosition(CGPoint) function to set the position of the mouse. But this method is a bit buggy because moving windows is just shown at the end of the moving action, instead of the normal behaviour that the window moves with the mouse. What is the correct way to do this (there must be a better way because iChat's - Screensharing - Tool can control the mouse perfectly). I also want to emulate clicks and scrolling actions of the mouse. How can I do that ? Thanks in advance From mepard at mac.com Sun Dec 23 15:24:18 2007 From: mepard at mac.com (Marc Epard) Date: Sun Dec 23 15:24:25 2007 Subject: Setting MouseCursor In-Reply-To: <54533ca90712231429l42c54840tf6c89cb0006916f8@mail.gmail.com> References: <54533ca90712231429l42c54840tf6c89cb0006916f8@mail.gmail.com> Message-ID: <6C41CFC4-816B-4E12-9312-790D61C8AB70@mac.com> On Dec 23, 2007, at 4:29 PM, Julius Eckert wrote: > i am doing a code to control the mouse by the iSight cam. > Currently I am using CGWarpMouseCursorPosition(CGPoint) function to > set the > position of the mouse. > But this method is a bit buggy.... > > What is the correct way to do this (there must be a better way because > iChat's - Screensharing - Tool can control the mouse perfectly). > I also want to emulate clicks and scrolling actions of the mouse. > How can I do that ? If you can require Tiger or newer, take a look at CGEvent.h. Pre- Tiger, use CGPostMouseEvent to move the mouse as well as post clicks. -Marc From dunham at mac.com Sun Dec 23 16:27:09 2007 From: dunham at mac.com (David Dunham) Date: Sun Dec 23 16:27:14 2007 Subject: globals and debugging In-Reply-To: References: <16208FD2-D054-4A11-B35A-B6C270D09DF2@mac.com> <5CB8FA1E-4689-4AE1-AF97-C2BEC209EBE1@apple.com> <6EA9C2FE-413B-4BD1-A58F-827552C0FD53@mac.com> <9069484C-3DCD-4DDC-B38D-21CC81BD9CE8@mac.com> Message-ID: <4C9CB9DD-11CE-4666-9933-6ECDB9FA5522@mac.com> On 23 Dec 2007, at 14:05, perry7@mac.com wrote: >> Yes, there's a Globals in older Xcode versions. Wasn't it the Debug >> menu? > > found it, its in a sub-menu. > > it opened an empty window, allowing me to type in the name of my > desired global wich is 'g' (quite sure i did not mistype it) hit > 'enter' > serveral times and ways, but nothing seems to happen, hmmm First, reply to the list -- other people probably remember this stuff better than I. Second, you almost certainly have to first pick your application as a "library." You'll then get a list of all your globals. David Dunham A Sharp, LLC Voice/Fax: 206 783 7404 http://a-sharp.com "People seem to misinterpret complexity as sophistication" -- Niklaus Wirth From mikevann at gmail.com Fri Dec 28 09:50:13 2007 From: mikevann at gmail.com (mikevann) Date: Fri Dec 28 09:50:19 2007 Subject: Drawing CGLayer into OpenGL view Message-ID: Is there a better way of drawing a CGLayer to an NSOpenGLView than making a CIImage from it and drawing to the OpenGL view's CIContext? I can't help but think there's some conversion overhead going from CGLayer to CIImage (is there?). From Aya at animes.de Fri Dec 28 17:46:26 2007 From: Aya at animes.de (Aya Koshigaya) Date: Fri Dec 28 18:16:53 2007 Subject: How to load a text-resource from a bundle (Plugin) Message-ID: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> Hi, I have developed a plugin for Autodesk Maya for Windows. I now want to port this plugin to OSX.. and here i have some problems :( I opened one of the Maya-ExamplePlugins in xCode and then just replaced all the files with my own. So far, no problem.. but I'm using some resources that I included to my plugin. In Windows I used the WinAPI functions "FindResource" and "LoadResource".. and here's the problem, I have no idea how to port this to osx. In xCode I added my Resource (It's a textfile "data.txt") and put it in the Resources-Folder so it will be copied to the bundle when building. I now tried to load the file via Cocoa: NSString *nsResource = [[NSBundle mainBundle]pathForResource:@"data" ofType:@"txt"]; But the resource wasn't found, I found out, the problem is "mainBundle" is the Maya-Bundle, not my plugin... After this I tried to find my bundle, but with no result.. :( When I use this: [NSBundle bundleForClass:[self class]]; I get a compile-error that says "self is undeclared", because my plugin is still written in C, not ObjC... and I'm using the ObjC functions inside my normal C-functions = no self. Next try was: [NSBundle bundleWithIdentifier:@"de.koshigaya.test"]; the result was NULL.. no bundle with this identifier was found :( As last thing I tried to list ALL bundles and see if my own one is found with this: NSArray *bundles = [NSBundle allBundles]; for (int i = 0; i < [bundles count]; i++) { NSBundle *b = [bundles objectAtIndex:i]; NSString *vident = [b bundleIdentifier]; printOut([vident UTF8String]); } and... It only listed ONE bundle.. the same as "mainBundle".. -> com.alias.Maya.2008 So... no I have no idea what to do more.. I'm totally helpless.. Maybe Maya isn't realy "loading" my Bundle..? I mean, maybe Maya uses a way to load the bundle so it's not registered or something.. don't know.. :/ Does anyone know what I can do? Help... Kind regards, Aya From cmhofman at gmail.com Sat Dec 29 03:32:03 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sat Dec 29 03:32:12 2007 Subject: How to load a text-resource from a bundle (Plugin) In-Reply-To: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> References: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> Message-ID: On 29 Dec 2007, at 2:46 AM, Aya Koshigaya wrote: > Hi, > > I have developed a plugin for Autodesk Maya for Windows. I now want > to port this plugin to OSX.. and here i have some problems :( > > I opened one of the Maya-ExamplePlugins in xCode and then just > replaced all the files with my own. So far, no problem.. but I'm > using some resources that I included to my plugin. > > In Windows I used the WinAPI functions "FindResource" and > "LoadResource".. and here's the problem, I have no idea how to port > this to osx. > > In xCode I added my Resource (It's a textfile "data.txt") and put > it in the Resources-Folder so it will be copied to the bundle when > building. > > I now tried to load the file via Cocoa: > NSString *nsResource = [[NSBundle mainBundle] > pathForResource:@"data" ofType:@"txt"]; > > But the resource wasn't found, I found out, the problem is > "mainBundle" is the Maya-Bundle, not my plugin... > > > After this I tried to find my bundle, but with no result.. :( > When I use this: > [NSBundle bundleForClass:[self class]]; > > I get a compile-error that says "self is undeclared", because my > plugin is still written in C, not ObjC... and I'm using the ObjC > functions inside my normal C-functions = no self. > > Next try was: > [NSBundle bundleWithIdentifier:@"de.koshigaya.test"]; > > the result was NULL.. no bundle with this identifier was found :( > > As last thing I tried to list ALL bundles and see if my own one is > found with this: > > NSArray *bundles = [NSBundle allBundles]; > for (int i = 0; i < [bundles count]; i++) { > NSBundle *b = [bundles objectAtIndex:i]; > NSString *vident = [b bundleIdentifier]; > printOut([vident UTF8String]); > } > > and... It only listed ONE bundle.. the same as "mainBundle".. -> > com.alias.Maya.2008 > > So... no I have no idea what to do more.. I'm totally helpless.. > Maybe Maya isn't realy "loading" my Bundle..? I mean, maybe Maya > uses a way to load the bundle so it's not registered or something.. > don't know.. :/ > > Does anyone know what I can do? Help... > > Kind regards, > Aya +[NSBundle mainBundle] gives you the bundle of the app in which your plugin is loaded, so that indeed won't work. You should use either + [NSBundle bundleWithIdentifier:] or +[NSBundle bundleForClass:] to get the bundle of your plugin. Christiaan From Aya at animes.de Sat Dec 29 07:28:39 2007 From: Aya at animes.de (Aya Koshigaya) Date: Sat Dec 29 12:06:17 2007 Subject: How to load a text-resource from a bundle (Plugin) In-Reply-To: <09E95729-4E4E-4ABD-9AD0-013A4720EF30@free.fr> References: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> <09E95729-4E4E-4ABD-9AD0-013A4720EF30@free.fr> Message-ID: Hi, thanks for your answers :) > You might want to retry using the > [NSBundle bundleForClass:NSClassFromString(@"YourClassName")] And what should I use as ClassName? I don't have any ObjC Classes.. only normal C-Classes.. can I use these too? > +[NSBundle mainBundle] gives you the bundle of the app in which your > plugin is loaded, so that indeed won't work. You should use either + > [NSBundle bundleWithIdentifier:] or +[NSBundle bundleForClass:] to > get the bundle of your plugin. I tried these two allready,both weren't working for me (see the original mail, there I said why I had problems with these two) Regards, Aya On Dec 29, 2007, at 11:46, scott little wrote: > Aya, > > You might want to retry using the > > [NSBundle bundleForClass:NSClassFromString(@"YourClassName")] > > This might work for you, > > scott > -- > ?To announce there must be no criticism of the President, and to > stand by the President, right or wrong, is not only unpatriotic and > servile, it is morally treasonous to the American public.? > President Theodore Roosevelt > -- > scott little > slittle@free.fr > -- > sadly no music right now: iTunes is Stopped > > > > On 29/12/2007, at 02:46, Aya Koshigaya wrote: > >> Hi, >> >> I have developed a plugin for Autodesk Maya for Windows. I now want >> to port this plugin to OSX.. and here i have some problems :( >> >> I opened one of the Maya-ExamplePlugins in xCode and then just >> replaced all the files with my own. So far, no problem.. but I'm >> using some resources that I included to my plugin. >> >> In Windows I used the WinAPI functions "FindResource" and >> "LoadResource".. and here's the problem, I have no idea how to port >> this to osx. >> >> In xCode I added my Resource (It's a textfile "data.txt") and put >> it in the Resources-Folder so it will be copied to the bundle when >> building. >> >> I now tried to load the file via Cocoa: >> NSString *nsResource = [[NSBundle >> mainBundle]pathForResource:@"data" ofType:@"txt"]; >> >> But the resource wasn't found, I found out, the problem is >> "mainBundle" is the Maya-Bundle, not my plugin... >> >> >> After this I tried to find my bundle, but with no result.. :( >> When I use this: >> [NSBundle bundleForClass:[self class]]; >> >> I get a compile-error that says "self is undeclared", because my >> plugin is still written in C, not ObjC... and I'm using the ObjC >> functions inside my normal C-functions = no self. >> >> Next try was: >> [NSBundle bundleWithIdentifier:@"de.koshigaya.test"]; >> >> the result was NULL.. no bundle with this identifier was found :( >> >> As last thing I tried to list ALL bundles and see if my own one is >> found with this: >> >> NSArray *bundles = [NSBundle allBundles]; >> for (int i = 0; i < [bundles count]; i++) { >> NSBundle *b = [bundles objectAtIndex:i]; >> NSString *vident = [b bundleIdentifier]; >> printOut([vident UTF8String]); >> } >> >> and... It only listed ONE bundle.. the same as "mainBundle".. -> >> com.alias.Maya.2008 >> >> So... no I have no idea what to do more.. I'm totally helpless.. >> Maybe Maya isn't realy "loading" my Bundle..? I mean, maybe Maya >> uses a way to load the bundle so it's not registered or something.. >> don't know.. :/ >> >> Does anyone know what I can do? Help... >> >> Kind regards, >> Aya >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev >> > From cmhofman at gmail.com Sat Dec 29 12:19:50 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sat Dec 29 12:19:59 2007 Subject: How to load a text-resource from a bundle (Plugin) In-Reply-To: References: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> <09E95729-4E4E-4ABD-9AD0-013A4720EF30@free.fr> Message-ID: <65FF7A15-8733-4352-ADE9-DF96380B9184@gmail.com> So does your bundle have the proper layout for a macosx bundle, including the identifier in the info.plist? Christiaan On 29 Dec 2007, at 4:28 PM, Aya Koshigaya wrote: > Hi, > > thanks for your answers :) > >> You might want to retry using the >> [NSBundle bundleForClass:NSClassFromString(@"YourClassName")] > > > And what should I use as ClassName? I don't have any ObjC Classes.. > only normal C-Classes.. can I use these too? > > >> +[NSBundle mainBundle] gives you the bundle of the app in which >> your plugin is loaded, so that indeed won't work. You should use >> either +[NSBundle bundleWithIdentifier:] or +[NSBundle >> bundleForClass:] to get the bundle of your plugin. > > > I tried these two allready,both weren't working for me (see the > original mail, there I said why I had problems with these two) > > Regards, > Aya > > > On Dec 29, 2007, at 11:46, scott little wrote: > >> Aya, >> >> You might want to retry using the >> >> [NSBundle bundleForClass:NSClassFromString(@"YourClassName")] >> >> This might work for you, >> >> scott >> -- >> ?To announce there must be no criticism of the President, and to >> stand by the President, right or wrong, is not only unpatriotic >> and servile, it is morally treasonous to the American public.? >> President Theodore Roosevelt >> -- >> scott little >> slittle@free.fr >> -- >> sadly no music right now: iTunes is Stopped >> >> >> >> On 29/12/2007, at 02:46, Aya Koshigaya wrote: >> >>> Hi, >>> >>> I have developed a plugin for Autodesk Maya for Windows. I now >>> want to port this plugin to OSX.. and here i have some problems :( >>> >>> I opened one of the Maya-ExamplePlugins in xCode and then just >>> replaced all the files with my own. So far, no problem.. but I'm >>> using some resources that I included to my plugin. >>> >>> In Windows I used the WinAPI functions "FindResource" and >>> "LoadResource".. and here's the problem, I have no idea how to >>> port this to osx. >>> >>> In xCode I added my Resource (It's a textfile "data.txt") and put >>> it in the Resources-Folder so it will be copied to the bundle >>> when building. >>> >>> I now tried to load the file via Cocoa: >>> NSString *nsResource = [[NSBundle mainBundle] >>> pathForResource:@"data" ofType:@"txt"]; >>> >>> But the resource wasn't found, I found out, the problem is >>> "mainBundle" is the Maya-Bundle, not my plugin... >>> >>> >>> After this I tried to find my bundle, but with no result.. :( >>> When I use this: >>> [NSBundle bundleForClass:[self class]]; >>> >>> I get a compile-error that says "self is undeclared", because my >>> plugin is still written in C, not ObjC... and I'm using the ObjC >>> functions inside my normal C-functions = no self. >>> >>> Next try was: >>> [NSBundle bundleWithIdentifier:@"de.koshigaya.test"]; >>> >>> the result was NULL.. no bundle with this identifier was found :( >>> >>> As last thing I tried to list ALL bundles and see if my own one >>> is found with this: >>> >>> NSArray *bundles = [NSBundle allBundles]; >>> for (int i = 0; i < [bundles count]; i++) { >>> NSBundle *b = [bundles objectAtIndex:i]; >>> NSString *vident = [b bundleIdentifier]; >>> printOut([vident UTF8String]); >>> } >>> >>> and... It only listed ONE bundle.. the same as "mainBundle".. -> >>> com.alias.Maya.2008 >>> >>> So... no I have no idea what to do more.. I'm totally helpless.. >>> Maybe Maya isn't realy "loading" my Bundle..? I mean, maybe Maya >>> uses a way to load the bundle so it's not registered or >>> something.. don't know.. :/ >>> >>> Does anyone know what I can do? Help... >>> >>> Kind regards, >>> Aya >>> _______________________________________________ >>> MacOSX-dev mailing list >>> MacOSX-dev@omnigroup.com >>> http://www.omnigroup.com/mailman/listinfo/macosx-dev >>> >> > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From me at infinite-labs.net Sat Dec 29 13:51:01 2007 From: me at infinite-labs.net (=?UTF-8?B?4oie?=) Date: Sat Dec 29 13:51:08 2007 Subject: How to load a text-resource from a bundle (Plugin) In-Reply-To: References: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> <09E95729-4E4E-4ABD-9AD0-013A4720EF30@free.fr> Message-ID: Il giorno 29/dic/07, alle ore 16:28, Aya Koshigaya ha scritto: > And what should I use as ClassName? I don't have any ObjC Classes.. > only normal C-Classes.. can I use these too? This confuses me greatly, as C does not have classes. Maybe you're referring to C++? Anyway, if your bundle has an identifier set correctly in Info.plist, you can use [NSBundle bundleWithIdentifier:@"identifier"] to retrieve a NSBundle object for it. You should see , which explains most of it (the relevant key is CFBundleIdentifier). - ? From seaside.ki at mac.com Sun Dec 30 11:11:13 2007 From: seaside.ki at mac.com (Stefan) Date: Sun Dec 30 11:11:23 2007 Subject: Pre-10.5 equivalent of 'WebVeiw :: - (NSString *)mainFrameURL' Message-ID: <63B120BC-45D6-451F-AF80-ECCBDD004722@mac.com> Hi, didn't use Cocoa for some time. Thus, here is a simple question... I need a pre-10.5 equivalent of WebView's - (NSString *)mainFrameURL API docs explain, that this method is functional equivalent to [[webView mainFrame] loadRequest:] But, obviously, it is not. Thx, stefan From cmhofman at gmail.com Sun Dec 30 11:15:27 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sun Dec 30 11:15:36 2007 Subject: Pre-10.5 equivalent of 'WebVeiw :: - (NSString *)mainFrameURL' In-Reply-To: <63B120BC-45D6-451F-AF80-ECCBDD004722@mac.com> References: <63B120BC-45D6-451F-AF80-ECCBDD004722@mac.com> Message-ID: <32571A91-5442-49A9-8F3B-FFFBCE20ABD1@gmail.com> [[[[webView mainFrame] dataSource] request] URL] Christiaan On 30 Dec 2007, at 8:11 PM, Stefan wrote: > Hi, > > didn't use Cocoa for some time. Thus, here is a simple question... > > I need a pre-10.5 equivalent of WebView's > > - (NSString *)mainFrameURL > > API docs explain, that this method is functional equivalent to > > [[webView mainFrame] loadRequest:] > > But, obviously, it is not. > > Thx, > > stefan > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev