Re: API for fetching the computer name in cocoa

2009-06-11 Thread Gerriet M. Denkmann
On 11 Jun 2009, at 18:55, Graham Cox wrote: On 12/06/2009, at 2:08 AM, Arun wrote: Hi All, Is there any API in cocoa which can be used to fetch computer name which is getting displayed in Finder? I'm not sure if there's a better way, but you can use the Gestalt function with the gestaltUs

Re: Positioning of autocomplete popups

2009-06-11 Thread Dave Robertson
Ross, Thanks for your comments. I agree the autocomplete popup looks curiously unpolished compared to other system popup menus. I've implemented the approach you suggest, and can populate an NSPopuButton menu with my completion candidates. This works well up until the user types another ch

NSView directly drawn on screen?

2009-06-11 Thread John Ku
What I am trying to achieve is like CoverSutra's: screenshot1.png A menu bar pop up menu where there is key/responder event but yet doesn't switch away from the current running application. I experiemented with various NSWi

Re: NSFontPanelValidation broken?

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 20:20, David Reitter wrote: Why does the following not have the desired effect? - (unsigned int) validModesForFontPanel:(NSFontPanel *)fontPanel { /* This doesn't work as intended. Why? Bug? */ return (NSFontPanelFaceModeMask | NSFontPanelSizeModeMask |

Re: UINavigationController for desktop Cocoa?

2009-06-11 Thread Kevin Callahan
On Jun 11, 2009, at 6:38 PM, Houdah - ML Pierre Bernard wrote: Hi! Has anyone already re-implemented UINavigationController for desktop Cocoa. That should be a cool thing to have. Pierre Tweetie? http://www.atebits.com/tweetie-mac/ http://www.atebits.com/tweetie-mac/teaser.html Kevin ht

Re: UINavigationController for desktop Cocoa?

2009-06-11 Thread Luke the Hiesterman
Seems a little weird on the desktop. The whole point of the navigationController is to provide a solution to the problem that a small phone screen isn't good at showing more than one task at a time. We don't really have that problem on the desktop.what exactly do you want to do? Luke

Re: Questions on using using modal sheets with Core Data

2009-06-11 Thread Dave Fernandes
This is explained in the NSPersistentDocument tutorial in the docs. On Jun 11, 2009, at 10:03 PM, Kevin Ross wrote: Hi all, have a Core Data document based application which uses modal sheets as a way for the user to edit the document's data. What is the best way to give the sheet the abili

NSFontPanelValidation broken?

2009-06-11 Thread David Reitter
Why does the following not have the desired effect? - (unsigned int) validModesForFontPanel:(NSFontPanel *)fontPanel { /* This doesn't work as intended. Why? Bug? */ return (NSFontPanelFaceModeMask | NSFontPanelSizeModeMask | NSFontPanelCollectionModeMask | NS

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 18:05, Brad Gibbs wrote: Why not just use a singleton [[MainWindowController sharedWindowController] switchToView:[menuItems objectAtIndex: [menuItemsArrayController selectionIndex]] ? There's nothing wrong with that approach, though it's not perhaps what might be under

Re: Questions on using using modal sheets with Core Data

2009-06-11 Thread Kevin Ross
Jeez, I forgot to explain that posting the notification would happen when the user accepts the changes made in the modal window. I hope it make a little more sense now. Thanks, Kevin On Jun 11, 2009, at 7:03 PM, Kevin Ross wrote: Hi all, have a Core Data document based application which

Questions on using using modal sheets with Core Data

2009-06-11 Thread Kevin Ross
Hi all, have a Core Data document based application which uses modal sheets as a way for the user to edit the document's data. What is the best way to give the sheet the ability to operate on a copy of the data with the parents sheet's undo context? And how best to merge these changes wit

UINavigationController for desktop Cocoa?

2009-06-11 Thread Houdah - ML Pierre Bernard
Hi! Has anyone already re-implemented UINavigationController for desktop Cocoa. That should be a cool thing to have. Pierre - - - Houdah Software s. à r. l. http://www.houdah.com HoudahGeo: One-stop photo geocoding HoudahSpot: Powerful Spotlight frontend _

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Peter N Lewis
On 11/06/2009, at 18:41 , Jo Meder wrote: It would be great to be able to do this for NSViews but I haven't been able to find any equivalent. Are there any ingenious ways that you might be aware of so I could bolt this on to NSView? I have yet to find a good solution to this. It would be fa

Re: Displaying an offset image. (SOLVED)

2009-06-11 Thread Mac First
Sheesh! I'm sorry -- I guess I just need to learn to read. --- "Translates the receiver’s coordinate system so that its origin moves to a new location. [I stopped reading here and got confused. The Discussion section explains all.] - (void)translateOriginToPoint:(NSPoint)newOr

Re: Displaying an offset image. (Partial fix)

2009-06-11 Thread Mac First
Ok, I took a stab at translateOriginToPoint earlier, but it didn't do what I wanted, so I went down the path shown in my previous message, below. I'm now back to using translateOriginToPoint, but... CGPoint startPoint = CGPointMake(-300, 200); [imageView translateOriginToPoint:NSPo

Re: trimbox and bleedbox from PDF

2009-06-11 Thread John Calhoun
On Jun 11, 2009, at 2:55 PM, gMail.com wrote: I would need to get the trimbox rect and bleedbox rect from a pdf document. Is anyone who can point me to the right APIs and procedures? Thanks. You want to create either a PDFDocument (part of PDF Kit .. Cocoa) or a CGPDFDocumentRef (CoreGraphi

Displaying an offset image.

2009-06-11 Thread Mac First
I have a 500x500 image. It's really a 5x5 array of 100x100 image tiles. I have a 100x100 NSView, imageParentView. I have a 500x500 NSImageView ("image well" in IB), "imageView" that is a subview of imageParentView and which holds my image. I'd like to display the 3rd tile in the 2nd row, so

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Brad Gibbs
hmm... Sounds like a clever solution. On Jun 11, 2009, at 4:30 PM, Kyle Sluder wrote: On Thu, Jun 11, 2009 at 3:53 PM, Brad Gibbs wrote: I have a single window application. It's a Core Data, non-document- based app. At launch, the appDelegate loads the mainWindowController, which control

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Kyle Sluder
On Thu, Jun 11, 2009 at 3:53 PM, Brad Gibbs wrote: > I have a single window application.  It's a Core Data, non-document-based > app.  At launch, the appDelegate loads the mainWindowController, which > controls the app's only window.  In the main window, there are three views > -- a status bar acro

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 15:53, Brad Gibbs wrote: I had been manually instantiating the view controllers and passing references to the main window controller and the main managed object context with a custom init method ( initWithMoc: andWindowController:) and using these arguments to set variab

Re: UTI not identified correctly for some users.

2009-06-11 Thread Mitchell Livingston
As a followup to this, it appears that the users having problems do have a different app set for this file type, so it's not recognizing my UTI name for NSOpenPanel's setRequiredType: and NSWorkspace's typeOfFile:... Is there a way around this besides specifying the file extension explicitl

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Brad Gibbs
Hi, Thanks for the response. I was trying to make the post short, hoping to up my chances of getting someone to read through the entire thing and take the time to respond. I guess I just made it confusing. So, now for the long(er) version. I have a single window application. It's a Core

UTI not identified correctly for some users.

2009-06-11 Thread Mitchell Livingston
I have created an UTI in my app's Info.plist. For open panels, adding files, etc. I use this (or check [[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: ...]). This works fine for me, but this is failing for the proper file type for some users. Perhaps the syste

Re: How to tell if a Panel is Open [solved]

2009-06-11 Thread K. Darcy Otto
Thanks to those who helped me with this question. The solution was to use NSWindow's -attachedSheet method, and (in my case), check for nil. If nil, there is no attached sheet; if not nil, there is an attached sheet. ___ Cocoa-dev mailing list (

Re: self Changes on Open Panel [solved]

2009-06-11 Thread K. Darcy Otto
I want to thank Fritz, Greg, Quincy and Uli for their help solving this problem. I don't think there is any general solution to this problem, but I wanted to make two remarks that might help others who run into something similar. (i) It turned out that i did have two different MyDocument o

trimbox and bleedbox from PDF

2009-06-11 Thread gMail.com
Hi, I would need to get the trimbox rect and bleedbox rect from a pdf document. Is anyone who can point me to the right APIs and procedures? Thanks. Best Regards -- LL ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin r

Re: App does not start on a different machine

2009-06-11 Thread Andy Lee
On Thursday, June 11, 2009, at 03:01PM, "Bill Monk" wrote: >Cmd-Shift-F, type "objectAtIndex", make sure the search options popup >is set to "In Project," hit Return. In the resulting list, look at >each found occurrence of "objectAtIndex". Option-click on >"objectAtIndex" to bring up its do

Re: Frame Origin Problem

2009-06-11 Thread Chunk 1978
should this code work? if there don't appear to be any errors i'm concerned it may be a bug, but i can't be sure. :-/ On Thu, Jun 11, 2009 at 7:15 AM, Chunk 1978 wrote: > while dragging (touching) a view, i'm trying to anchor the view in the > center of the screen and resize the view's width and

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 11:52, Brad Gibbs wrote: In short, I need a more reliable way to pass references to my MainWindowController into objects that are awaking from nib files. Trying to set the mMainWindowController variable to self.view.window.windowController in the awakeFromNib method see

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Brad Gibbs
Also, if I drop an object into the MainWindowController's nib file and that object is also the File's Owner for another nib file, won't the awakeFromNib method for that object be called twice? I'm doing some fetching in awakeFromNib methods to fetch information that needs to load as the vi

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Brad Gibbs
Well, I've got about 20+ different view controllers I was trying to avoid dropping all of those into the main window controller's nib file. Maybe that's what I need to do, though. I was taking self.view.window.windowController, which was working fine, as long as it was being called af

Re: App does not start on a different machine

2009-06-11 Thread Bill Monk
The debugging suggestions made so far in this thread are fine. But really, the only debugging tool needed here is your mind. Developing that tool is the quickest route to fixing bugs like this. 11.06.09 04:24:30 test[767] *** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0) 11.06.0

Re: Passing References During Initialization / Nib Loading

2009-06-11 Thread Kyle Sluder
On Thu, Jun 11, 2009 at 11:52 AM, Brad Gibbs wrote: > Is there something I'm missing? It sounds like you're going about it wrong. Create outlets on your objects and wire them up to your window controller, which should be the File's Owner of the nib. No "passing references" required. --Kyle Slud

Passing References During Initialization / Nib Loading

2009-06-11 Thread Brad Gibbs
Hi, In short, I need a more reliable way to pass references to my MainWindowController into objects that are awaking from nib files. Trying to set the mMainWindowController variable to self.view.window.windowController in the awakeFromNib method seems to be happening before the MainWindo

Re: Photoshop plugin with Cocoa UI problems

2009-06-11 Thread Frederik Slijkerman
Hi Scott, I was calling [NSApp stopModal] instead of abortModal. I did verify though that the modal loop stopped, and the original [NSApp runModalForWindow] call returned, finally returning to Photoshop. But perhaps there is a difference between stopModal and abortModal here. Best regards, F

Re: Get application path by Bundle ID

2009-06-11 Thread Mr. Gecko
Thanks, I thought it might be in NSWorkSpace but I kept looking into NSBundle. On Jun 11, 2009, at 1:15 PM, Dave DeLong wrote: -[NSWorkspace absolutePathForAppBundleWithIdentifier:]; Cheers, Dave On Jun 11, 2009, at 11:14 AM, Mr. Gecko wrote: Hello, I'm trying to find a way to find an app

Re: Get application path by Bundle ID

2009-06-11 Thread Dave DeLong
-[NSWorkspace absolutePathForAppBundleWithIdentifier:]; Cheers, Dave On Jun 11, 2009, at 11:14 AM, Mr. Gecko wrote: Hello, I'm trying to find a way to find an application path by the ID of the application. For an example if I wanted to find iTunes I give it the id of com.apple.iTunes and i

Get application path by Bundle ID

2009-06-11 Thread Mr. Gecko
Hello, I'm trying to find a way to find an application path by the ID of the application. For an example if I wanted to find iTunes I give it the id of com.apple.iTunes and it gives me the path. Thanks for any tips/help, Mr. Gecko ___ Cocoa-dev mai

Re: Doc kind from extension

2009-06-11 Thread Bill Monk
On Jun 11, 2009, at 11:55 AM, Sidney San Mart?n wrote: That'll work in most cases, but as discussed in http://lists.apple.com/archives/carbon-dev/2007/Nov/msg00642.html anything that Preview can open will just return Preview Document for that call. I just double-checked - I have an app that

Re: Weird race condition affecting bindings.

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 10:35, Mac First wrote: What's the preferred way to show a bunch of images and allow the user to select one? :) Possibly IKImageBrowser? I've only worked through its tutorial, never used it for real, so I don't know if it jumps off the same cliff that NSCollectionView

Re: Weird race condition affecting bindings.

2009-06-11 Thread Mac First
On Jun 11, 2009, at 10:20 AM, Quincey Morris wrote: On Jun 11, 2009, at 07:43, Mac First wrote: I can change things around to do them in a different order and get the error to come out for key 'KEY' instead of 'IMAGE', but it's basically the same problem. If I break on the code and examine

Re: program crashes because of a variable declaration

2009-06-11 Thread Scott Ribe
> Does anyone know how this could be? Yes, you are corrupting memory somewhere. Depending on the exact layout of objects (& ivars) in memory, this corruption may go unnoticed, or may cause a crash. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice _

Re: Weird race condition affecting bindings.

2009-06-11 Thread Quincey Morris
On Jun 11, 2009, at 07:43, Mac First wrote: I can change things around to do them in a different order and get the error to come out for key 'KEY' instead of 'IMAGE', but it's basically the same problem. If I break on the code and examine my array (the referencedObject), it's an array of d

Re: Photoshop plugin with Cocoa UI problems

2009-06-11 Thread Scott Andrew
What doesn't make sense is that the plugin i worked on was modal (it was an export plugin). What I noticed in our window does is a call abortModal on the windowWIllClose notification. From what i can see, from the messages in your original post, it looks like you are still in the modal loop

Re: Doc kind from extension

2009-06-11 Thread Kirk Kerekes
UTIs will get you there. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: Cocoa-dev Digest, Vol 6, Issue 858

2009-06-11 Thread Bill Monk
On Jun 11, 2009, at 10:52 AM, Micha Fuhrmann wrote: Unfortunately all I can feed it with is the file extension Any other idea? Isn't there a mapping plist between extension and Kind that exists somewhere? Have you tried LSCopyKindStringForTypeInfo(), LSCopyKindStringForRef (), or their

Re: API for fetching the computer name in cocoa

2009-06-11 Thread Greg Guerin
Arun wrote: Is there any API in cocoa which can be used to fetch computer name which is getting displayed in Finder? CSCopyMachineName -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderato

Growing UITextView in UITableView

2009-06-11 Thread Arie Pieter Cammeraat
I'm trying create a UITableView like the one Apple uses for composing an email in its mail app. As far as I know, it is a UITableView with UITextView for the mailmessage. There has been written a lot about this topic yet, but I haven't found the solution for my problem. I managed to only

Weird race condition affecting bindings.

2009-06-11 Thread Mac First
I have what looks like an odd race condition surrounding my bindings. I have an NSCollectionView that is a list of images. I believe all of the bindings to be hooked up correctly (and code-reviewed by 2 other engineers familiar with NSCollectionViews.) Some code snippets: --- @i

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Ken Ferry
On Thu, Jun 11, 2009 at 3:41 AM, Jo Meder wrote: > Hi, > > I'm pretty sure I know the answer to this question, but I'll ask it anyway > :-)... > > Is there a Cocoa equivalent to Carbon's Get|SetControlProperty() family of > functions? For those not familiar these functions let you associate user

Re: Photoshop plugin with Cocoa UI problems

2009-06-11 Thread Frederik Slijkerman
Hi Scott, I'm already doing all of that (I studied your earlier post in the message archive), but it looks like the modal window was the problem, see my other message. Thanks anyway! Best regards, Frederik Slijkerman Scott Andrew wrote: Make sure your C function calls NSApplicationLoad() th

Re: API for fetching the computer name in cocoa

2009-06-11 Thread Sidney San Martín
You can use the System Configuration framework to retrieve the computer name: NSString *computerName = [(NSString*)SCDynamicStoreCopyComputerName(NULL, NULL) autorelease]; -Sidney On Thu, Jun 11, 2009 at 12:08 PM, Arun wrote: > Hi All, > > Is there any API in cocoa which can be used to fetch co

Re: Photoshop plugin with Cocoa UI problems

2009-06-11 Thread Frederik Slijkerman
Hi Florian, I just tried this and oddly enough, when I show the window like this and call [NSApp run] to start the event loop, the crash doesn't seem to occur. Can't say 100% sure yet, because it doesn't happen all the time, but it hasn't happened yet, while I can easily get the crash using a

Re: Doc kind from extension

2009-06-11 Thread Sidney San Martín
That'll work in most cases, but as discussed in http://lists.apple.com/archives/carbon-dev/2007/Nov/msg00642.html anything that Preview can open will just return Preview Document for that call. On Thu, Jun 11, 2009 at 12:07 PM, Ken Thomases wrote: > > I missed the earlier part of this discussion,

Re: Carbon Boolean

2009-06-11 Thread Nick Zitzmann
On Jun 11, 2009, at 10:12 AM, Matt Neuburg wrote: What is a (Carbon) Boolean and how do I convert it to a Cocoa BOOL (regardless of architecture)? They're exactly the same size on all architectures; only the signature is different (BOOL is signed, Boolean isn't). Nick Zitzmann

Re: Carbon Boolean

2009-06-11 Thread Graham Cox
On 12/06/2009, at 2:12 AM, Matt Neuburg wrote: What is a (Carbon) Boolean and how do I convert it to a Cocoa BOOL (regardless of architecture)? Thx - m. A Boolean is an unsigned char and a BOOL is a signed char. Since both define false as 0 and true as !0, you can simply cast one to the o

Re: program crashes because of a variable declaration

2009-06-11 Thread Andy Lee
On Thursday, June 11, 2009, at 10:28AM, "Martin Batholdy" wrote: >There are no compiler warnings in the code. > > >this is printed in the debugger console; Once again: show us the code that is crashing. I don't know how to put it any more simply. Most of the time (though not 100%) this is the

Re: API for fetching the computer name in cocoa

2009-06-11 Thread Graham Cox
On 12/06/2009, at 2:08 AM, Arun wrote: Hi All, Is there any API in cocoa which can be used to fetch computer name which is getting displayed in Finder? I'm not sure if there's a better way, but you can use the Gestalt function with the gestaltUserVisibleMachineName selector. --Graham

Re: Doc kind from extension

2009-06-11 Thread Sidney San Martín
How about this? CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, CFSTR("pdf"), NULL); NSString *name = [(NSString*)UTTypeCopyDescription(UTI) autorelease]; CFRelease(UTI); // name is now "Portable Document Format (PDF)" -Sidney On Thu, Jun 11, 2009 at 11:47 A

Carbon Boolean

2009-06-11 Thread Matt Neuburg
What is a (Carbon) Boolean and how do I convert it to a Cocoa BOOL (regardless of architecture)? Thx - m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ pantes anthropoi tou eidenai oregontai phusei Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf AppleScript: the D

Re: Foundation tool & NSUserDefault

2009-06-11 Thread Nick Zitzmann
On Jun 11, 2009, at 5:19 AM, KK wrote: I am writing a "Foundation tool" - a command-line utility that uses Objective-C and the Foundation framework, and I'm trying to save preferences under the application domain.. My understanding is that you would need a bundle identifier to do this, but

API for fetching the computer name in cocoa

2009-06-11 Thread Arun
Hi All, Is there any API in cocoa which can be used to fetch computer name which is getting displayed in Finder? Thanks Arun ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Co

Re: Stepping the event loop?

2009-06-11 Thread Kyle Sluder
On Thu, Jun 11, 2009 at 4:04 AM, Jo Meder wrote: > Are there any other ways to step the event loop manually in Cocoa? -[NSRunLoop runMode:beforeDate:] ? --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Re: Doc kind from extension

2009-06-11 Thread Ken Thomases
On Jun 11, 2009, at 10:47 AM, Micha Fuhrmann wrote: Unfortunately all I can feed it with is the file extension Any other idea? Isn't there a mapping plist between extension and Kind that exists somewhere? I missed the earlier part of this discussion, but does LSCopyKindStringForTypeIn

Re: Doc kind from extension

2009-06-11 Thread Kyle Sluder
On Thu, Jun 11, 2009 at 8:47 AM, Micha Fuhrmann wrote: > Any other idea? Isn't there a mapping plist between extension and Kind that > exists somewhere? You might want to read this document: http://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/understand_utis_intro/underst

Re: Doc kind from extension

2009-06-11 Thread Micha Fuhrmann
Unfortunately all I can feed it with is the file extension Any other idea? Isn't there a mapping plist between extension and Kind that exists somewhere? Michael On 11 juin 09, at 16:09, Graham Cox wrote: On 11/06/2009, at 11:50 PM, Micha Fuhrmann wrote: Anyone knows how to get the s

Re: NSString becoming invalid

2009-06-11 Thread Michael Ash
On Thu, Jun 11, 2009 at 9:53 AM, McLaughlin, Michael P. wrote: > In an Xcode (3.1.2) Cocoa document app targeting 10.5, I read an NSString > from an XML file and store it, eventually, in a C++ struct as > > NSString *fname; > > This works most of the time but, sporadically, I get a BAD_ACCESS crash

NSSearchField that shows search results

2009-06-11 Thread Dado Colussi
Hi, I would like to have an search field that shows the matching objects in a table/menu below the search field as I type in the search string. Is anyone aware of an open source implementation of such a control, or is there an easy way to do it with NSSearchField? Thanks! /Dado __

Re: program crashes because of a variable declaration

2009-06-11 Thread Graham Cox
On 12/06/2009, at 12:28 AM, Martin Batholdy wrote: It is pretty strange to me. I changed something in another file that has nothing to do with the file that I am having problems with and now it works ... Does anyone know how this could be? Of course not, since we haven't seen one shred of

Re: SQLite -- same DB, different machines -> different results

2009-06-11 Thread Gregory Weston
Timofey wrote: I've written the alfa of my first app on the Mac which works in an acceptable manner on my macbook. But when i run it on my iMac, it returns different results for the in seemingly the same conditions. The application is a dictionary. As the user types a word into the searchfield,

Re: program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy
ok, I am sorry. It's rare that an app crashes silently. Is anything printed to the console? Do you have a crash log? If you run the app in the debugger, what line of code does it crash on? Also, are there any compiler warnings that you are ignoring? There are no compiler warnings in

Re: Doc kind from extension

2009-06-11 Thread Graham Cox
On 11/06/2009, at 11:50 PM, Micha Fuhrmann wrote: Anyone knows how to get the system doc kind from a given extension. Not from a file, or a file path for that matter, but just from an extension. Like giving "pdf" and receiving "Portable Document Format (PDF). I've tried NSString * theTes

NSString becoming invalid

2009-06-11 Thread McLaughlin, Michael P.
In an Xcode (3.1.2) Cocoa document app targeting 10.5, I read an NSString from an XML file and store it, eventually, in a C++ struct as NSString *fname; This works most of the time but, sporadically, I get a BAD_ACCESS crash with an indication that fname has become invalid. The only explanation

Doc kind from extension

2009-06-11 Thread Micha Fuhrmann
Anyone knows how to get the system doc kind from a given extension. Not from a file, or a file path for that matter, but just from an extension. Like giving "pdf" and receiving "Portable Document Format (PDF). I've tried NSString * theTest = [[NSDocumentController sharedDocumentController]

Re: program crashes because of a variable declaration

2009-06-11 Thread Andy Lee
On Jun 11, 2009, at 9:38 AM, Martin Batholdy wrote: But it crashes on startup when I add something like; @interface AppleScriptHandler : NSObject { NSDictionary *errorInfo; NSArray *test; NSString *appFolder, *filePathFinderFiles; } It's rare that an app crashes s

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Graham Cox
On 11/06/2009, at 11:43 PM, Michael Vannorsdel wrote: Subclass NSView and use poseAsClass to replace the default implementation. You'll need to do the posing before running NSApplicationMain. You'll have to use a different approach if you're building for 64-bit. Note that poseAsClass

Re: program crashes because of a variable declaration

2009-06-11 Thread Graham Cox
On 11/06/2009, at 11:38 PM, Martin Batholdy wrote: my program crashes if I add a variable declaration to a header file. I really don't understand what the hell is wrong with it; Is this the same problem as your earlier post? It seems like maybe you're trying to do stuff with NSObjects befo

Re: program crashes because of a variable declaration

2009-06-11 Thread Clint Shryock
can you post the error message? I can't reproduce this On Thu, Jun 11, 2009 at 8:38 AM, Martin Batholdy wrote: > Hi, > > my program crashes if I add a variable declaration to a header file. > I really don't understand what the hell is wrong with it; > > > The programm works fine with this lines;

Re: Outlets not allocated

2009-06-11 Thread Micha Fuhrmann
Ok, I understand now. Thanks to you all. Michael On 11 juin 09, at 07:37, Kevin Cathey wrote: I know I could set the string in objects and on awakeFromNib set the text fields, but it just seems inefficien We encourage you to use the controller's controller specific methods for knowing whe

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Michael Vannorsdel
Subclass NSView and use poseAsClass to replace the default implementation. You'll need to do the posing before running NSApplicationMain. You'll have to use a different approach if you're building for 64-bit. On Jun 11, 2009, at 7:25 AM, Jo Meder wrote: Hi Graham, On 11/06/2009, at 11

program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy
Hi, my program crashes if I add a variable declaration to a header file. I really don't understand what the hell is wrong with it; The programm works fine with this lines; @interface AppleScriptHandler : NSObject { NSDictionary *errorInfo; NSString *appFolder, *filePathFinderFi

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Graham Cox
On 11/06/2009, at 11:25 PM, Jo Meder wrote: It's not really so simple, because I'd have to subclass all the views/controls I use, which is many of the UI elements available, and that means I have many disparate classes implementing the same functionality. Of course I then need to repeat th

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Jo Meder
Hi Graham, On 11/06/2009, at 11:50 PM, Graham Cox wrote: The carbon mechanism exists because in classical procedural code, you can't subclass an "object" because there is no formal "object" to subclass. Therefore storage mechanisms have to be provided to hang extra stuff on. It's still j

Re: SQLite -- same DB, different machines -> different results

2009-06-11 Thread Andy Lee
I guess I would ask the same question I asked another recent poster: is there some reason you can't install the dev tools on the iMac and use them to debug the problem? It's *your* iMac, right? Not some customer's machine that you don't have access to? If installing the dev tools is not a

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Graham Cox
On 11/06/2009, at 8:41 PM, Jo Meder wrote: I'm pretty sure I know the answer to this question, but I'll ask it anyway :-)... Is there a Cocoa equivalent to Carbon's Get|SetControlProperty() family of functions? For those not familiar these functions let you associate user data with contr

Foundation tool & NSUserDefault

2009-06-11 Thread KK
Hello, I am writing a "Foundation tool" - a command-line utility that uses Objective-C and the Foundation framework, and I'm trying to save preferences under the application domain.. My understanding is that you would need a bundle identifier to do this, but if it's just a tool, can it have a bundl

Frame Origin Problem

2009-06-11 Thread Chunk 1978
while dragging (touching) a view, i'm trying to anchor the view in the center of the screen and resize the view's width and height based on the drag, but it's flashes all crazy and i can't figure out why it's doing so. i think it has to do with the resetting of the origin because if i set the orig

Stepping the event loop?

2009-06-11 Thread Jo Meder
Hi, Although I'm ashamed to admit it, there are certain parts of our application that rely on stepping the event loop "manually" to maintain interactivity during intensive processing. It actually worked pretty well. Eventually I would hope that all such processing can be moved off onto se

Re: Get|SetControlProperty() equivalent

2009-06-11 Thread Michael Vannorsdel
Generally you subclass the control and implement whatever data association you want. On Jun 11, 2009, at 4:41 AM, Jo Meder wrote: I'm pretty sure I know the answer to this question, but I'll ask it anyway :-)... Is there a Cocoa equivalent to Carbon's Get|SetControlProperty() family of

Get|SetControlProperty() equivalent

2009-06-11 Thread Jo Meder
Hi, I'm pretty sure I know the answer to this question, but I'll ask it anyway :-)... Is there a Cocoa equivalent to Carbon's Get|SetControlProperty() family of functions? For those not familiar these functions let you associate user data with controls. I've never really used this for m

