Re: Excessive open gui graphics files on Mavericks
when all you have is a rocket launcher, every problem looks like rocket bait. -- On 9 Apr, 2014, at 0:52, Maxthon Chan xcvi...@me.com wrote: LOL I actually used cramfs once in a game carried the rules database. The rules are so complicated so I tried to make it smaller without sacrificing the efficiency of the game code. Ended up using cramfs for that. On Apr 9, 2014, at 15:49, Charles Srstka cocoa...@charlessoft.com wrote: On Apr 9, 2014, at 2:20 AM, Maxthon Chan xcvi...@me.com wrote: I’d recommend cramfs as it is a real filesystem that is optimised to be expanded in-memory. Not complicated enough. I'd recommend encrypting the whole thing with an AES-256 key which is encrypted using elliptical-curve cryptography, and stuff it into a disk image (NDIF, ADC compression) and compress that using zlib, LZMA, and the old PKZIP Implode algorithm. Then, encode the resulting bytes by finding the first offset at which each digit occurs in the decimal representation of pi, then encode the octal representation of those numbers in EBCDIC format, then compress it again and encode the resulting bytes as offsets into an Ogg Vorbis recording of the soundtrack to Star Trek V: The Final Frontier. Because why the hell not? Charles ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: FSEvents eventid (or perhaps event)'s life
On 30 Jul, 2012, at 17:53, Ron Hunsinger wrote: On Jul 30, 2012, at 4:47 AM, Robert Martin robmar...@frontiernet.net wrote: Just keep track of the device UUID for each path and last event ID that you're tracking. EventID's are tied to each device, so you have to know that the device has not changed behind your back. For example, this can happen if the user has switched to a cloned backup drive containing the folders you are tracking. If the UUID's don't match, you can alert the user and rebuild whatever it is you're doing. What you need to track is the UUID of the FSEventStore, together with the last event ID. That is, there are three relevant IDs: The volume itself has a UUID Each volume has its own FSEventStore, with its own UUID There is an event ID, that is meaningful only with respect to its particular FSEventStore The FSEventStore gets invalidated and discarded at the slightest hint of trouble; most commonly any time the volume is not unmounted properly. A system crash, of course, fails to unmount any volume correctly, so it invalidates the FSEventStores of all volumes mounted at the time. A full OS install seems to also invalidate the FSEventStore. The volume's UUID persists across all those things, but not across an erase. You can use it to be sure you're referring to the proper volume. You can get the volume's UUID from diskutil info. You can read the FSEventStoreUUID from /.fseventsd/fseventsd-uuid FSEventsCopyUUIDForDevice is the correct way to read the event store UUID. - m -Ron Hunsinger ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: aborting init
On 29 Nov, 2010, at 19:27, Graham Cox wrote: On 30/11/2010, at 1:59 PM, Rainer Standke wrote: The intended behavior is not to get anything if the conditions are not met. Is this kosher? Do I have to do any kind of clean-up after doing something like that? Yes, it's OK to do this. As it's your own class, you can do what you like - typically you'd just document its behaviour (returns nil if x,y, and z are not met) if anyone else is likely to use it. The only thing to be concerned with is correct memory management, which just follows the usual rules. Returning nil, even unexpectedly, is usually 'safe' in that messages to nil are legal, and are either no-ops or return 0, so unlike C++, if you inadvertently send a message to nil, it doesn't crash. messages to nil are legal, and are either no-ops or return 0 this is not correct; there are more possibilities than 0 being returned. in most situations, sending a message to nil does indeed yield a return value of 0/nil. but that's not true all of the time: Sending Messages to nil http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocObjectsClasses.html if these caveats are important to what you later choose to do with the result of a message sen to an object that may be nil, you may need to pay attention to whether said object is nil before bothering to use it. -- michael ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Instantly delete a directory without recursion?
You should /always/ perform I/O on a secondary thread whenever possible. Every I/O you perform on the UI thread is an opportunity for hangs or unresponsiveness. Grand Central Dispatch is your friend here. -- michael On 04 Oct, 2010, at 05:54, Guillem Palou wrote: I don't think so, If time is a constraint, try running the delete process in a background thread, if it is not a problem. On Oct 4, 2010, at 10:24 AM, Oleg Krupnov wrote: Hi Guillem, You are correct, in many cases the number of files will not be big, so it should not matter too much, but using the opportunity, I decided to illuminate myself regarding the possibilities there are in the file system. I had an idea that because the directory tree is growing from a single root, there *might* be a possibility to axe it off with a single hit. Is it possible? Thanks. On Mon, Oct 4, 2010 at 11:18 AM, Guillem Palou guillem.pa...@gmail.com wrote: When removing directories, the OS should remove all the tree created in the filesystem. I think you cannot do anything else? Is it so critical? How many files do you have to delete? On Oct 4, 2010, at 10:12 AM, Oleg Krupnov wrote: Let me make the question more clear: I am aware of functions like [NSFileManager removeItemAtPath: error:], but what they do under the hood is they iterate through the subdirectories and files and delete them first. This takes some time. I am interested if it is possible to do this instantly, without even implicit recursion. Just remove the directory and the files and subdirectories would disappear? Thanks! On Mon, Oct 4, 2010 at 11:03 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: Hi, Is there a way to delete a directory instantly and completely without first deleting all its subdirectories and files recursively? Thanks. Oleg. ___ 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/guillem.palou%40gmail.com This email sent to guillem.pa...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Instantly delete a directory without recursion?
If you unlinked just the top-level directory node, you would leave all of its descendents with a link count 0, and the corresponding blocks claimed by the descendents would never be freed. (Ever. No one would have a reference to them, and they'd never be found in subsequent traversals.) To regain the space, you have to traverse through the structure and decrement the link count of the children of the tree. So, no. -- m On 04 Oct, 2010, at 01:24, Oleg Krupnov wrote: Hi Guillem, You are correct, in many cases the number of files will not be big, so it should not matter too much, but using the opportunity, I decided to illuminate myself regarding the possibilities there are in the file system. I had an idea that because the directory tree is growing from a single root, there *might* be a possibility to axe it off with a single hit. Is it possible? Thanks. On Mon, Oct 4, 2010 at 11:18 AM, Guillem Palou guillem.pa...@gmail.com wrote: When removing directories, the OS should remove all the tree created in the filesystem. I think you cannot do anything else? Is it so critical? How many files do you have to delete? On Oct 4, 2010, at 10:12 AM, Oleg Krupnov wrote: Let me make the question more clear: I am aware of functions like [NSFileManager removeItemAtPath: error:], but what they do under the hood is they iterate through the subdirectories and files and delete them first. This takes some time. I am interested if it is possible to do this instantly, without even implicit recursion. Just remove the directory and the files and subdirectories would disappear? Thanks! On Mon, Oct 4, 2010 at 11:03 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: Hi, Is there a way to delete a directory instantly and completely without first deleting all its subdirectories and files recursively? Thanks. Oleg. ___ 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/guillem.palou%40gmail.com This email sent to guillem.pa...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: What's the point of @properties?
On 21 Sep, 2010, at 18:48, Matt Neuburg wrote: On Mon, 20 Sep 2010 03:56:20 -0700, Chris Hanson c...@me.com said: Don't think of dot syntax as syntactic sugar for sending messages. Think of dot syntax as the way to access the state exposed by an object, and bracket syntax as the way to have an object do something. No, I think that's bollocks. Dot syntax is *exactly* syntactic sugar for calling the accessor, and using it correctly depends upon keeping that fact firmly in mind. m. I believe what Chris is saying is that you want to /think of/ properties as being state exposition. He isn't saying they're not technically sugar. If you think of them purely as sugar, you're missing the semantic value of using them in the first place. -- michael ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Make checkbox in table view uneditable
On 15 Sep, 2010, at 02:11, jonat...@mugginsoft.com wrote: On 15 Sep 2010, at 06:09, Shane Stanley wrote: On 15/9/10 12:29 PM, Keary Suska cocoa-...@esoteritech.com wrote: Checkboxes aren't edit controls, they are buttons, and to my knowledge don't even have an editable property (even though the table column has such a binding). To prevent changing a button state (without significant subclassing) you must disable it. Thanks. I guess it boils down to the fact that a checkbox is a bad choice for just showing a binary state in a table. Checkbox sounds fine to me for this purpose. If he means that the checkbox would never be toggleable under any circumstances, and that it's purely to *indicate* state and not *control* state, that's the wrong use for a checkbox button. A custom indicator that doesn't look like it could be enabled and toggled under some_unknown_circumstance would be a better idea. -- michael What about the NSTableColumn enabled binding? If failure persists then try the NSTableView delegate method - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCellforTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex Here can modify the cell as you wish to disable it for the required column. There is a lot that cannot be achieved with bindings and NSTableView. In these situations the delegate methods are the place to turn. Regards Jonathan Mitchell Developer Mugginsoft LLP http://www.mugginsoft.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/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Determine encoding of file
There's a good session from WWDC 2009, 112 - Text Processing in Cocoa, that has a segment about guessing encodings without having to read the entire file (in most cases). It's worth watching, even if it doesn't solve your problem directly. -- michael On 30 Jul, 2010, at 15:09, Dave DeLong wrote: Hi everyone, I have a seemingly simple question, but I haven't been able to figure it out. Given a file, how can I determine the NSStringEncoding of the file, without reading the entire file into memory? (If the file isn't a text file, then defaulting to NSUTF8StringEncoding is just fine, since my code will only work properly if I'm working with text files anyway) I've found this: http://www.macosxguru.net/article.php?story=20030808081801868 but it seems ridiculously complex... Thanks, Dave___ 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/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Determine encoding of file
And, of course, as Nick Z and that session point out, you may need to allow the user to choose the encoding somehow in your application, given you can't be 100% accurate when the encoding is unknown. -- michael On 30 Jul, 2010, at 17:35, Michael Watson wrote: There's a good session from WWDC 2009, 112 - Text Processing in Cocoa, that has a segment about guessing encodings without having to read the entire file (in most cases). It's worth watching, even if it doesn't solve your problem directly. -- michael On 30 Jul, 2010, at 15:09, Dave DeLong wrote: Hi everyone, I have a seemingly simple question, but I haven't been able to figure it out. Given a file, how can I determine the NSStringEncoding of the file, without reading the entire file into memory? (If the file isn't a text file, then defaulting to NSUTF8StringEncoding is just fine, since my code will only work properly if I'm working with text files anyway) I've found this: http://www.macosxguru.net/article.php?story=20030808081801868 but it seems ridiculously complex... Thanks, Dave___ 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/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Custom control and cells
In what way do you believe a custom NSCell-based replication of NSCollectionView will perform better than NSCollectionView itself? What performance issue have you seen? Are you sure the problem lies with NSCollectionView and not your own code surrounding it? (I.e., have you Sharked your application?) -- michael On 09 Jul, 2010, at 15:22, Georg Seifert wrote: Hi, The thing is, I want to replicate the NSCollectionView but using cells instead of views. The NSCollectionView has a lot of problems like performance and I couldn’t find a way to get the rect of the view of an item (both fixed in Snow Leopard but I have to support Leopard). It would be interesting anyway if I could implement my own controls. Best Georg On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote: Hi, I try to find an example on how to implement the mouse tracking and editing behavior of a NSCell from my own control (subclass of NSControl). I need a control that can handle several kinds of cells like ImageAndTextCell (with editing) or popup button cells. I read a lot about it but can’t fit it together. It is probably easiest to just use controls that contain the cells, and not try to make your control directly use multiple cells. With today's hardware, the performance gains are not worth the extra coding effort. corbin ___ 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/mikey-san%40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Download images and modify bundle?
On 02 Jul, 2010, at 04:47, Andreas Mayer wrote: Am 02.07.2010 um 10:01 Uhr schrieb sebi: When I download an image and want to keep it for further reference, I assume I have to store it in the documents directory and not in the app bundle, because otherwise I would invalidate the signature and the app wont run anymore. Is this correct? You should always regard the app bundle as read only. The application might have been installed with administrator rights so that the current user does not have write access. To carry this a bit further, your application might not even reside on a volume to which the user could /ever/ have write access, regardless of permissions. Read-only disk image? DVD? Read-only network share? These are all possible scenarios for which an application should be prepared. (I realize the thread wound up being about iPad, but this is a good thing to point out in general.) -- mikey ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Create VNC Client iPhone
On Aug 24, 2009, at 7:49, Joe Turner joetur...@me.com wrote: Hello, I've wanted to switch from bonjour to something more universal for a while now. And, I'm wondering about how to do VNC. I've seen that many apps on the iPhone use Apple's Screen-Sharing functionality as a VNC Server, and I would like to do the same. I have looked around for any sample code for VNC, but cannot find Bonjour is a discovery protocol. It exists independently of VNC. -- michael via iPhone ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [ANN] BuildCleaner
On Aug 14, 2009, at 17:58, Dave DeLong davedel...@me.com wrote: Hi everyone, I just wanted to let you know of a little utility app I've just posted, called BuildCleaner. As I explore example projects, open source frameworks, and test applications, I find that I usually have a lot of build folders cluttering my hard drive. When you combine that with backup services like Time Machine, Mozy, or DropBox, you can waste a lot of your bandwidth uploading build folders. Time Machine ignores Xcode build folders. This has been discussed on Xcode-users in the past. -- mikey To help with this, I've created BuildCleaner. It's a little menubar application that scans your hard drive every few minutes for build folders and deletes them if they haven't been modified recently (you can change the cutoff interval in the settings window). You can also tell it to ignore the build folders of specific projects, such as the humongous project you're following that takes ages to compile, but you only crack it open every couple of days... BuildCleaner is free and works on 10.5 and 10.6 (10A432). If there's a big demand for a 10.4 version, I can put that up, too. You can download it here: http://www.davedelong.com/downloads Cheers, Dave DeLong ___ 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/mikey-san %40bungie.org This email sent to mikey-...@bungie.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: detect left mouse button clicked in menu bar
On Aug 13, 2009, at 16:56, David M. Cotter m...@davecotter.com wrote: i know i can detect when a particular menu is about to be shown, but what I want is to run a quick process before any menus from the menu bar are shown Launching a process is by no means a quick operation. It is imperative that menus appear instantly when requested and not cause a great deal system overhead in the process, since users tend to be trigger-happy with menus. What is your actual goal? It seems silly that you'd need to execute a process every time someone clicks on a menu in the menu bar. -- mikey ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: accessing netinfo db from cocoa?
If you want to do it fast, without shell output parsing, and in a way that will work on 10.4 *and* 10.5, use the Directory Services C API. The downside is that it's more complex than many of the Cocoa APIs you're likely used to. Docs: http://developer.apple.com/documentation/Networking/Conceptual/Open_Directory/Introduction/chapter_1_section_1.html http://developer.apple.com/documentation/Networking/Reference/Open_Directory_Ref/Reference/reference.html Lots of source to learn from (the dscl sources are a good place to look for examples): http://www.opensource.apple.com/darwinsource/Current/DSTools-112/ -- m-s On 31 Aug, 2008, at 10:43, Jaime Magiera wrote: On Aug 31, 2008, at 4:57 AM, Kieren Eaton wrote: Hi, I am trying to find a way to access the netinfo DB from cocoa. Specifically the sharing (AFP, SMB, etc). Pointers or ideas are much appreciated. Hello, Quick question: Are you using Leopard or Tiger machines? On Tiger, you can run the commands niultil or nicl to query the NetInfo database from your application. Note that in Leopard, Netinfo has been completely deprecated in favor of a local LDAP database. So, if you are using Leopard, run the command dscl from your application. In either case, you'll have to parse the command results in your app. On Tiger, the path you want to query is... /config/SharePoints/ On Leopard, the path you want to query is... /Local/Default/SharePoints hope that helps, Jaime Magiera Sensory Research http://www.sensoryresearch.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/mikey-san %40bungie.org 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: @try @catch
Don't forget that many of Apple's own methods return nil on failure and don't implement an NSError reference mechanism. NSFileManager's - contentsAtPath: method returns either an NSData object on success or nil on failure. -- m-s On 14 Aug, 2008, at 08:45, Uli Kusterer wrote: On 14.08.2008, at 12:58, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails. Apple's stance on exceptions so far has been that, with the exception of some proxy objects (e.g. Distributed Objects), they should be used in Cocoa for programming errors only. Otherwise, you're supposed to return a BOOL, or an NSError, e.g. via a reference parameter, if more detailed failure info is needed. Whether I consider that good or bad, it's what Apple recommend. Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://www.zathras.de ___ 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/mikey-san %40bungie.org 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: @try @catch
I was only looking at: http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/contentsAtPath: Which fails to mention the note seen in NSFileManager.h. I'll file a docs bug. Thanks for the heads-up. -- m-s On 14 Aug, 2008, at 14:55, Clark Cox wrote: On Thu, Aug 14, 2008 at 11:38 AM, Michael Watson mikey- [EMAIL PROTECTED] wrote: Don't forget that many of Apple's own methods return nil on failure and don't implement an NSError reference mechanism. NSFileManager's -contentsAtPath: method returns either an NSData object on success or nil on failure. Which is why the comments on that method recommend using +[NSData dataWithContentsOfFile:options:error:] instead. -- Clark S. Cox III [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: Accessing memory of another application?
So what game are you trying to cheat at? -- m-s On 12 Aug, 2008, at 14:09, Josh wrote: I'm not creating both applications - The application I'm trying to access was written by someone else and has no developer documentation (it's a game) My application should read the memory of the game + change values/read offsets etc... Josh On Tue, Aug 12, 2008 at 2:07 PM, mm w [EMAIL PROTECTED] wrote: If you 're developing the both application you can create a layer/IPC system via shm (shared memory) to communicate between your two apps, what you asked is really a newbie question regarding C programming, before trying cocoa and obj-c you should learn the base Cheers On Tue, Aug 12, 2008 at 9:04 AM, Josh [EMAIL PROTECTED] wrote: All, I'm trying to get started w/viewing/editing/interacting with the memory of another running application but I'm not where to get started. You could think of this as being a simple game trainer - which basically allows you to view and edit values in memory. Can anyone point me to where I should get started? Function names/examples would be a GREAT help - I haven't had experience with hooking into another application's memory. Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/openspecies%40gmail.com This email sent to [EMAIL PROTECTED] -- -mmw ___ 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/mikey-san %40bungie.org 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: NSTask
Why would you expect to get a pointer to an object that executes shell tasks? Threads aren't shell calls. What are you trying to do with this other thread? -- m-s On 22 Jul, 2008, at 17:31, Torsten Curdt wrote: When I do [NSThread detachNewThreadSelector:@selector(something) toTarget:self withObject:nil]; How can I get access to the NSThread object?? I would have expected detachNewThreadSelector to return a NSTask object. 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/mikey-san %40bungie.org 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: Relaunch Finder (without AppleScript)
Someone correct me if I'm wrong, but surely this is a bad way to invoke the termination/relaunch a GUI application. -- m-s On 16 Jul, 2008, at 10:01, Dave DeLong wrote: You could use an NSTask to run killall Finder On Wed, Jul 16, 2008 at 7:57 AM, Piero Avola [EMAIL PROTECTED] wrote: Hello, I need to relaunch the Finder with my App. I don't want to use any scripts therefore. How can I do this with the Cocoa framework? AV ___ 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/mikey-san %40bungie.org 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: Trashing files and undo
Note that if a file is on a secondary volume, and you move the file to the Trash, it doesn't get moved to ~/.Trash; you'll find it in the .Trashes directory on the root of the volume on which it resides. -- m-s On 11 Jul, 2008, at 10:42, Abernathy, Joshua wrote: ~/.Trash? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Ruotger Skupin Sent: Friday, July 11, 2008 10:39 AM To: Cocoa-dev@lists.apple.com Subject: Trashing files and undo Hi, my app trashes files with -[NSWorkspace performFileOperation:source:destination:files:tag:] and NSWorkspaceRecycleOperation. This works flawlessly but users want undo. NSWorkspace does not seem to allow undoing said file operation (or any file operation for that matter). Correct me if I'm wrong. So I might have to figure out where the trash directory for a given volume/user/file etc is and move it myself. Is there an easy way to find that out? Thanks for any pointers Ruotger ___ 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/jabernathy%40burrislogi stics.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/mikey-san %40bungie.org 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: initWithCoder in Nib object loading
http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_3.html All view objects are sent -initWithCoder:, but the custom view object does something extra. After the custom view object is unarchived, it creates your view subclass, sends the object an - initWithFrame: message, and then swaps itself for the subclass. -- m-s On 27 Jun, 2008, at 07:28, John Murphy wrote: I notice that there are a couple different init methods used for nib loading. For instance, objects from the IB Library get an initWithCoder message, while custom view objects get an initWithFrame, and everything else gets an init. Why is this? Specifically, why a special initWithCoder technique? After all, isn't everything encoded? ___ 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/mikey-san %40bungie.org 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: Get the UUID of the current user
Jean-Daniel already provided an answer, but it's worth reminding people that the source code to many of the utilities that come with Mac OS X is available for dissection, including the Directory Services utilities: http://www.opensource.apple.com/darwinsource/10.5/DSTools-109/dsmbrutil/dsmbrutil.c If you can do it on the command-line with an open-source tool, you can extract the original code and use it directly. Your application will perform better, it will have fewer external tool version dependencies, and you can customize the data all you like without performing any additional shell tool parsing. -- m-s On 25 Jun, 2008, at 05:22, Yoann GINI wrote: Hi all, I look for get the UUID of the current user, the only way actually found is to run a NSTask with this command : dsmemberutil getuuid - U `whoami`... But it's not really a good solution for me. Have you a idea for get the UUID without NSTask ? Thanks in advance, Yoann ___ 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/mikey-san %40bungie.org 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: getting free space available in a drive
There are two NSFileManager methods for this: 10.4.11 and earlier: -[NSFileManager fileSystemAttributesAtPath:] 10.5 and later: -[NSFileManager attributesOfFileSystemForPath:error:] Each returns an NSDictionary containing a NSFileSystemFreeSize key. The value for this key is an NSNumber that represents the number of free bytes on the file system. If you want to get gritty, use statfs() and multiply f_bfree (blocks free) by f_bsize (block size for the file system). -- m-s On 19 Jun, 2008, at 02:44, Angelo Chen wrote: Hi, how to get the total free space available in a drive? thanks, Angelo ___ YM - 離線訊息 就算你沒有上網,你的朋友仍可以留下訊息 給你,當你上網時就能立即看到,任何說話都冇走失。 http://messenger.yahoo.com.hk ___ 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/mikey-san %40bungie.org 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: argument checks
You can use #import in straight C applications from within Xcode, if you like. There's also nothing stopping you from using the #include directive in Objective-C. It's just more work than #import, which handles include cycles for you. -- m-s On 12 Jun, 2008, at 21:37, William Squires wrote: I thought ObjC used #import, not #include, so that multiple copies of a header wouldn't appear, but maybe that's just for Cocoa stuff, and not for ordinary C? On Jun 12, 2008, at 1:05 AM, Jason Coco wrote: #include assert.h /* ... */ NSNumber *myNum = nil; // Lots of code where you've forgotten to actually do anything with myNum assert( myNum != nil ); results = [myClass someCalculationUsing: myNum]; // lots more code to remove the assertion in the release build, compile with -DNDEBUG HTH, /jason On Jun 12, 2008, at 01:50 , Ashley Perrien wrote: Noob question: I'm putting together a small code library and I'm trying to include some error checking in the methods; what I want to protect against is the following: NSNumber *myNum; // Lots of code where I've forgotten to actually do anything with myNum results = [myClass someCalculationUsing: myNum]; myNum in this case is an object and does exist but it's not a valid, usable argument. So in the implementation I'd like to have something along the lines of: if (myNum == nil) NSLog(@some error message); but can't figure out what to check for that would get me into the error message condition. Any suggestions? Ashley Perrien ___ ___ 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: NSSlider responding to superview's drawRect
This is normally what I have to do as well, but is there a more optimized way to achieve the goal of drawing only the rect that needs redrawing? -- m-s On 10 Jun, 2008, at 12:05, Ken Ferry wrote: You're probably filling your gradient into the rect passed in drawRect. That rectangle just represents the dirty part of your view. If you had a solid color to draw, you could just fill the rect, but with a gradient you will get your gradient, top to bottom, within this possibly small rect within your view. Try drawing the gradient into [self bounds] instead. This describes the location of the entire view in its own coordinate system. -Ken On Jun 10, 2008, at 8:51 AM, Jonathan Dann [EMAIL PROTECTED] wrote: Hi All, This is something that I haven't seen before. I have a custom view that inherits from NSView directly and just draws a gradient background. In IB I've placed an NSSlider on the view which works fine. The problem comes when drawRect in my custom view is invoked, I draw the gradient and a 1px line at the top of the view, but the line also gets draw just above the NSSlider! logging shows the following 1) resize window - drawRect is called and the line above the slider disappears 2) move slider - drawRect is called from my gradient view but with the frame of the slider. The line then appears. Is this a known issue with NSSlider and a custom view or have I missed an idiosyncracy of NSControls. Thanks in adavnce, 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/kenferry%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/mikey-san %40bungie.org 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: Newbie Question on a method signature
It's not the method order, it's declaration vs definition. The compiler scans the file top to bottom, so you must declare a method's prototype before you actually use it anywhere, otherwise the compiler will give you a warning because it hasn't seen the protoype yet. -- m-s On 04 Jun, 2008, at 16:26, James Cicenia wrote: Wow.. I didn't know the order of methods was important. thanks James On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote: On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia [EMAIL PROTECTED] wrote: why does it tell me: warning: (Messages without a matching method signature will be assumed to return 'id' and accept... I'm guessing your method's definition comes after the code that uses that method, and you haven't declared it in the header file. Hamish ___ 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/mikey-san %40bungie.org 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: Leopard (10.5+): Any Upper-Level (Cocoa) access to Mail?
Are you trying to talk to Mail.app, or are you looking for a generic e- mail framework? -- m-s On 02 Jun, 2008, at 11:34, [EMAIL PROTECTED] wrote: I'm searching for a Cocoa/ObjC routine to access/check Mail; specifically #read #unread mail messages. Is there such a routine or need I go do a BSD Mail access? So far, I've found the NSMailDelivery.h within the message.framework. But much of the code appears to be deprecated for OS 5 beyond. Regards, Ric. ___ 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/mikey-san %40bungie.org 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: Cocoa coding style (was Re: Did I reinvent the wheel?)
And do not override any of the following to implement singletons! - allocWithZone: -copyWithZone: -retain -retainCount -release - autorelease Instead, just add a +sharedWhatever class method. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html -- m-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: Cocoa coding style (was Re: Did I reinvent the wheel?)
I'm sure that he was, but without qualification, I thought it might read more like an absolute to some, so I linked to the singleton document . . . without providing any qualification for doing so, myself, sadly. -- m-s On 09 May, 2008, at 23:47, Andrew Merenbach wrote: I think that Chris Hanson was referring to the following note at the very end of the article: Situations could arise where you want a singleton instance (created and controlled by the class factory method) but also have the ability to create other instances as needed through allocation and initialization. In these cases, you would not override allocWithZone: and the other methods following it as shown in Listing 2-15. I'm not supporting either point of view as a best practice, as I don't use singletons much, but I can see where this misunderstanding may have arisen. Cheers, Andrew On May 9, 2008, at 8:32 PM, Michael Watson wrote: And do not override any of the following to implement singletons! -allocWithZone: -copyWithZone: -retain -retainCount -release - autorelease Instead, just add a +sharedWhatever class method. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html -- m-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/andrew.merenbach%40ucla.edu 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: Sending an image to Preview to preview the image
Thoughts: 1. Why not build your own preview panel/window? It's remarkably easy to do if you already have the image data in an NSData object. 2. If you must use Preview, you could write the image to a temp file and tell Preview to open that via NSWorkspace's - openFile:withApplication: method. -- m-s On 06 May, 2008, at 18:08, Kimo wrote: My app produces a list of images (NSData format), and I'd like the app Preview to display the image when the user double-clicks on an image in my app. Currently I use NSPerformService as shown below, which works, but Preview always asks to save the file when you close its window. I've seen other apps where you double-click an image and Preview opens a window with a title something like Preview of and it doesn't try to save the image when you close the window. To send an image to Preview using NSPerformService: NSData *data; /* assume exists */ NSPasteboard *pb = [NSPasteboard pasteboardWithUniqueName]; [pb declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:nil]; [pb setData:data forType:NSTIFFPboardType]; NSPerformService( @Preview/Open images, pb ); It works, but is there a better way to send image data to Preview? Thanks in advance! ___ 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/mikey-san %40bungie.org 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: Programmatic Size To Fit
Others have mentioned -[NSControl sizeToFit], but I thought it was worth reminding that when you can't find a method to do what you want in a given class, remember to check its superclasses for methods the class inherits for what you seek. -- m-s On 01 May, 2008, at 13:39, Randall Meadows wrote: I am creating a bunch of controls (at least NSTextfield, NSPopupButton, NSSlider, and perhaps others) programmatically (that will eventually be shown in an NSTableView), and would like to apply the Size To Fit feature that IB provides. However, there doesn't seem to be any API that does that. Does IB simply brute-force the resizing for every type of view, or am I missing the appropriate call in the NSView API? Thanks! randy ___ 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/mikey-san %40bungie.org 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: Safe frameworks for privileged tools?
That's a good table to know/have handy. Thanks. Okay, so LaunchServices is out as well. Is there *any* reliable way to know if a directory is a bundle or package without using NSWorkspace or LaunchServices? (I'm also going to have to omit Spotlight, since I can't be guaranteed it's enabled on a given machine.) -- m-s On 23 Apr, 2008, at 00:17, stephen joseph butler wrote: On Tue, Apr 22, 2008 at 10:52 PM, Michael Watson mikey- [EMAIL PROTECTED] wrote: I would like to use LaunchServices for this, but wasn't sure if it was kosher to link to ApplicationServices.framework from a privileged tool. Are there guidelines as to which frameworks should and shouldn't be used in privileged tools? I know nothing can ever be safe, but some are surely more dangerous than others, and I'd love some guidance. This is the definitive list of safe frameworks: http://developer.apple.com/technotes/tn2005/tn2083.html#SECFRAMEWORKCROSSREFERENCE Unfortunately, ApplicationServices is a no. However, this blog posts suggests some instances where it might be safe: http://unixjunkie.blogspot.com/2006/10/launchservices-from-root-daemon.html ___ 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/mikey-san %40bungie.org 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: Safe frameworks for privileged tools?
That's the hang-up. The target directory may require privilege to see. -- m-s On 23 Apr, 2008, at 02:42, Kevin Grant wrote: Does the target directory require privilege to see, or does it just happen to be used by a privileged tool? If the latter, you could always rely on a 2nd executable (without privilege) to examine the directory and return its results to your privileged program. Kevin G. That's a good table to know/have handy. Thanks. Okay, so LaunchServices is out as well. Is there *any* reliable way to know if a directory is a bundle or package without using NSWorkspace or LaunchServices? (I'm also going to have to omit Spotlight, since I can't be guaranteed it's enabled on a given machine.) -- m-s On 23 Apr, 2008, at 00:17, stephen joseph butler wrote: On Tue, Apr 22, 2008 at 10:52 PM, Michael Watson [EMAIL PROTECTED] wrote: I would like to use LaunchServices for this, but wasn't sure if it was kosher to link to ApplicationServices.framework from a privileged tool. Are there guidelines as to which frameworks should and shouldn't be used in privileged tools? I know nothing can ever be safe, but some are surely more dangerous than others, and I'd love some guidance. This is the definitive list of safe frameworks: http://developer.apple.com/technotes/tn2005/tn2083.html#SECFRAMEWORKCROSSREFERENCE Unfortunately, ApplicationServices is a no. However, this blog posts suggests some instances where it might be safe: http://unixjunkie.blogspot.com/2006/10/launchservices-from-root-daemon.html ___ 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: Safe frameworks for privileged tools?
Yes, it's a helper tool. It runs for a couple of seconds (under normal conditions) and exits immediately. It interacts with the file system by reading information about some directories, so its launched duration is, of course, bound to the responsiveness of the hard drive on which it's operating. As such, a couple of seconds might be five or ten seconds on machines where the drive is spinning up, otherwise busy, etc. It's certainly possible that someone might invoke fast user switching right in the middle of the tool running, but it's /probably/ not an issue. I'm still not quite convinced it isn't, just yet. I need to do more thinking about it. The discussion so far has been very helpful. As far as connecting to the window server goes, Apple states: http://developer.apple.com/technotes/tn2005/tn2083.html#SECWINDOWSERVER Apple plans to disable the global window server service in a future release of Mac OS X. Do not write any new code that uses the global window server service. So when you say default window server, are you speaking of the global window server, or the default window server associated with the current console session? -- m-s On 23 Apr, 2008, at 13:04, stephen joseph butler wrote: On Wed, Apr 23, 2008 at 11:42 AM, Dave Camp [EMAIL PROTECTED] wrote: Unless I'm reading the OP wrong, he's writing a privileged helper tool, not a daemon. Given that, I don't think the above documents are applicable. None of what I know is official, but just gathered and extrapolated from years of reading information about this. So I might be wrong... who knows. The unsafe frameworks make connections to the default window server. As a program launched from Finder/Dock/et al, this will always work as expected. Launched from ssh or root, there are some caveats. For ssh, they will work fine as long as the same user is logged onto the GUI. As soon as the user logs out, your program loses its connection and might crash. For root, they will work as long as the console user stays the same. If someone uses fast user switching, or logs out, then the program's connection changes and it might crash. In any event, none of the unsafe frameworks are documented as working in any conditions other than the normal ones. People may get them to work 90% of the time under other conditions, but that's unsupported and may change. So unless DTS tells you otherwise, I'd stay away. But that's me... maybe 90% is good enough 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/mikey-san %40bungie.org 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: AppleScript - occasional crashes on Leopard
Sounds like you're using NSAppleScript from a non-main thread, which will result in random crashes like that. NSAppleScript is only designed to work from the main thread. -- m-s On 22 Apr, 2008, at 13:47, Steve Cronin wrote: Folks; I've seen some inconsistent behavior on AppleScript running under Leopard. Here's an example: ... NSString *theScript =@some valid dynamic script text NSDictionary *errorDict = [NSDictionary dictionary]; NSAppleScript *appleScriptObject = [[NSAppleScript alloc] initWithSource:theScript]; NSAppleEventDescriptor *eventDescriptor = [appleScriptObject executeAndReturnError: errorDict]; ... will OCCASIONALLY crash at the NSAppleEventDescriptor specification: #0 0x932c3d5c in getDescDataType #1 0x932c7ab7 in aeCoerceDescInternal #2 0x932cc055 in AECoerceDesc #3 0x1d4a8150 in ComponentCoerceDesc #4 0x1d48cbec in ASCompile #5 0x903bacb8 in CallComponentFunction #6 0x1d487ae2 in AppleScriptComponent #7 0x1d4a3927 in AGenericManager::HandleOSACall #8 0x903755cd in CallComponentDispatch #9 0x953fc513 in OSACompile #10 0x93e6edaf in -[NSAppleScript compileAndReturnError:] #11 0x93e6f096 in -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] #12 0x93e6ee51 in -[NSAppleScript executeAndReturnError:] Is there a new/better means in Leopard of accomplishing the execution of dynamic scripts? NO the crash is NOT related to the validity of the script, of this I am absolutely certain! (It only crashes sometimes using the same resulting script!!) Is a dual processor Intel creating a risk here? Is there something better I can do to handle the error? Why should I have to use a @try block here? I thought that was what the executeAndReturnError parameter was for!! But I don't get a chance to examine the errorDict. It will crash only every so often My hunch is that crashes are more likely when machine is under load and memory swapping might be involved. This is running on a 4G MacBook... Any wisdom appreciated! Steve ___ 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/mikey-san %40bungie.org 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: AppleScript - occasional crashes on Leopard
For reference, you're not supposed to pass a pointer to a valid NSDictionary object in -executeAndReturnError:, you're supposed to pass a pointer to an NSDictionary pointer variable. On return, if there were errors encountered, errorDict will be a valid NSDictionary object. -- m-s On 22 Apr, 2008, at 13:47, Steve Cronin wrote: NSString *theScript =@some valid dynamic script text NSDictionary *errorDict = [NSDictionary dictionary]; NSAppleScript *appleScriptObject = [[NSAppleScript alloc] initWithSource:theScript]; NSAppleEventDescriptor *eventDescriptor = [appleScriptObject executeAndReturnError: errorDict]; ___ 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: AppleScript - occasional crashes on Leopard
Mark, So GC + NSAppleScript == avoid for now? -- m-s On 22 Apr, 2008, at 15:53, Mark Piccirelli wrote: Is this a garbage-collected app? If so the crash is a known bug. -- Mark On Apr 22, 2008, at 10:47 AM, Steve Cronin wrote: Folks; I've seen some inconsistent behavior on AppleScript running under Leopard. Here's an example: ... NSString *theScript =@some valid dynamic script text NSDictionary *errorDict = [NSDictionary dictionary]; NSAppleScript *appleScriptObject = [[NSAppleScript alloc] initWithSource:theScript]; NSAppleEventDescriptor *eventDescriptor = [appleScriptObject executeAndReturnError: errorDict]; ... will OCCASIONALLY crash at the NSAppleEventDescriptor specification: #0 0x932c3d5c in getDescDataType #1 0x932c7ab7 in aeCoerceDescInternal #2 0x932cc055 in AECoerceDesc #3 0x1d4a8150 in ComponentCoerceDesc #4 0x1d48cbec in ASCompile #5 0x903bacb8 in CallComponentFunction #6 0x1d487ae2 in AppleScriptComponent #7 0x1d4a3927 in AGenericManager::HandleOSACall #8 0x903755cd in CallComponentDispatch #9 0x953fc513 in OSACompile #10 0x93e6edaf in -[NSAppleScript compileAndReturnError:] #11 0x93e6f096 in -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] #12 0x93e6ee51 in -[NSAppleScript executeAndReturnError:] Is there a new/better means in Leopard of accomplishing the execution of dynamic scripts? NO the crash is NOT related to the validity of the script, of this I am absolutely certain! (It only crashes sometimes using the same resulting script!!) Is a dual processor Intel creating a risk here? Is there something better I can do to handle the error? Why should I have to use a @try block here? I thought that was what the executeAndReturnError parameter was for!! But I don't get a chance to examine the errorDict. It will crash only every so often My hunch is that crashes are more likely when machine is under load and memory swapping might be involved. This is running on a 4G MacBook... Any wisdom appreciated! Steve ___ 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/markp%40apple.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/mikey-san %40bungie.org 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]
Safe frameworks for privileged tools?
Hey all, I'm writing a privileged helper tool that at one point needs to determine if a given directory is a package. Normally, I'd use NSWorkspace, but that's part of AppKit, which is tied to Window Server. I don't link to AppKit in my privileged tool, so I don't get the oh-so-convenvient -isFilePackageAtPath: method. I would like to use LaunchServices for this, but wasn't sure if it was kosher to link to ApplicationServices.framework from a privileged tool. Are there guidelines as to which frameworks should and shouldn't be used in privileged tools? I know nothing can ever be safe, but some are surely more dangerous than others, and I'd love some guidance. -- m-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: How to create shortcuts after installing the my package
It's not standard practice on the Mac, and most will probably agree that it's not something your application should be doing. It's a presumptuous invasion of the user's desktop space, and most Mac users are very protective of that. -- m-s On 23 Apr, 2008, at 00:53, JanakiRam wrote: Hi All, I'm porting a windows based application to Mac OS X. My application in windows will create desktop shortcut once we install. I really don't whether its mac standard to create desktop shortcut and dock icon once i install my cocoa application. Can any one suggest me whether its a standard procedure.or provide the necessary links/pointers. JanakiRam. ___ 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/mikey-san %40bungie.org 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: Different ways of application installation
It's worth noting that you also need to define more clearly what you mean by remotely. Do you mean pushing software packages to clients on a network or over the Internet? An installer that pulls its payload from a remote server? Something else? -- m-s On 18 Apr, 2008, at 09:36, I. Savant wrote: I have build cocoa application. I am finding out as many ways as possible of application installation which can be done either locally or remotely. Can you please list all those ways? Have a look at this document: http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/Introduction/chapter_1_section_1.html -- 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/mikey-san %40bungie.org 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]
Determining which sheet closed with panels in separate nibs
Inside of MainMenu.nib, I have my application's main window. Also in MainMenu.nib is an NSObject subclass instance that is the main window's delegate. In another nib, I have a panel and an NSObject subclass instance that is the panel's delegate. The panel is opened attached as a sheet to the main window. When the sheet is closed on the main window, I need to do some things, so I implement -[NSWindow windowDidEndSheet:] in the main window's delegate. The problem is that I have other panels I attach as sheets to this window in different situations, and I need to distinguish between them so I take the correct action for the specific sheet that has closed. Normally, I'd just compare one outlet to another, but the panel itself is in another nib, and as such I can't hook it up to an outlet in the main window delegate. What's a reasonable procedure here to determine which sheet closed when dealing with panels in separate nibs? -- m-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: Determining which sheet closed with panels in separate nibs
I don't know why this didn't occur to me originally, but it's exactly what I need. Thanks for the help, guys. -- m-s On 17 Apr, 2008, at 17:12, Jean-Daniel Dupas wrote: Le 17 avr. 08 à 22:44, Sherm Pendley a écrit : On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson mikey- [EMAIL PROTECTED] wrote: Inside of MainMenu.nib, I have my application's main window. Also in MainMenu.nib is an NSObject subclass instance that is the main window's delegate. In another nib, I have a panel and an NSObject subclass instance that is the panel's delegate. The panel is opened attached as a sheet to the main window. When the sheet is closed on the main window, I need to do some things, so I implement -[NSWindow windowDidEndSheet:] in the main window's delegate. The problem is that I have other panels I attach as sheets to this window in different situations, and I need to distinguish between them so I take the correct action for the specific sheet that has closed. When you open the sheet with - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo :, assign your controller as the delegate, and create a -didEndSheet:returnCode:contextInfo: method in your controller. That way, the contextInfo that you specified when opening the sheet will be passed back to your delegate method when it closes. sherm-- You can also specifiy a different selector for each sheet. -didEndOpenFileSheet:returnCode:contextInfo: -didEndOtherSheet:returnCode:contextInfo: etc… ___ 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: Basic Core Animation question
I noticed: //GameBoard.h* #import Cocoa/Cocoa.h #import Quartz/Quartz.h You've added QuartzCore.framework, but Quartz.h isn't the top-level header for QuartzCore. You're importing a header in a framework you aren't linking to. Either link to Quartz.framework and import Quartz/Quartz.h, or link to QuartzCore.framework and import QuartzCore/QuartzCore.h. -- m-s On 13 Apr, 2008, at 02:17, Greg Sabo wrote: Hmm, I just added it, and I still get the same linking error. Any other ideas? I could probably use an example project which successfully uses CALayers, too. I can't find any on the net that are helpful. On Sat, Apr 12, 2008 at 7:36 PM, Michael Vannorsdel [EMAIL PROTECTED] wrote: Did you put the QuartzCore framework in your project Frameworks? The linker needs to know about QuartzCore before it can find the CALayer class symbols. On Apr 12, 2008, at 5:58 PM, Greg Sabo wrote: I'm a Compsci student trying to learn Cocoa development, and I'm trying to write a simple program using Core Animation, but I'm having a hard time getting it to work. I just need someone to tell me what I'm doing wrong so I can move on and screw up something else :) Thanks, and I apologize for the newbie question! ___ 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/gregsabo%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: Basic Core Animation question
I've spoken too soon, I'm afraid. Quartz.h also imports QuartzCore.h, and as such what I said isn't entirely accurate. You'll still import the header for QuartzCore, so that's not your problem. Have you verified in your project target that the QuartzCore framework is listed in the Link Binary With Libraries phase? -- m-s On 13 Apr, 2008, at 02:29, Michael Watson wrote: I noticed: //GameBoard.h* #import Cocoa/Cocoa.h #import Quartz/Quartz.h You've added QuartzCore.framework, but Quartz.h isn't the top-level header for QuartzCore. You're importing a header in a framework you aren't linking to. Either link to Quartz.framework and import Quartz/Quartz.h, or link to QuartzCore.framework and import QuartzCore/QuartzCore.h. -- m-s On 13 Apr, 2008, at 02:17, Greg Sabo wrote: Hmm, I just added it, and I still get the same linking error. Any other ideas? I could probably use an example project which successfully uses CALayers, too. I can't find any on the net that are helpful. On Sat, Apr 12, 2008 at 7:36 PM, Michael Vannorsdel [EMAIL PROTECTED] wrote: Did you put the QuartzCore framework in your project Frameworks? The linker needs to know about QuartzCore before it can find the CALayer class symbols. On Apr 12, 2008, at 5:58 PM, Greg Sabo wrote: I'm a Compsci student trying to learn Cocoa development, and I'm trying to write a simple program using Core Animation, but I'm having a hard time getting it to work. I just need someone to tell me what I'm doing wrong so I can move on and screw up something else :) Thanks, and I apologize for the newbie question! ___ 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/gregsabo %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: Subclassing NSScroller
You should find this thread of interest: http://www.cocoabuilder.com/archive/message/cocoa/2008/1/25/197293 -- m-s On 13 Apr, 2008, at 15:18, Jonathan Dann wrote: Hi All, I'm trying to re-create the iTunes and HUD window scrollbars for my project. I've managed to get a good looking NSScrollerKnob, and NSScrollerKnobSlot using bezier paths and gradients, but now I'm moving on to the arrows and the curved ends of the slot. To get the knob I've overridden -drawKnob and the slot is done by overriding -drawKnobSlotInRect:highlight:. By the same logic I thought that -drawArrow:highlight: would allow me to start playing with the arrows, but this never gets called. Has anyone any experience with doing this, and changing the width of the whole (vertical) bar itself? Passing arbitrary NSRects to -initWithFrame: doesn't seem to have any effect on the size of the scroll bar. Thanks for your time, Jon___ 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/mikey-san %40bungie.org 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: Override AppleScrollBarVariant on NSScroller?
On 12 Apr, 2008, at 06:33, [EMAIL PROTECTED] wrote: Guys, you are way off-topic, and you are offending me. Of course I have good reasons for wanting to do this. Trust me, I'm not tampering with user defaults for the sheer fun of it. If you can't provide me with an answer to my question, please spare me your thoughts on UI design. They don't belong to this list. Thank you. First, I don't think we're way off-topic. You wanted to know how to do something that breaks consistency in a very severe manner, and a couple of us warned you against it. If you don't want our answers, don't ask us. This list often advises people on not breaking UI consistencies, and expecting anyone not to question your motives and express their opinions on what you're trying to do is quite naive. We are not robots, and if someone sees a better answer that addresses the higher-level goal instead of the specific question, you're very likely to see that answer voiced. If you have such good reasons for doing this that you feel it's appropriate to lecture list members and tell us how to reply to you, by all means, tell us what those reasons are. Otherwise, don't get huffy when you don't get what you want. -- m-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: Override AppleScrollBarVariant on NSScroller?
Uh, the double both variant isn't available in the GUI, so why would you ever complain about an application not supporting it? It's never been an official option, just available via an undocumented preference value. The bottom line that you're veering away from is that this guy wants to *force* the double variant on users, regardless of the setting the user has chosen in the Appearance preferences. iTunes respects the setting I chose in the prefs, this guy's app won't. Guess which one is being a better citizen. -- m-s On 10 Apr, 2008, at 23:24, Bill Monk wrote: On Apr 10, 2008, at 1:43 AM, Michael Watson wrote: Not sure what you're talking about. This: http://homepage.mac.com/billmonk/clips/scrollbarsTiger.png http://homepage.mac.com/billmonk/clips/scrollbarsLeopard.png ___ 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: Override AppleScrollBarVariant on NSScroller?
I hope it isn't possible. I don't really want applications actively ignoring my scroll bar setting and enforcing its own. I prefer them at one end, together, at bottom. If suddenly one or two of my apps are different, it's going to drive me batty as I switch around between apps, and those weird apps are gonna take a quick trip to the trash. -- m-s On 09 Apr, 2008, at 18:12, [EMAIL PROTECTED] wrote: Hi, I'm looking for a way to override the user's AppleScrollBarVariant setting, and force the arrows on my custom NSScroller to be displayed at both ends of the scroller. The documentation has no mentioning of this. Does anyone know if this is possible? Thanks. 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/mikey-san %40bungie.org 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: make a window not draggable in spaces
Why do you want to do this? I would be pretty annoyed if I couldn't drag a window from space to space if it appeared in my zoomed-out spaces. -- m-s On 17 Mar, 2008, at 06:28, Cocoa Developer wrote: Hi, How to make a window not draggable in spaces. I used to set NSBorderlessWindowMask mask while creating window, when set Full screen. But spaces neglect this mask and allow to drag around. Thank you, Bas ___ 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/mikey-san %40bungie.org 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: Another newbie, into and cry for help...
For what it's worth, without meaning any offense, another newbie, cry for help is not a very good subject for your question. Remember that subjects are useful for searching and also determine who reads what sometimes. ;-) -- m-s On 16 Mar, 2008, at 16:43, Neil Jones wrote: On 16 Mar 2008, at 20:06, Neil Jones wrote: In the NSPersistentDocument Core Data Tutorial, I have had the thing working all the way until I added the Department - now the interface all works as expected but I cannot save my data anymore. If I invoke the File - Save As option and enter a filename the file doesn't save but I get the following logged in the Debugger Console:- 2008-03-16 19:25:43.070 DepartmentAndEmployees[6368:10b] Cannot perform operation since entity with name '(null)' cannot be found And of course, I've found the problem, minutes after sending this. Isn't that always the way? Anyway, When I added the Department array controller to the nib I didn't set it to Entity mode. Clearly I need to read the tutorials more carefully. Regards Neil ___ 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/mikey-san %40bungie.org 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: usleep()
Yes. Code in a method executes on a thread in order from top to bottom (taking into account flow control from while/do/etc). The usleep() function pauses the thread until the specified duration of time passes, at which point the next line of code is executed. And remember that the thread sleep duration is only approximate. You aren't guaranteed exactly any number of microseconds due to processor timing delays. Don't rely on the specified duration being 100% accurate. -- m-s On 15 Mar, 2008, at 09:56, Cocoa wrote: these code is from ScriptBridgeConcept.pdf. Does anyone know what the red code below mean, specifically rampVolume += orignalVolume/ 16) i search usleep() in Xcode documentation, it explain that suspend thread execution for an interval measured in microseconds. Does it just mean it will stop the the code for how many microseconds? - (IBAction)play:(id)sender { iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@com.apple.iTunes]; if ( [iTunes isRunning] ) { int rampVolume, originalVolume; originalVolume = [iTunes soundVolume]; [iTunes setSoundVolume:0]; [iTunes playOnce:NO]; for (rampVolume = 0; rampVolume originalVolume; rampVolume += originalVolume / 16) { [iTunes setSoundVolume: rampVolume]; /* pause 1/10th of a second (100,000 microseconds) between adjustments. */ usleep(10); } [iTunes setSoundVolume:originalVolume]; } }___ 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/mikey-san %40bungie.org 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: get currently logging in users
Why not peruse the sources of the who utility and see how it finds the data you want? http://www.opensource.apple.com/darwinsource/10.5/shell_cmds-116/who/ -- m-s On 13 Mar, 2008, at 22:27, lazuardi wrote: On 2008/03/14, at 10:51, Kyle Sluder wrote: who (and last) use wtmp and utmp. man utmp(5) for info on how you can access this information in your own programs. Yes, I did use utmp as the darwin did at who command, referenced from shell_cmds-811 from darwin source. but, as I said at my mail before, It didn't give me the full name of the user that has username more than 8 characters. Is there any way to solve this? Regards, Ardian ___ 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/mikey-san %40bungie.org 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: get currently logging in users
First, seconding what others are saying. This is not the right list for your problem if you go into the low-level APIs. The main difference between tiger and leopard's who source is the use of utmp and utmpx. utmp has been deprecated on leopard. leopard uses utmpx to retrieve currently logging in users. utmp uses at tiger is buggy? It's just limited. It's pretty easy to spot the difference in this regard, no guessing needed: the size of the ut_name member of the utmp struct is defined as 8 bytes. In the utmpx struct, however, you'll find that the size of the ut_user member is defined as 256 bytes. The old struct could only hold the first eight characters of the short name, while the one preferred under Leopard can hold very long short names. -- m-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: how to get a particular icon from .icns file
if you look at the count of representations of that NSImage, you will find several sizes. (Assuming, of course, that the original .icns file contained multiple representations of different sizes.) -- m-s On 09 Mar, 2008, at 09:28, Nick Rogers wrote: Hi, I have a icon file (.icns) with 10 icons in it and i want to create an NSImage with only the 32x32 icon from this file. Currently I'm doing: NSImage *anIcon = [[NSImage alloc] initWithContentsOfFile:iconPath]; which results in a very big 128x128 icon. Regards, Nick ___ 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/mikey-san %40bungie.org 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]