Re:Boolean values in a plist - resolved

2010-05-23 Thread Dale Miller
Thanks to Ken Thomases and James Walker for the information that I can use: if (CFGetTypeID(someObject) == CFBooleanGetTypeID()) Dale Miller ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

Beginner question on controls and NSCopying

2010-05-23 Thread Velocityboy
Hi all - I'm working on an app that has the concept of allowing the user to create templates of things which are then instanced into a document. Central to this is the idea that the user can create a template, then select it as part of another template or an instance. The relationship between t

Re: List of all supported apps for file type

2010-05-23 Thread Chaitanya Pandit
You can do "CFArrayRef applications = LSCopyApplicationURLsForURL((CFURLRef)fileUrl, kLSRolesAll);" to get the applications and then call: - (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString **)appName type:(NSString **)ty To get the application details On May 24, 2010, at 4:27

Garbage collector

2010-05-23 Thread paul Fultz
How do I use cocoas garbage collector in c++? It seems to be implemented in c++ with libauto: http://www.opensource.apple.com/source/libauto/libauto-77.1/README.html?f=text But I cant seem to find that much documentation on it. Thanks, Paul ___

Re: Suppressing visibility in the Dock

2010-05-23 Thread Ben Haller
On 24-May-10, at 12:12 AM, Ken Thomases wrote: I think you can also get away with using LSBackgroundOnly or LSUIElement and then, when you want it to be a foreground GUI app, use TransformProcessType() to make it one. This seems pretty plausible. Somebody else suggested the same thing

Re: Suppressing visibility in the Dock

2010-05-23 Thread Kyle Sluder
On Sun, May 23, 2010 at 9:12 PM, Ken Thomases wrote: > One recommendation is to split the app into a GUI front-end and a back-end > tool. That won't solve his Real Problem, though, which is connecting to the window server from a background application. Would the CGPDFDocument API avoid this iss

Re: Boolean Values in a plist

2010-05-23 Thread Kyle Sluder
On Sun, May 23, 2010 at 8:58 PM, Quincey Morris wrote: > Admittedly, it is a little strange that CFBoolean is toll-free bridged but > there isn't any NSBoolean* type for it to be bridged into. I don't believe this is documented anywhere, but CFBoolean is toll-free bridged to NSNumber. At least,

Re: Suppressing visibility in the Dock

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 11:01 PM, Ben Haller wrote: > So I've got an app that can run both as a UI app and as a command-line tool. One recommendation is to split the app into a GUI front-end and a back-end tool. I think you can also get away with using LSBackgroundOnly or LSUIElement and then, whe

Suppressing visibility in the Dock

2010-05-23 Thread Ben Haller
So I've got an app that can run both as a UI app and as a command- line tool. Which mode it runs in is governed by a command-line argument; if the app is just double-clicked, it runs with UI, but if it is launched with the argument "-nohead" it runs as a tool. This has worked great for s

Re: Boolean Values in a plist

2010-05-23 Thread Quincey Morris
On May 23, 2010, at 20:23, Dale Miller wrote: > I need to use the parameters obtained from a plist (via > NSPropertyListSerialization). I can get the process to work quite well, > except that I have to use in my code an undocumented class: NSCFBoolean. > Determining that the returned object is o

Re: Boolean Values in a plist

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 10:23 PM, Dale Miller wrote: > I need to use the parameters obtained from a plist (via > NSPropertyListSerialization). I can get the process to work quite well, > except that I have to use in my code an undocumented class: NSCFBoolean. > Determining that the returned object i

Re: Boolean Values in a plist

2010-05-23 Thread James W. Walker
On May 23, 2010, at 8:23 PM, Dale Miller wrote: > I need to use the parameters obtained from a plist (via > NSPropertyListSerialization). I can get the process to work quite well, > except that I have to use in my code an undocumented class: NSCFBoolean. > Determining that the returned object i

Boolean Values in a plist

2010-05-23 Thread Dale Miller
I need to use the parameters obtained from a plist (via NSPropertyListSerialization). I can get the process to work quite well, except that I have to use in my code an undocumented class: NSCFBoolean. Determining that the returned object is of class NSCFBoolean is the only way I've been abl

Re: NSDoc's Magic File Watcher Ruins Core Data Migration

2010-05-23 Thread Quincey Morris
On May 23, 2010, at 18:11, Jerry Krinock wrote: > To perform Core Data migration automaticlly, my overridden > configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:, > archives the original document by invoking -[NSFileManager > moveItemAtPath:::], appending a

Re: List of all supported apps for file type

2010-05-23 Thread Dave DeLong
That's really good to know! Thank you for sharing this. :) Dave On May 23, 2010, at 8:51 PM, Scott Ribe wrote: > On May 23, 2010, at 5:03 PM, Dave DeLong wrote: > >> Use LSCopyAllRoleHandlersForContentType to get a list of bundle identifiers. > > No, don't. It's really lame, and returns obvi

Re: List of all supported apps for file type

2010-05-23 Thread Scott Ribe
On May 23, 2010, at 5:03 PM, Dave DeLong wrote: > Use LSCopyAllRoleHandlersForContentType to get a list of bundle identifiers. No, don't. It's really lame, and returns obviously incomplete results. Maybe it only returns Cocoa apps; maybe it only returns apps that specify the type via explicit U

Re: Object Ownership

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 7:34 PM, Graham Cox wrote: > What I don't understand is why you make the copy. > > [NSURL URLWithString] doesn't require a mutable string, it requires a string, > so your whole method could be reduced to: He does have a comment ("do some stuff with aCopy here") indicating th

NSDoc's Magic File Watcher Ruins Core Data Migration

2010-05-23 Thread Jerry Krinock
To perform Core Data migration automaticlly, my overridden configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:, archives the original document by invoking -[NSFileManager moveItemAtPath:::], appending a tilde (~) to its name, then migrates the document to a ne

Re: nsprogressindicator change color

2010-05-23 Thread Graham Cox
On 23/05/2010, at 6:55 PM, Rick C. wrote: > eems I must try to redraw everything using -drawRect when all is really want > is to change the color. Is there a more obvious way that I might be > overlooking? Probably not - most UI stuff that the system draws is hard-wired to the Aqua appearan

Re: Object Ownership

2010-05-23 Thread Graham Cox
On 23/05/2010, at 1:18 AM, Michael Jackson wrote: > Hi all, > > First day with Cocoa, so please excuse the basic newbness of this > question. ;) I've read through the documentation about object > ownership and disposal and just wanted to make sure I'm doing > everything correctly in the followin

Re: List of all supported apps for file type

2010-05-23 Thread Dave DeLong
Use LSCopyAllRoleHandlersForContentType to get a list of bundle identifiers. The bundle identifiers you can convert into full paths using NSWorkspace, which also has a method to retrieve an icon that for a file at a full path (which in the case of an app, will return an app icon). Cheers, Dav

Re: List of all supported apps for file type

2010-05-23 Thread Joar Wingfors
The API:s to use for things like this would be NSWorkspace, and Launch Services. In that order of preference. j o a r On 23 maj 2010, at 15.57, Trygve Inda wrote: > I know I have seen this code before but in the last 30 minutes of digging, I > can't find it. > > How can I get a list of bundle

List of all supported apps for file type

2010-05-23 Thread Trygve Inda
I know I have seen this code before but in the last 30 minutes of digging, I can't find it. How can I get a list of bundle identifiers (or paths to an app) for all the apps that can open a file of a given type (eg pdf, mp3 etc) Then, How can I get an icon for these apps? Basically I want to buil

Re: how to bring up a keyboard as in UITextField

2010-05-23 Thread Scott Andrew
I did something similar for my IPhone combo box. See http://newwavedigitalmedia.com/?p=79. The source is on GitHub as well at http://github.com/scottandrew/NWPickerField. Sent from my iPad On May 23, 2010, at 12:32 PM, Alejandro Marcos Aragón wrote: > Hi everyone, > > I'm trying to reprod

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 21:21, Paul Sanders wrote: >> On sensible platforms, stat() returns UTC, as you'd expect. > > That statement I can now verify by experiment (which is good as I assumed > that when I wrote the code). The docs do not say. OS X conforms to the SUSv3 specification, which says ex

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> BTW, why "hazard a guess" rather than either (a) testing this, or (b) looking > at the kernel sources to find out? Because I thought it might be a useful heads-up for the OP. I am not planning on using this API myself and I am not familiar with the kernel sources. > On sensible platforms, st

how to bring up a keyboard as in UITextField

2010-05-23 Thread Alejandro Marcos Aragón
Hi everyone, I'm trying to reproduce something similar to what happens when the user touches a UITextField. I want a keyboard to show up to half the screen. I created my own xib file with the keyboard, and everything seems to work fine, except that the upper half of the screen is not transparen

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 19:07, Paul Sanders wrote: > > At the BSD layer, getattrlist() is the way to go here, with the > > ATTR_CMN_CRTIME attribute. > > From > http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html: > > "Not all volumes support geta

Re: Using popup to select table items to display (Core Data app)

2010-05-23 Thread Jerry Krinock
On 2010 May 23, at 09:07, Paul Johnson wrote: > I'm looking for an example of the use of a popup menu to determine the array > items to display in a tableview. I'm trying to use Core Data and do this in > Interface Builder as much as possible. I can't think of any sample code to show exactly thi

Re: Core Data NSPopUpButtonCell and NSNumber

2010-05-23 Thread James Maxwell
Thanks Fritz, But I'm doing this directly from the entities. I could generate the classes, and add the changes you've suggested, though. I might do that down the road, but what I did seems to be working. cheers, J. On 2010-05-23, at 10:39 AM, Fritz Anderson wrote: > On 23 May 2010, at 12:11

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> At the BSD layer, getattrlist() is the way to go here, with the > ATTR_CMN_CRTIME attribute. >From >http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html: "Not all volumes support getattrlist(). The best way to test whether a volume supports