SQLite -- same DB, different machines -> different results

2009-06-11 Thread Тимофей Даньшин
Hello. I've written the alfa of my first app on the Mac which works in an acceptable manner on my macbook. But when i run it on my iMac, it returns different results for the in seemingly the same conditions. The application is a dictionary. As the user types a word into the searchfield, he

How to Access NSArrayController Contents in NSCollectionView Views?

2009-06-11 Thread Bryan Marty
I am currently have trouble trying to understand how to access objects in an NSArrayController in conjunction with a NSCollectionView. I have a class entitled: "VCMovieObjects", which contains information on a specific video clip. These objects are loaded into an NSArrayController, which is

Re: Drop dowm status menubar item while hovering cursor over it

2009-06-11 Thread Michael Vannorsdel
What Mr. Farmer was saying is this problem is a known bug with no workaround or quick fix. You will have to wait for Apple to fix this in a future system update. There is nothing you can do to your application to make this work properly. If you make a separate status item plugin, that wil

Re: Drop dowm status menubar item while hovering cursor over it

2009-06-11 Thread Gami Ravi
Oh, what he's asking is why you can't single-click to drop down one menu, then switch over to a statusbar item's menu without clicking again. This behavior is common to all status bar items, and is arguably a bug. You can try reporting it to Apple, but it's unlikely to be fixed for a while

Re: App does not start on a different machine

2009-06-11 Thread Jean-Daniel Dupas
What about retrieving the crash log in ~/Library/Logs ? Le 11 juin 09 à 06:11, Nick Zitzmann a écrit : On Jun 10, 2009, at 8:35 PM, Martin Batholdy wrote: 11.06.09 04:24:15 com.apple.launchd[66] ([0x0-0x53053].com.yourcompany. test[762]) Exited abnormally: Trace/ BPT trap 11.06.09 04:24: