Re: creating and using a View xib

2008-06-10 Thread David Wilson
On Wed, Jun 11, 2008 at 2:47 AM, Jerry Isdale <[EMAIL PROTECTED]> wrote: > I had thought there would be a way to use IB to place the view into the > window (or tabs). > Now I think that is incorrect, and I will need to programmatically load the > nib file and place its contents in the window someho

Re: creating and using a View xib

2008-06-10 Thread Jerry Isdale
I understand and appreciate the use of a XIB vs NIB, but that doesnt help me understand how to use either. When I build a XIB/NIB containing a (custom) View + controller, how do I incorporate that into other views and windows? In ObjC code for that other view/window controller? How does it get

Re: Updating a progress bar from a code loop

2008-06-10 Thread Adam Leonard
I think you should definitely try to get the loop working in another thread. I know it can be tricky, especially if you are dealing with some thread unsafe classes, but it is worth it and will likely be very beneficial in the future. (On an utterly unrelated aside, this looks interesting: h

Re: Updating a progress bar from a code loop

2008-06-10 Thread Graham Cox
On 11 Jun 2008, at 2:40 pm, j o a r wrote: On Jun 10, 2008, at 3:17 AM, Graham Cox wrote: though out of curiosity I wonder if there is a way to do this "cooperatively" on the main thread without having to break up the loop doing the actual work. For example, in Carbon one can run the ev

Issue with displaying URI prefixes on child elements using NSXML

2008-06-10 Thread Lawrence Johnston
Hey everybody, I've got an issue that I can't figure out. If I'm using this code: NSString *XMLForDisplay { NSXMLElement *root = [NSXMLNode elementWithName:@"root"]; [root addNamespace:[NSXMLNode namespaceWithName:@"a" stringValue:@"http://www.tempurl.com "]]; NSXMLElement *child = [NS

Re: crash on command-W

2008-06-10 Thread James W. Walker
On Jun 10, 2008, at 7:24 AM, Adam R. Maxwell wrote: On Jun 9, 2008, at 10:30 PM, James W. Walker wrote: On Jun 9, 2008, at 9:18 PM, Andrew Farmer wrote: On 09 Jun 08, at 21:03, James W. Walker wrote: OK, I turned on NSZombieEnabled, and now I get this in the log: *** -[LogController ta

Re: Updating a progress bar from a code loop

2008-06-10 Thread j o a r
On Jun 10, 2008, at 3:17 AM, Graham Cox wrote: though out of curiosity I wonder if there is a way to do this "cooperatively" on the main thread without having to break up the loop doing the actual work. For example, in Carbon one can run the event loop for a short period or just for one ev

Re: re-factoring a category into a class instance

2008-06-10 Thread Paul Archibald
Ooops, saw that go by and spaced out fixing it. I am just beginning with Cocoa, and the framework names are not that familiar yet. Thanks for the advice, Brian, especially the part about instantiating my controller in code. I figured it couldn't be too hard, but a little nudge in the right

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Ken Thomases
On Jun 10, 2008, at 3:57 AM, Rasmus Andersson wrote: Oh, just as I feared. The problem is the metadata itself is probably hundreds of gigabytes, if not terabytes in size, so it would be impossible to have mdimporter index "fake" files. If the _meta_data is really that large, then this is sort

Re: changing locale

2008-06-10 Thread Alexander Cohen
On Jun 10, 2008, at 8:50 PM, Douglas Davidson wrote: On Jun 10, 2008, at 5:42 PM, Alexander Cohen wrote: Thats what i though but here is my problem, and i'm sure im not the only who has it. I am currently working on localizing apps for mulitple languages. I would like to have an easy way

Re: Where are window prefs stored?

2008-06-10 Thread Ken Thomases
On Jun 10, 2008, at 4:21 AM, Ken Tozier wrote: My app opens several palettes and uses the following line to store the palette positions [[self window] setFrameAutosaveName: @""]; I ran into a problem with the stored size and want to flush the old prefs and start over. Where are these types

Re: A simple doubt about array

2008-06-10 Thread Jens Alfke
It would be a lot more efficient to implement a two-dimensional m-by-n array as a single NSArray with m*n elements. Then the object at (row,column) is the object at index row*width+column. That's basically how C implements multi-dimensional arrays. You can't make this accessor a simple cate

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Adam Leonard
Hi, I actually developed a plugin to do just that. It searches Google when a Spotlight search is run and generates files for the results live so they appear as results. It was a nasty Input Manager hack on Tiger, but I'm working on a new version on Leopard that should be much nicer. It is stil

Re: changing locale

2008-06-10 Thread Douglas Davidson
On Jun 10, 2008, at 5:42 PM, Alexander Cohen wrote: Thats what i though but here is my problem, and i'm sure im not the only who has it. I am currently working on localizing apps for mulitple languages. I would like to have an easy way to set the locale without going into the system prefs

Re: changing locale

2008-06-10 Thread Alexander Cohen
Thats what i though but here is my problem, and i'm sure im not the only who has it. I am currently working on localizing apps for mulitple languages. I would like to have an easy way to set the locale without going into the system prefs and trying once again to guess which settings i need

Re: launching standard apps with NSTask

2008-06-10 Thread Memo Akten
Ok Thanks, will check it out... Memo (Mehmet S. Akten) www.memo.tv [EMAIL PROTECTED] On 11 Jun 2008, at 01:20, Adam Leonard wrote: LaunchServices or NSWorkspace (which uses LS) is still probably your best option, as NSTask is not really designed to deal with GUI apps. To terminate the ap

Re: launching standard apps with NSTask

2008-06-10 Thread Brett Powley
There are a few ways of using Launch Services to find an application without needing to specify its URL. For example, you can find an application using its bundle ID using: FSRef fsRefApp; OSStatus err = LSFindApplicationForInfo( kLSUnknownCreator, CFSTR("au.com.foo.Bar")

Re: A simple doubt about array

2008-06-10 Thread Adam Leonard
If you do want to make use of some of the nice features of NSArray that C arrays don't have, it is trivial to add a category to NSArray that makes object retrieval easier. See http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_4_section_1.html An example imp

Re: launching standard apps with NSTask

2008-06-10 Thread Adam Leonard
LaunchServices or NSWorkspace (which uses LS) is still probably your best option, as NSTask is not really designed to deal with GUI apps. To terminate the app, you can send a quit apple event or use applescript. This has come up recently, so search the list archives. To detect when the user

Re: creating and using a View xib

2008-06-10 Thread Graham Cox
A .xib file is just a .nib file in a text format, so it is more compatible with svn. Xcode compiles the .xib into a .nib. So to edit one, use Interface Builder as usual. because a .xib *is* a .nib, you load it as you do a nib - loadNibNamed:owner: You don't have to do anything different from

Cocoa PDE validation

2008-06-10 Thread David Geering
Hi there, I'm trying to develop a Cocoa print dialog extension that requires a user to input a value. For arguments sake, imagine a PDE that requires a passphrase. I have an alert that pops up if the passphrase is missing, and this alert is displayed whether or not my PDE is ever selected/shown. O

Re: changing locale

2008-06-10 Thread Deborah Goldsmith
Not a supported way, no. We don't encourage applications to change system-wide settings. Deborah Goldsmith Apple Inc. [EMAIL PROTECTED] On Jun 10, 2008, at 8:05 AM, Alexander Cohen wrote: Is there a way to change the locale from cocoa as if i was to go into System Preferences and change the

creating and using a View xib

2008-06-10 Thread Jerry Isdale
I'm building up a rather complex UI and would like to design, build, test portions of it as stand alone applications (esp so I can pass subsections to others to build). Initially I started building the apps by creating new Cocoa apps in Xcode3 and using IB to tweak up the MainMenu.xib with

Re: launching standard apps with NSTask

2008-06-10 Thread Memo Akten
Hi, that looks great thanks, I've just been looking through the documentation, but I don't think it allows control over terminating the app, or detecting when its closed. I would like to have that level of control (just terminate, and detect if user close it) - which is why I was opting for

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Graham Cox
I don't think it's worth attempting. I *think* that gradients are cached in some way so trying to recalculate the gradient to span the update rect correctly is: a) going to need a fair bit of work to calculate and b) not allow caching to work efficiently. In any case, pixels that are clippe

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-10 Thread Graham Cox
Hi John, While I understand to some extent why you've done it this way, you've also managed to tie yourself in knots here. Sheets are slightly more complex than running an old-school modal dialog "inline" but they are not as complicated as you seem to have made them! The basic idea is tha

Re: launching standard apps with NSTask

2008-06-10 Thread Michael Vannorsdel
[[NSWorkspace sharedWorkspace] launchApplication:@"Safari"]; On Jun 10, 2008, at 4:55 PM, Memo Akten wrote: Hi all, i'm writing an app that launches some default apps like safari, itunes, iphoto etc using NSTask. I was wondering if there is a way of writing the launch url not fully hardcod

Re: launching standard apps with NSTask

2008-06-10 Thread Nick Zitzmann
On Jun 10, 2008, at 4:55 PM, Memo Akten wrote: Hi all, i'm writing an app that launches some default apps like safari, itunes, iphoto etc using NSTask. I was wondering if there is a way of writing the launch url not fully hardcoded but using some system variables / methods etc.? Take a

launching standard apps with NSTask

2008-06-10 Thread Memo Akten
Hi all, i'm writing an app that launches some default apps like safari, itunes, iphoto etc using NSTask. I was wondering if there is a way of writing the launch url not fully hardcoded but using some system variables / methods etc.? Memo (Mehmet S. Akten) www.memo.tv [EMAIL PROTECTED] __

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-10 Thread Jens Alfke
On 10 Jun '08, at 1:27 PM, Michael Ash wrote: If there were a synchronous API the code would have to somehow jump down the stack to where you're waiting for A, while somehow leaving the stuff that's waiting for B live farther up the stack. This is quite simply impossible in a C-based language.

Re: re-factoring a category into a class instance

2008-06-10 Thread Brian Stern
On Jun 10, 2008, at 5:05 PM, Paul Archibald wrote: Comrades: I am working on a file-handling Cocoa app that (at this point) has a single window. We are adding a second window (really sort of a non- modal dialog) to do some extra processing of the target files. The interface for the new wi

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Michael Watson
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 jus

Re: Mail Rule Actions Control

2008-06-10 Thread Scott Anguish
try searching in Xcode's documentation with full text mode http://developer.apple.com/samplecode/PredicateEditorSample/index.html is what I got. On Jun 10, 2008, at 1:16 PM, Steven Huey wrote: I'm looking to create a control or set of controls like the "actions" portion of a rule in Apple M

re-factoring a category into a class instance

2008-06-10 Thread Paul Archibald
Comrades: I am working on a file-handling Cocoa app that (at this point) has a single window. We are adding a second window (really sort of a non- modal dialog) to do some extra processing of the target files. The interface for the new window is already built (with IB), but is not hooked u

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-10 Thread Michael Ash
On Tue, Jun 10, 2008 at 1:10 PM, John Love <[EMAIL PROTECTED]> wrote: > I have chosen the title "Prevent Asynchronous operation of > beginSheetModalForWindow" because I use various calls to > beginSheetModalForWindow in many parts of my app code and in one case I need > the calls to didEndSelector

Re: applicationWillTerminate and asynchronous orderly shutdown

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 9:12 PM, Stuart Malin <[EMAIL PROTECTED]> wrote: > I have an app that establishes multiple TCP connections. If the user quits > the app, I'd like to shut all those connections gracefully (i.e., conduct a > bit of protocol) rather than just close them abruptly. To most prope

Re: Updating a progress bar from a code loop

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 11:17 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > In this case I can do that... though out of curiosity I wonder if there is a > way to do this "cooperatively" on the main thread without having to break up > the loop doing the actual work. For example, in Carbon one can run

Re: Garbage collector vs variable lifetime

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 4:28 PM, Charles Srstka <[EMAIL PROTECTED]> wrote: > I think the problem is that if NSArray has +[NSArray array] returning an > NSArray, then NSMutableArray has to return an NSArray also, since it can't > have a different method signature for the same method. As a result, i

Mail Rule Actions Control

2008-06-10 Thread Steven Huey
I'm looking to create a control or set of controls like the "actions" portion of a rule in Apple Mail. The new NSRuleEditor control in Leopard looks like it might be a good fit, but I can't find any sample code. Does anyone have any experiences with NSRuleEditor or code they're willing to s

applicationWillTerminate and asynchronous orderly shutdown

2008-06-10 Thread Stuart Malin
I have an app that establishes multiple TCP connections. If the user quits the app, I'd like to shut all those connections gracefully (i.e., conduct a bit of protocol) rather than just close them abruptly. To most properly handle this, I should even wait for the servers' responses. I am cu

Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-10 Thread John Love
Before I begin, I want to assure you that I have researched entries here on sheets, as well as those in MacTech.com. It's reasonably probable that I have missed some entries and so that is why I am asking for help. I also realize that this description is very long and I *really* did try to shorte

Tooltip and 10.4.11. Bug?

2008-06-10 Thread Stephane Sudre
Is there a known bug in Mac OS X 10.4.11 when it comes to tooltips attached to a NSTableView rows? I'm seeing tool tips being cut off when the mouse is over a row and a medium length string should be displayed in the tool tip. ___ Cocoa-dev mai

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Jonathan Dann
On 10 Jun 2008, at 17: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, t

Re: crash on command-W

2008-06-10 Thread Vijay Malhan
On Tue, Jun 10, 2008 at 7:54 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote: > On Jun 9, 2008, at 11:17 PM, James W. Walker wrote: > > On Jun 9, 2008, at 10:44 PM, Joseph Kelly wrote: >> >> Toggle the release when closed setting on the window nib? See the docs >>> for -[NSWindow setReleasedWhenCl

Re: Updating a progress bar from a code loop

2008-06-10 Thread Quincey Morris
On Jun 10, 2008, at 03:17, Graham Cox wrote: In this case I can do that... though out of curiosity I wonder if there is a way to do this "cooperatively" on the main thread without having to break up the loop doing the actual work. For example, in Carbon one can run the event loop for a sho

Re: Updating a progress bar from a code loop

2008-06-10 Thread Michael Ash
On Tue, Jun 10, 2008 at 3:17 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > Thanks for the suggestions - basically I have to run my loop on a thread, > seems to be what you're both saying. > > In this case I can do that... though out of curiosity I wonder if there is a > way to do this "cooperatively"

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-10 Thread Michael Ash
On Tue, Jun 10, 2008 at 8:20 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 9 Jun '08, at 10:38 PM, Michael Ash wrote: > >> It's perfectly possible to write safe code that calls C >> str functions. My code is no more vulnerable than the next man's. You >> can call things like strnstr, pass the le

Selectable NSTextFieldCell and NSTextField break attributed strings when selected

2008-06-10 Thread Dalzhim Dalzhim
Hello! this is my first time posting on this mailing list so I hope I do not forget to provide any necessary details! I've been searching around for a long while to fix this problem I am having and I have yet to find a solution or an explanation. I have a NSWindow with a few NSTextField instances

Re: crash on command-W

2008-06-10 Thread Ken Ferry
On Tue, Jun 10, 2008 at 8:24 AM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 9 Jun '08, at 10:30 PM, James W. Walker wrote: > >> Tech Note 2124 says: "You can use GDB to set a breakpoint on -[_NSZombie >> methodSignatureForSelector:] to further debug this sort of problem." I >> tried pasting met

Re: Garbage collector vs variable lifetime

2008-06-10 Thread Adam R. Maxwell
On Tuesday, June 10, 2008, at 08:29AM, "Charles Srstka" <[EMAIL PROTECTED]> wrote: >On Jun 9, 2008, at 5:55 PM, Hamish Allan wrote: > >> Sure. But it gives you *more* information than if it just returns >> "id". I agree with you in all other respects of your post, but I don't >> agree that +[NSA

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Ken Ferry
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

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Andy Lee
Check the code that draws the 1-pixel line. It should be calculating coordinates of the line based on the view's bounds rectangle, not the rectangle that is passed to drawRect:. --Andy On Jun 10, 2008, at 11:51 AM, Jonathan Dann wrote: Hi All, This is something that I haven't seen before

NSSlider responding to superview's drawRect

2008-06-10 Thread Jonathan Dann
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

Re: Building against 10.5 SDK, link error on "open" [Solved]

2008-06-10 Thread Dale Jensen
On Jun 10, 2008, at 10:46 AM, Dale Jensen wrote: The only reference that I see is setenv LIBRARY_SEARCH_PATHS " / Developer/SDKs/MacOSX10.4u.sdk/usr/lib" and I don't know where that's coming from, because "Library Search Paths" is blank for this and the other phases of the product. What el

Re: Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Dale Jensen
On Jun 10, 2008, at 10:33 AM, Kevin Grant wrote: You do have "-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib" in there. Check the list of environment variables (or add a script build phase that runs "env" first, if you don't see one) and try to fix the most generic variable that will affect all the o

Re: Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Julien Jalon
The basic POSIX functions have changed a bit in Leopard (to achieve POSIX conformance). This means that POSIX libraries are different in 10.4 SDK vs. 10.5. You can not mix them. Also, if you change the SDK, it's generally a good idea to clean all your targets. -- Julien On Tue, Jun 10, 2008 at 7:

Re: Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Kevin Grant
You do have "-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib" in there. Check the list of environment variables (or add a script build phase that runs "env" first, if you don't see one) and try to fix the most generic variable that will affect all the others. Another thing to look at is the precompiled

Re: Garbage collector vs variable lifetime

2008-06-10 Thread Charles Srstka
On Jun 9, 2008, at 5:55 PM, Hamish Allan wrote: Sure. But it gives you *more* information than if it just returns "id". I agree with you in all other respects of your post, but I don't agree that +[NSArray array] returns "id" because if it returned "NSArray *" you'd have to have a separate decla

Re: checking application is document based application or not

2008-06-10 Thread Jens Alfke
On 10 Jun '08, at 5:07 AM, Apparao Mulpuri wrote: I have applicaton name, path, pid. I want to find out, whether that application is document based application or not?. There isn't really any distinction. "Document based application" is just the name of a project template in Xcode that set

Re: crash on command-W

2008-06-10 Thread Jens Alfke
On 9 Jun '08, at 10:30 PM, James W. Walker wrote: Tech Note 2124 says: "You can use GDB to set a breakpoint on - [_NSZombie methodSignatureForSelector:] to further debug this sort of problem." I tried pasting methodSignatureForSelector: into the breakpoints window, and it gave me a choice

Re: Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Dale Jensen
On Jun 10, 2008, at 10:04 AM, Kevin Grant wrote: You may have to examine the list of environment variables printed at build time, and the GCC command lines, to see the problem. For example, the -isysroot option may not be set correctly. I've attached the command lines at the end of this. It

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-10 Thread Jens Alfke
On 9 Jun '08, at 10:38 PM, Michael Ash wrote: It's perfectly possible to write safe code that calls C str functions. My code is no more vulnerable than the next man's. You can call things like strnstr, pass the length of the NSData you're working on, and there is exactly zero risk of anything.

Re: Garbage collector vs variable lifetime

2008-06-10 Thread Charles Srstka
On Jun 9, 2008, at 1:39 PM, Chris Hanson wrote: It is perfectly legal to return an NSMutableArray from a hypothetical +(NSArray *)array method. However, all the sender of that +(NSArray *)array message can know is that the result can be treated as an NSArray. It can't know whether an NSA

changing locale

2008-06-10 Thread Alexander Cohen
Is there a way to change the locale from cocoa as if i was to go into System Preferences and change the language then the format? thx AC ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Rasmus Andersson
This is actually something I'm thinking of implementing. But still, it would only be semi-useful, since the service I intend to interface with is in many parts search-oriented. (Spotify, a music service) Maybe I will fork this little project into two separate, small projects: 1) Spotlight importer

Re: Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Kevin Grant
It's possible the SDK has a problem, but first double-check everything you're using (and everything it depends on) to be sure it's built with consistent headers and libraries. If it's C++, the compiler version is also important. You may have to examine the list of environment variables printed a

Re: Binding NSMenuItem state in Document-based app

2008-06-10 Thread Steve Nicholson
On 2008 Jun, 09, at 12:57, Quincey Morris wrote: Doing this through bindings involves re-inventing a bit of stuff that NSResponder normally takes care of, but it need not be too difficult. For example, you could Or something like that. On Jun 9, 2008, at 3:04 PM, Jerry Krinock wrote

Building against 10.5 SDK, link error on "open"

2008-06-10 Thread Dale Jensen
I'm trying to get my project to build against the 10.5 SDK, but when I switch it from $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk to 10.5, I get a couple of errors: Undefined symbols: "_open$UNIX2003", referenced from: _CreateEventForPath in editorBridge.o "_close$UNIX2003", referenced fro

Re: Spotlight sources w/o actual files?

2008-06-10 Thread matt . gough
On 10 Jun 2008, at 10:57, Rasmus Andersson wrote: Oh, just as I feared. The problem is the metadata itself is probably hundreds of gigabytes, if not terabytes in size, so it would be impossible to have mdimporter index "fake" files. One thing you could consider is to just create these fake f

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Rasmus Andersson
Thanks! That might work, but would add some awkward dependencies (i.e. the fusefs kernel module) Will investigate further. On Tue, Jun 10, 2008 at 4:00 PM, Stephen J. Butler <[EMAIL PROTECTED]> wrote: > On Tue, Jun 10, 2008 at 3:07 AM, Rasmus Andersson <[EMAIL PROTECTED]> wrote: >> I would like t

Re: crash on command-W

2008-06-10 Thread Adam R. Maxwell
On Jun 9, 2008, at 11:17 PM, James W. Walker wrote: On Jun 9, 2008, at 10:44 PM, Joseph Kelly wrote: Toggle the release when closed setting on the window nib? See the docs for -[NSWindow setReleasedWhenClosed:] Tried that, didn't seem to make any difference to the crash. (Right now I hav

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-10 Thread Chris Ridd
On 10 Jun 2008, at 05:12, Mark Munz wrote: Just wishing for the problem to go away or blaming external criteria will almost guarantee that nothing gets done. Filing bugs is how you, the developer, communicate your needs to Apple. Since ICU is open source, the other productive thing to do woul

Re: adding a delegate to a class

2008-06-10 Thread Erik Buck
See http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Stephen J. Butler
On Tue, Jun 10, 2008 at 3:07 AM, Rasmus Andersson <[EMAIL PROTECTED]> wrote: > I would like to create a Spotlight plugin that allows me to search > among a very big set of data, located at a central server (i.e. not > able to store it locally) Thus I need to query this central storage > for matches

Re: adding a delegate to a class

2008-06-10 Thread Jesse Armand
Hello Angelo, I think this code might help you: @protocol BackgroundObjDelegate @optional - (void)showText:(NSString*)text; @end @interface BackgroundObj : NSObject { id _delegate; } @property(assign) id delegate - (void) sayHi; @end @implementation BackgroundObj @synthesize deleg

RE: adding a delegate to a class

2008-06-10 Thread john darnell
Without knowing what exactly you are trying to achieve, it's hard to advise you, Angelo. Would a simple printf or one of its variants do for you? R, John > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Angelo Chen > Sent: Tuesday, June 10, 2008

adding a delegate to a class

2008-06-10 Thread Angelo Chen
Hi, I have a code like this: @interface BackgroundObj : NSObject { Controller *mc; } - (void) sayHi; @implementation BackgroundObj - (void) sayHi { [mc showText:@"Hi"]; } @end As you can see, the code is hard coded to use class Controller, can not be used with any other obje

Re: warning: return makes pointer from integer without cast

2008-06-10 Thread Jason Coco
Hey Steve, In this case, you are returning a regular integer (count returns just a regular, scalar type). But you've declared your return value as id, which is a typedef for a type of pointer. You either have to return an actual integer, or wrap the return of count in an object like NSNumbe

Re: warning: return makes pointer from integer without cast

2008-06-10 Thread Jonathan del Strother
On Tue, Jun 10, 2008 at 1:32 PM, Steven Hamilton <[EMAIL PROTECTED]> wrote: > Hi folks, newbie here. > > A quickie query on a warning. > > Both returns in the following code give a 'warning: return makes pointer > from integer without cast' > > - (id)outlineView:(NSOutlineView *)outlineView > numbe

Re: warning: return makes pointer from integer without cast

2008-06-10 Thread John Pannell
Hi Steven- Your method signature says the method returns an object ("id"), but your return values you give back are int. I think that may be where your code is making a pointer from an int without a cast. I'm guessing you are implementing this as an outlineView datasource... in this case

warning: return makes pointer from integer without cast

2008-06-10 Thread Steven Hamilton
Hi folks, newbie here. A quickie query on a warning. Both returns in the following code give a 'warning: return makes pointer from integer without cast' - (id)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem: (id)item { if (!item) { return [outlineTre

checking application is document based application or not

2008-06-10 Thread Apparao Mulpuri
Hi List, I have applicaton name, path, pid. I want to find out, whether that application is document based application or not?. Is there any way to do this? Regards, - Apparao. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: from CFDataRef to NSString

2008-06-10 Thread Michael Vannorsdel
Something like: messageString = [[NSString alloc] initWithData:(NSData*)data encoding:NSASCIIStringEncoding]; the encoding type will depend on what encoding you expect the data to be in. On Jun 10, 2008, at 4:08 AM, Angelo Chen wrote: What is the correct way to cast from CFDataRef to NS

Re: Updating a progress bar from a code loop

2008-06-10 Thread Graham Cox
Thanks for the suggestions - basically I have to run my loop on a thread, seems to be what you're both saying. In this case I can do that... though out of curiosity I wonder if there is a way to do this "cooperatively" on the main thread without having to break up the loop doing the actual

from CFDataRef to NSString

2008-06-10 Thread Angelo Chen
Hi, What is the correct way to cast from CFDataRef to NSString, I have this code: CFDataRef data; NSString *messageString = [NSString stringWithCString:CFDataGetBytePtr(data)]; it always return this warning, any idea? warning:pointer targets in passing argument 1 of 'stringWithCString:' differ

Re: Where are window prefs stored?

2008-06-10 Thread Matt Gough
10 Jun 2008, at 11:21, Ken Tozier wrote: Hi My app opens several palettes and uses the following line to store the palette positions [[self window] setFrameAutosaveName: @""]; I ran into a problem with the stored size and want to flush the old prefs and start over. Where are these types

Where are window prefs stored?

2008-06-10 Thread Ken Tozier
Hi My app opens several palettes and uses the following line to store the palette positions [[self window] setFrameAutosaveName: @""]; I ran into a problem with the stored size and want to flush the old prefs and start over. Where are these types of prefs located and is it safe to just z

failure to create NSStatusItem

2008-06-10 Thread Ben Willmore
Under what circumstances can [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] fail? The docs say statusItemWithLength: can return nil if it was not possible to create the NSStatusItem, but what might cause this to happen? Ben __

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-10 Thread Michael Vannorsdel
Ah ok. I was bit by something similar a few years ago. I had forgotten to put the prototype in my class interface and believed the compiler was using a prototype from an unrelated class which had different arg and return types. But the twist was the missing prototype caused the default i

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Rasmus Andersson
Oh, just as I feared. The problem is the metadata itself is probably hundreds of gigabytes, if not terabytes in size, so it would be impossible to have mdimporter index "fake" files. Thank you anyway! Will probably look into Quicksilver then. Anyone got any good hints about where to find proper d

Re: Spotlight sources w/o actual files?

2008-06-10 Thread Ken Ferry
Hi Rasmus, You do need to have one file per findable item, and you cannot get a callback at search time. You may not care about latency at search time, but Apple does. :-) If it helps at all, your files don't actually have to contain the data that you supply to the spotlight indexer. They can b

extracting output from AMWorkflow when using AMWorkflowController

2008-06-10 Thread Mark Munz
It appears that it is only possible to access the output of an AMWorkflow if you call runWorkflowAtURL:withInput:error:. If, as an alternative, I wanted to use AMWorkflowController, there doesn't appear to be a way to extract the output from the AMWorkflow after calling run from the controller. O

Spotlight sources w/o actual files?

2008-06-10 Thread Rasmus Andersson
I would like to create a Spotlight plugin that allows me to search among a very big set of data, located at a central server (i.e. not able to store it locally) Thus I need to query this central storage for matches whenever I search for something in Spotlight. (I/O latency is not an issue) What I

Re: Updating a progress bar from a code loop

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 7:24 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > How do I give some time to the event loop while I'm running my own loop? See here for a recent discussion: http://www.cocoabuilder.com/archive/message/cocoa/2008/6/5/209308 Hamish __