Re: Core Data NSPopUpButtonCell and NSNumber

2010-05-23 Thread James Maxwell
ah, okay. I got it. Just in case anyone has the same problem in future (probably not, I suppose!), here's what I did: 1) instantiate the desired NSArray of NSNumbers in your controller class 2) create a NSArrayController with the Attribute set to NSNumber and a key for intValue (not sure if the

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 18:39, Paul Sanders wrote: >> Yes, although the stat structure only has the st_birthtimespec field if you >> build with 64-bit inodes enabled. This is the default on Snow Leopard or >> for 64-bit, but not for 32-bit on Leopard or earlier. > > I'm not certain, but I think you

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> Yes, although the stat structure only has the st_birthtimespec field if you > build with 64-bit inodes enabled. This is the default on Snow Leopard or > for 64-bit, but not for 32-bit on Leopard or earlier. I'm not certain, but I think you have to use stat64 in 32 bit Leopard builds to get st

Re: Core Data NSPopUpButtonCell and NSNumber

2010-05-23 Thread Fritz Anderson
On 23 May 2010, at 12:11 PM, James Maxwell wrote: > This shouldn't be a difficult problem, but how do I make a NSPopUpButtonCell > load a list of numbers, and return the value of the number when selected? > Originally I used a ComboBox, with pre-programmed values from IB, but it > returned stri

Core Data NSPopUpButtonCell and NSNumber

2010-05-23 Thread James Maxwell
This shouldn't be a difficult problem, but how do I make a NSPopUpButtonCell load a list of numbers, and return the value of the number when selected? Originally I used a ComboBox, with pre-programmed values from IB, but it returned strings, not NSNumbers. This really should be simple, and maybe

Using popup to select table items to display (Core Data app)

2010-05-23 Thread Paul Johnson
I'm looking for an example of the use of a popup menu to determine the array items to display in a tableview. I'm trying to use Core Data and do this in Interface Builder as much as possible. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: scriptability of button in interface?

2010-05-23 Thread Matt Neuburg
On Fri, 21 May 2010 18:05:00 +0530, Dan Ribe said: >Hi All, > >I am working on to make my cocoa application scriptable. I want to automate >the testing of my application and for that I want all the actions which user >can performs manually to be scriptable. Like apple script should be able to >ope

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
Hi Ken, Thanks, that works, problem solved. FSGetCatalogInfo (&ref, kFSCatInfoCreateDate.. is a better option to obtain creation date when you need to get NTFS file's date too. Thanks to all responded, Angelo. --- 2010年5月23日 星期日,Ken Thomases 寫道﹕ 寄件人: Ken Thomases 主題: Re: getting file creation

Re: Determine if a document is "new"

2010-05-23 Thread Martin Hewitson
I believe you might be looking for: - (id)initWithType:(NSString *)typeName error:(NSError **)outError which you can implement in your NSPersistentDocument subclass. I've done it this way before; I also did the following steps to give the user a new document that has no changes: 1) disable und

Determine if a document is "new"

2010-05-23 Thread Bryan Zarnett
I have a Document-based core data application ( from template). I would like to determine in "MyDocument" if the file is new -- has no content so that I can populate a few of the models with required default data. I was wondering what is the base way to approach this? I didn't see any particula

Re: getting file creation date from NTFS

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 5:33 AM, Angelo Chen wrote: > I think FSGetCatalogInfo (&ref, kFSCatInfoCreateDate, &info, NULL, NULL, > NULL); info.createDate has the creation date, can see it clearly in debugger, > problem is, how to convert it into NSDate You should use UCConvertUTCDateTimeToCFAbsoluteT

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
Hi, I think FSGetCatalogInfo (&ref, kFSCatInfoCreateDate, &info, NULL, NULL, NULL); info.createDate has the creation date, can see it clearly in debugger, problem is, how to convert it into NSDatefollowing code taken from net works with UTC dates from OS X or FAT files, but not working with NTFS

Re: getting file creation date from NTFS

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 4:19 AM, Paul Sanders wrote: > Assuming that these figures come from stat (man -S 2 stat for details), it > should be in something called st_birthtime. Yes, although the stat structure only has the st_birthtimespec field if you build with 64-bit inodes enabled. This is the

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
Assuming that these figures come from stat (man -S 2 stat for details), it should be in something called st_birthtime. st_atime refers to the last time the file was accessed. So, either call stat yourself or, better perhaps, go via the file manager: http://developer.apple.com/mac/library/DOCUM

nsprogressindicator change color

2010-05-23 Thread Rick C.
Hello, I'm trying to change the color of a determinate spinning style NSProgressIndicator similar to what happens in Mail.app when a row is selected in the left pane. Thing is I've had no luck getting -setControlTint to work and I've tried to subclass NSProgressIndicator but it seems I must tr