Re: how to wait the finish of NSURLDownload

2008-04-16 Thread Ken Thomases
On Apr 17, 2008, at 1:16 AM, xiaobin wrote: In my application, I want to download a file from internet. so I use NSURLDownload to do it. and using NSRunLoop to wait until finish the downloading action. If the file is small enough to fit into memory, you can use one of these: +[NSData dataWi

Re: NSArrayController bound to @unionOfArrays not updating

2008-04-16 Thread Quincey Morris
On Apr 16, 2008, at 22:54, William Towe wrote: To achieve this I bound the table view's contentArray binding to controller key "selection" and model key path: "@unionOfArrays.allDescendantsNodes". The allDescendantNodes method in my file node class returns an array with all its descendants i

Re: 1-bit NSBitmapImageRep?

2008-04-16 Thread Michael Vannorsdel
I'm pretty sure you can do this, the only problem is the bytesPerRow value. Since you need 8 bits to a byte your row size needs to be a multiple of 8 (to make an even number of bytes). If this is undoable, 8bits per sample would be the next smallest and will definitely work. On Apr 16, 2

Re: how to wait the finish of NSURLDownload

2008-04-16 Thread Michael Vannorsdel
Instead of calling stop:, try CFRunLoopStop(CFRunLoopGetCurrent()). Should stop the innermost runloop call. On Apr 17, 2008, at 12:16 AM, xiaobin wrote: In my application, I want to download a file from internet. so I use NSURLDownload to do it. and using NSRunLoop to wait until finish the

how to wait the finish of NSURLDownload

2008-04-16 Thread xiaobin
hi, all In my application, I want to download a file from internet. so I use NSURLDownload to do it. and using NSRunLoop to wait until finish the downloading action. for example 2 seconds. codes as the following [downloadFile setDestination:downloadPath allowOverwrite:YES]; [[NSRunLoop currentRu

Re: NSArrayController bound to @unionOfArrays not updating

2008-04-16 Thread William Towe
Any suggestions anyone has are welcome, if you need more details about my setup I'll attempt to provide them, but I still haven't figured out why the insertion of new objects is updated in the outline view and not the table view. On Wed, Apr 16, 2008 at 5:48 PM, William Towe <[EMAIL PROTECTED]> wr

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Rob Keniger
On 17/04/2008, at 1:59 AM, Erik Buck wrote: See the TextEdit example code on you hard disk. The last time I looked, it was not a document based application, Actually, the version of TextEdit that ships with the Leopard developer tools has been updated so it uses NSDocument. Prior version

1-bit NSBitmapImageRep?

2008-04-16 Thread Graham Cox
Is it possible to create a 1-bit (black and white) NSBitMapImageRep? If so, what are the magic parameters? If not, what is the smallest number of bits per pixel supported? -- S.O.S. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Core Animation/Layers and Borderless Windows

2008-04-16 Thread Karl Goiser
Hello, I'm creating a borderless window whose content view uses Core Animation... When I do this, the window is drawn without any shadow no matter the alpha of the content. - a borderless window with a normal view draws the window's shadow. - a normal window with a content view which use

re: Chained Migration of Leopard CoreData stores

2008-04-16 Thread Ben Trumbull
Hi, let's say I have four versions of my data model: DataModel1.xcdatamodel DataModel2.xcdatamodel DataModel3.xcdatamodel DataModel4.xcdatamodel (this is the current one) and three model mapping files which always map from version n to version n+1: Mapping1to2.xcmappingmodel Mapping2to3.xcma

Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath

2008-04-16 Thread Graham Cox
Because strokes are drawn centred on the coordinate of the path, so a 1-pixel line extends 0.5 of a pixel above and below the coordinate. Offsetting by 0.5 makes it draw such that the exact pixel is filled. -- S.O.S. On 17 Apr 2008, at 9:17 am, Martin wrote: It works! Why such a behav

Re: Poking NSTextView Binding to Update

2008-04-16 Thread Seth Willits
On Apr 16, 2008, at 4:26 PM, Seth Willits wrote: I have a text view bound to a key path through an array controller's selectedObject, and it doesn't update the value immediately when changing the text, it only updates the model if the text view loses first responder. I need the model sync'd

Poking NSTextView Binding to Update

2008-04-16 Thread Seth Willits
I have a text view bound to a key path through an array controller's selectedObject, and it doesn't update the value immediately when changing the text, it only updates the model if the text view loses first responder. I need the model sync'd before I do a certain operation, so I need to bi

Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath

2008-04-16 Thread Martin
It works! Why such a behaviour? Thanks, -Martin On Apr 17, 2008, at 1:15 AM, John Terranova wrote: Try adding these lines before creating the NSBezierPath: cellFrame.origin.x += 0.5; cellFrame.origin.y += 0.5; Let me know if it works. It should. john On Apr 16, 2008, at 3:52 PM, Ma

Re: Getting selection of IKImageView?

2008-04-16 Thread Jamie Phelps
On Apr 16, 2008, at 12:38 PM, Colin Cornaby wrote: The issue is that I really need a rect. Getting the actual image of what is selected will tell me the width and height of the rect, but not the x and y. So, you're after the origin of the rect in addition to the dimensions? Since IKImageV

Re: binary search trees & binning

2008-04-16 Thread Michael Ash
On Wed, Apr 16, 2008 at 5:34 PM, John Stiles <[EMAIL PROTECTED]> wrote: > > Honestly, I can't see value in always coding to CFArray just so I can rip > out the back end later if I don't like the results. The value is that 99% of the time you won't need to, saving time and effort by using a nice b

Drawing a 1 pixel-perfect wide bordered NSBezierPath

2008-04-16 Thread Martin
Hi, I'm trying to draw a rounded rectangle with a 1 pixel-perfect wide border. Although I made sure that the rect has integral values and its height it an even number (so that height/2.0 is also even), the top and bottom lines look blurry (screenshot: http://img01.picoodle.com/img/img01/4/4

Re: binary search trees & binning

2008-04-16 Thread Mike Abdullah
On 16 Apr 2008, at 22:34, John Stiles wrote: Honestly, I can't see value in always coding to CFArray just so I can rip out the back end later if I don't like the results. If anything, it would make more sense to me to use NSArray for that purpose, since I know working with and subclassing

Re: Capsule-Style Toolbar Controls

2008-04-16 Thread Jim Puls
On Apr 16, 2008, at 2:29 PM, Peter Ammon wrote: Well, in the nib files from Mail and Preview there are no toolbars, so Apple builds them via code. So the question is: If I code them as well, is it possible to do the same that Apple does in Mail and Preview via NSSegmentedCell or is this all

NSArrayController bound to @unionOfArrays not updating

2008-04-16 Thread William Towe
This is my first post to the list, I've been using it as a reference for quite some time and usually I can find a solution to my problems, but searching didn't turn anything up that applied to my current issue. So here's the gist of it: I'm working on an IDE for z80 calculator programmers, and hav

Printing and tabular data (again)

2008-04-16 Thread Luca Torella
Hi all, I know this has been discussed many times before, but I still can't find a definitely easy and all-purpose answer. Is it really that hard to print the content of an NSTableView? It seems there are two main ways to do that. - The first way is to create another NSTableView in an invi

Re: binary search trees & binning

2008-04-16 Thread John Stiles
Honestly, I can't see value in always coding to CFArray just so I can rip out the back end later if I don't like the results. If anything, it would make more sense to me to use NSArray for that purpose, since I know working with and subclassing NSArray will be easy and painless. Core Foundatio

Re: Capsule-Style Toolbar Controls

2008-04-16 Thread Peter Ammon
On Apr 16, 2008, at 1:27 PM, Stefan Hafeneger wrote: Hi, Has anyone tried to use the Capsule-Style Toolbar Controls in an app so that it looks and behaves like Mail or Preview? When I add them to my toolbar it looks like Mail. But if I compare them side by side the ones in Mail and Previ

Re: binary search trees & binning

2008-04-16 Thread Michael Ash
On Wed, Apr 16, 2008 at 1:20 PM, John Stiles <[EMAIL PROTECTED]> wrote: > The difference is, in STL, if you want an array where you can remove from > the beginning, you would never use vector<> anyway. You'd use deque<>, which > has different tradeoffs and allows fast removal of elements from the

Capsule-Style Toolbar Controls

2008-04-16 Thread Stefan Hafeneger
Hi, Has anyone tried to use the Capsule-Style Toolbar Controls in an app so that it looks and behaves like Mail or Preview? When I add them to my toolbar it looks like Mail. But if I compare them side by side the ones in Mail and Preview there is a 2 pixel difference of the baseline. And

NSUserDefaults, threads, and binding

2008-04-16 Thread Greg Hoover
I've encountered a situation where NSUserDefaults is definitely not thread safe. Consider an user defaults value bound to an interface object. A background thread modifies this value, first acquiring the lock to write to the user defaults, writes the new value, and finally triggers a KVO

Re: Capture mouse events globally

2008-04-16 Thread Matt Burnett
Also with a kext. See IOKit/hidsystem On Apr 15, 2008, at 11:44 AM, Kyle Sluder wrote: On Tue, Apr 15, 2008 at 7:41 AM, Apparao Mulpuri <[EMAIL PROTECTED]> wrote: Is three any way to capture mouse events globally from my background app. 1) Why are you doing this? I'm curious. 2) See Quartz

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Scott Ribe
> The File Open (for instance) menu item is already assigned, it sends > openDocument: to FirstResponder. I can see it right there in the > bindings, that menu item is already set up to call something. Yes. But what is the first responder? It is the user interface item which has focus. In many ca

Re: binary search trees & binning

2008-04-16 Thread Scott Ribe
> Hmm, set sounds a lot easier than this to me. That's one way. Personally, I would try map> with the map key being the lower bound of the "bucket". -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev maili

Re: EXC_BAD_ACCESS on releasing pool

2008-04-16 Thread Corbin Dunn
I wrote an example for how to easily find these problems: http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/ corbin On Apr 15, 2008, at 11:20 PM, Nick Rogers wrote: hi, when i release the NSAutoReleasePool in a sec

Re: Memory leak when re-alloc Methods

2008-04-16 Thread Mario Gajardo Tassara
El 16-04-2008, a las 4:21, [EMAIL PROTECTED] escribió: On Wed, Apr 16, 2008 at 1:17 AM, Mario Gajardo Tassara <[EMAIL PROTECTED]> wrote: El 15-04-2008, a las 14:21, [EMAIL PROTECTED] escribió: I have a nasty leak problem when i realloc several methods of the main class of my app.

KVO Problem with NSCollectionView

2008-04-16 Thread Joachim Deelen
Hi all, I'm having problems with KVO and a NSCollectionView. As far as I know should the Property "selctionIndexes" be KVO compliant. I've added an Observer and it gets called, every time I'm sending "setSelectionIndexes" to the Collection view. But if I set the selection directly on a NS

Re: NSAllocateCollectable() questions

2008-04-16 Thread Clark Cox
On Wed, Apr 16, 2008 at 9:26 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > On Wed, Apr 16, 2008 at 12:04 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > > The purpose of the write barrier is to tell the collector to keep > > something alive; it has nothing to do with when to collect it. > > Right, I

Re: binary search trees & binning

2008-04-16 Thread Boyd Collier
Thanks very much to everyone who replied to my question. You've given me a lot to think about; I'll crank up the old grey cells and see if I can digest all of it (sorry for the mixed metaphor). If I come up with any brilliant insights (very unlikely), I'll post a note. Boyd __

Re: Detect phone number in NSString

2008-04-16 Thread Graham Davison
On 16 Apr 2008, at 11:53, Uli Kusterer wrote: Am 16.04.2008 um 10:47 schrieb Brad Peterson: So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444-555-6767 is a phone number and should be marked as such.

Re: binary search trees & binning

2008-04-16 Thread John Stiles
Jean-Daniel Dupas wrote: Le 16 avr. 08 à 00:07, John Stiles a écrit : Hmm, set sounds a lot easier than this to me. Just use insert to put all the doubles into the set (one line), then use lower_bound to find the delineations between each group (another one-liner, though of course you'll nee

Re: Detect phone number in NSString

2008-04-16 Thread Mike Wright
On 16 Apr 2008 09:40:46 -0600, Dave DeLong" <[EMAIL PROTECTED]> wrote: (Guess I have to keep top posting.) If you're only concerned with US phone numbers, about a half-dozen canned patterns should suffice. However, if you need to deal with phone numbers in places like Australia, Japan, and

Re: Detect phone number in NSString

2008-04-16 Thread Uli Kusterer
Am 16.04.2008 um 10:47 schrieb Brad Peterson: So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444-555-6767 is a phone number and should be marked as such. Apple has this in Mail. No idea whether there

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Quincey Morris
On Apr 16, 2008, at 03:01, Roland King wrote: I think perhaps I'm not being clear in what I'm asking. The File Open (for instance) menu item is already assigned, it sends openDocument: to FirstResponder. I can see it right there in the bindings, that menu item is already set up to call som

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Mike Abdullah
Awsome, that looks a very handy category to have around. Thanks for producing it. Mike. On 16 Apr 2008, at 17:06, Antonio Nunes wrote: On Apr 16, 2008, at 11:11 AM, Mike Abdullah wrote: Also, another alternative is to follow a singleton pattern like NSFileManager et. al and implement thes

Re: NSAllocateCollectable() questions

2008-04-16 Thread Michael Ash
On Wed, Apr 16, 2008 at 12:04 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > The purpose of the write barrier is to tell the collector to keep > something alive; it has nothing to do with when to collect it. Right, I get that now. [snip] > Garbage Collection: > The housekeeping is taken care of,

Re: binary search trees & binning

2008-04-16 Thread John Stiles
I never thought of using a hash function to do binning. Interesting approach. Army Research Lab wrote: Have you looked at hash_multimap (http://www.sgi.com/tech/stl/hash_multimap.html)? Note that the following code was beaten out in entourage, without compiling, testing, etc. struct eqdouble

Re: NSAllocateCollectable() questions

2008-04-16 Thread Michael Ash
On Wed, Apr 16, 2008 at 5:28 AM, Alastair Houghton <[EMAIL PROTECTED]> wrote: > On 16 Apr 2008, at 03:29, Michael Ash wrote: > > If this is the case then how does the collector know that you have > > cleared the memory. It seems to me that without a write barrier, the > > collector will not see the

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Antonio Nunes
On Apr 16, 2008, at 11:11 AM, Mike Abdullah wrote: Also, another alternative is to follow a singleton pattern like NSFileManager et. al and implement these as instance methods. If you do persist with either of the ObjC-based approaches, I would also suggest changing your first method to:

Re: NSAllocateCollectable() questions

2008-04-16 Thread Clark Cox
On Tue, Apr 15, 2008 at 7:29 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > On Tue, Apr 15, 2008 at 4:53 PM, Greg Parker <[EMAIL PROTECTED]> wrote: > > You don't need a write barrier when erasing GC-scanned memory. The write > > barrier helps the collector see pointers that it might otherwise miss

printing in Cocoa

2008-04-16 Thread Victor Bovio
Hi, Does anyone knows a good book or tutorial that covers printing (in- depth) in Cocoa apps ??, I have Hillegass book but just covers the minimal steps for printing.. I'll write below the problems I have with my app in case anyone can help, Thanks! -- I have a doc

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Erik Buck
See the TextEdit example code on you hard disk. The last time I looked, it was not a document based application, and it certainly displays an Open dialog. Or, you can look at the sample in Cocoa Programming which explains in detail how the Cocoa document infrastructure works including a partia

Re: Why should we set ivars to nil in dealloc?

2008-04-16 Thread Scott Ribe
> For example, how long does the typical app run for with libgmalloc > hanging out and chewing up pages? Well, that is actually one reason that I've been wanting to go 64-bit ;-) -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice __

Re: NSString and utf16

2008-04-16 Thread Alastair Houghton
On 16 Apr 2008, at 16:43, Alexander Cohen wrote: I have an NSString that contains this Unicode character: '\u00e9'. I have another app that represents the same character as 'e\u0301'. Is there any way to transform one to the other so that isEqualToString returns YES? Yes. You want to loo

Re: Resizing NSView with CABasicAnimation

2008-04-16 Thread Bill Dudney
Hi Michael, My pleasure. Although Scott wrote the docs that I used to learn CA so I could write a book ;) As Scott pointed out if you are simply resizing the view you don't necessarily need layers to accomplish animation as the view's animator will do the animation just fine. If you are d

Re: NSString and utf16

2008-04-16 Thread Alexander Cohen
Just noticed that by using the NOrmalize functions i can get what i need. thx AC On Apr 16, 2008, at 11:43 AM, Alexander Cohen wrote: I have an NSString that contains this Unicode character: '\u00e9'. I have another app that represents the same character as 'e\u0301'. Is there any way to

Re: NSString and utf16

2008-04-16 Thread j o a r
On Apr 16, 2008, at 8:43 AM, Alexander Cohen wrote: I have an NSString that contains this Unicode character: '\u00e9'. I have another app that represents the same character as 'e\u0301'. Is there any way to transform one to the other so that isEqualToString returns YES? You can use the "

NSString and utf16

2008-04-16 Thread Alexander Cohen
I have an NSString that contains this Unicode character: '\u00e9'. I have another app that represents the same character as 'e\u0301'. Is there any way to transform one to the other so that isEqualToString returns YES? thx AC ___ Cocoa-dev maili

Re: Detect phone number in NSString

2008-04-16 Thread Dave DeLong
The thing that first comes to mind would be to use regular expressions. CocoaDev has a good page listing where you could find some Regex frameworks: http://www.cocoadev.com/index.pl?RegularExpressions Then you'd run your string through a matcher while looking for the phone number pattern. You co

Re: Frameworks in bundles?

2008-04-16 Thread Karsten
Hi Thomas, you need to link the plugins to the frameworks as well, or you add the linker option: "-undefined dynamic_lookup" to the plugins. That will stop linker errors, but you'll have to make sure that the objects that are not found during linking, are there at execution time, when they

Re: WebKit+AppleScript+JavaScript

2008-04-16 Thread Mike Abdullah
If it is absolutely necessary to use NSTask for launching the app, you can also use the "open" command which honours the one instance per-app rule properly. However, I agree that NSWorkspace is the best thing to use in most cases. Mike. On 16 Apr 2008, at 15:43, Jens Alfke wrote: On 16

Propagation of KVO through bindings

2008-04-16 Thread Hamish Allan
Hi, If I set up key-value observing of an NSArrayController's arrangedObjects like so: [myArrayController addObserver:self forKeyPath:@"arrangedObjects" options:(NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew) context:nil]; I get informed when the array controller's content ch

Re: WebKit+AppleScript+JavaScript

2008-04-16 Thread Jens Alfke
On 16 Apr '08, at 5:16 AM, Praveen Kumar wrote: Instead of AppleScript, I tend to use NSTask to launch the application, but it won't use the active application instead it opens another one and do the stuff. Launching GUI apps via low-level Unix system calls (as NSTask does) can be probl

Re: Resizing NSView with CABasicAnimation

2008-04-16 Thread Michael Fey
Bill, Given that you've "written the book" on Core Animation, I really appreciate your insights. Since my view is layer backed (I called setWantsLayer:YES on a parent view), then my call to [[self layer] addAnimation...] should be [self addAnimation] instead? The other thing that I'm no

Re: listing users

2008-04-16 Thread Matt Long
I have mis-spoken. Identity Services is Leopard only. From the Identity Services programming guide (http://developer.apple.com/documentation/Networking/Conceptual/IdentityServices_ProgGuide/Introduction/chapter_1_section_1.html ): "Identity Services is a new technology in Mac OS X v10.5 that a

Re: NSDrawer resizing problem - no longer resizes when parent window resized

2008-04-16 Thread Karl Moskowski
I found this message in the archives from a few months ago. In case anyone else runs into it, I discovered that it happens only when garbage collection is enabled. I filed Radar 5867411. I've an odd problem with a drawer in my application. I'm seeing the behavior on Leopard, but it could ha

Re: listing users

2008-04-16 Thread Jean-Daniel Dupas
Le 16 avr. 08 à 15:09, Alexander Cohen a écrit : Whats the best way in cocoa to get a list of users on a machine for 10.4 and up? thx AC The most reliable way to do it is to use Directory Services. There is no official Obj-C DS API (The DSObjcWrapper is part of darwin and is open sourc

Re: listing users

2008-04-16 Thread Matt Long
http://www.cimgf.com/2008/04/09/cocoa-tutorial-introduction-to-identity-services/ It has a few 10.5 only features, but you can probably get the gist of API level calls that will work in 10.4. Here's a demo from Apple: http://developer.apple.com/samplecode/IdentitySample/ -Matt On Apr 16, 2

listing users

2008-04-16 Thread Alexander Cohen
Whats the best way in cocoa to get a list of users on a machine for 10.4 and up? thx AC ___ 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-

WebKit+AppleScript+JavaScript

2008-04-16 Thread Praveen Kumar
Hi, I created a Cocoa application that uses WebKit to show the Html pages. The Javascript files access cocoa methods using the concept " Using Objective-C From JavaScript ". I got a issue after adding apple scriptability to the project. The app is not quitting from dock and also not quit

Re: binary search trees & binning

2008-04-16 Thread Army Research Lab
Have you looked at hash_multimap (http://www.sgi.com/tech/stl/hash_multimap.html)? Note that the following code was beaten out in entourage, without compiling, testing, etc. struct eqdouble { bool operator()(const double d1, const double d2) const { double diff = d1 - d2; if (diff < 0

HICocoaViewCreate question

2008-04-16 Thread Dmitry Markman
Hi, I'm playing with the HICocoaViewCreate method so here is a code which I call from the main thread HIViewRef rootView = HIViewGetRoot(rootWindow); NSRect buttonRect = NSMakeRect(0,0,150,30); NSButton *button = [[NSButton alloc] initWithFrame : buttonRect]; [button setButt

Chained Migration of Leopard CoreData stores

2008-04-16 Thread Ruotger Skupin
Hi, let's say I have four versions of my data model: DataModel1.xcdatamodel DataModel2.xcdatamodel DataModel3.xcdatamodel DataModel4.xcdatamodel (this is the current one) and three model mapping files which always map from version n to version n+1: Mapping1to2.xcmappingmodel Mapping2to3.xcm

Re: Getting feedback from application

2008-04-16 Thread parag vibhute
Hi Johan, Ya it is some sort of like that. Thanks for url. Parag On Wed, Apr 16, 2008 at 3:47 PM, Johan Kool <[EMAIL PROTECTED]> wrote: > Hello Parag, > > Is this the kind of functionality you were after: > > http://www.zathras.de/angelweb/sourcecode.htm#UKCrashReporter > > See UKFeedbackProvid

Re: Getting feedback from application

2008-04-16 Thread Johan Kool
Hello Parag, Is this the kind of functionality you were after: http://www.zathras.de/angelweb/sourcecode.htm#UKCrashReporter See UKFeedbackProvider and NiftyFeatures on that page... Johan --- http://www.johankool.nl/ ___ Cocoa-dev mailing list

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Mike Abdullah
Also, another alternative is to follow a singleton pattern like NSFileManager et. al and implement these as instance methods. If you do persist with either of the ObjC-based approaches, I would also suggest changing your first method to: + (float)systemVolume; as this is more common Cocoa

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Roland King
I think perhaps I'm not being clear in what I'm asking. The File Open (for instance) menu item is already assigned, it sends openDocument: to FirstResponder. I can see it right there in the bindings, that menu item is already set up to call something. Yes I suppose I could write my own enti

Re: Getting feedback from application

2008-04-16 Thread Ron Fleckner
On 16/04/2008, at 6:51 PM, parag vibhute wrote: Hi Ron, Ya it is right that I will need to implement the networking functionality for sending feedback from my application to server. But I wanted to know that has Apple mentioned some guideline for this? I would like to follow those guidel

Re: Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Roland King
but they are already assigned to .. the first responder I think. And they are disabled menu items too .. what enables them? On Apr 16, 2008, at 5:26 PM, Ramón Medrano Llamas wrote: It's easy, you must assign in Interface Builder an action to those menu items that do the tasks you want. 2

Re: NSAllocateCollectable() questions

2008-04-16 Thread Alastair Houghton
On 16 Apr 2008, at 03:29, Michael Ash wrote: On Tue, Apr 15, 2008 at 4:53 PM, Greg Parker <[EMAIL PROTECTED]> wrote: You don't need a write barrier when erasing GC-scanned memory. The write barrier helps the collector see pointers that it might otherwise miss because it's cheating. It does

Enabling File Open/Save etc in a non-document-based application

2008-04-16 Thread Roland King
First post. I've been dragging my way through the Cocoa documentation and trying some simple apps. I started with non-document apps and of course you still get the File menu, but most of it's disabled. I understand that when you create a document-based app (and I have a lot more reading to

Re: Getting feedback from application

2008-04-16 Thread parag vibhute
Hi Ron, Ya it is right that I will need to implement the networking functionality for sending feedback from my application to server. But I wanted to know that has Apple mentioned some guideline for this? I would like to follow those guideline. Thanks, Palav On Wed, Apr 16, 2008 at 2:15 PM, Ron

NSValue value:withObjCType:

2008-04-16 Thread Gerriet M. Denkmann
NSValue has two methods: value:withObjCType: and valueWithBytes:objCType: . What is the difference between these two methods? When do I have to use the first, when the second? I am rather confused. Kind regards, Gerriet. ___ Cocoa-dev mailing l

Detect phone number in NSString

2008-04-16 Thread Brad Peterson
Hi all, Like many cell phones are doing these days, I want to be able to detect phone numbers in NSStrings and highlight them in some way for the user. So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444

Re: Getting feedback from application

2008-04-16 Thread Ron Fleckner
On 16/04/2008, at 6:19 PM, parag vibhute wrote: Thanks for url. But this & earlier urls which I received in this thread are for tutorials for making an application like stuff. What I require is adding native functionality by using which user will send feedback regarding that application. I w

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Antonio Nunes
On Apr 16, 2008, at 9:06 AM, Jean-Daniel Dupas wrote: I don't want to start another "Code design" war, but just wonder if doing "Utility Class" is a common practice in obj-c. Unlike Java or other object oriented language, obj-c is a superset of C and support simple functions. Wouldn't it be

Re: Getting feedback from application

2008-04-16 Thread parag vibhute
Thanks for url. But this & earlier urls which I received in this thread are for tutorials for making an application like stuff. What I require is adding native functionality by using which user will send feedback regarding that application. I would like to know has Apple mentioned some guidelines

Re: [ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Jean-Daniel Dupas
Le 16 avr. 08 à 09:23, Antonio Nunes a écrit : Hi, I've put together a simple wrapper to easily change the system sound volume using Objective-C, obviating the need to deal directly with lower-level CoreAudio calls. The files are available here: http://sintraworks.com/media/code/ANSyste

Re: Memory leak when re-alloc Methods

2008-04-16 Thread Jonathan del Strother
On Wed, Apr 16, 2008 at 1:17 AM, Mario Gajardo Tassara <[EMAIL PROTECTED]> wrote: > > El 15-04-2008, a las 14:21, [EMAIL PROTECTED] escribió: > > > > > > > I have a nasty leak problem when i realloc several methods of the main > class of my app. > > > > > > > Without seeing your code, all I can s

Re: binary search trees & binning

2008-04-16 Thread Jean-Daniel Dupas
Le 16 avr. 08 à 00:07, John Stiles a écrit : Hmm, set sounds a lot easier than this to me. Just use insert to put all the doubles into the set (one line), then use lower_bound to find the delineations between each group (another one-liner, though of course you'll need to loop over the nu

Re: binary search trees & binning

2008-04-16 Thread Jean-Daniel Dupas
Le 16 avr. 08 à 04:14, Michael Ash a écrit : On Tue, Apr 15, 2008 at 5:38 PM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: If you need a storage that provide binary search, you can probably use a CFBinaryHeap. "CFBinaryHeap implements a container that stores values sorted using a binary

Re: NSURL and certificates

2008-04-16 Thread Bill Monk
On Apr 16, 2008, at 12:03 AM, Stephane Huaulme <[EMAIL PROTECTED]> wrote: when I try to fetch a web page on an internal server using: [NSString stringWithContentsOfURL:[NSURL URLWithString: theURLString] encoding:NSASCIIStringEncoding error:&theError]; I get the following error: {contents

Re: NSTreeController and NSOutlineView: How do I get to the outline view's item

2008-04-16 Thread Markus Spoettl
On Apr 16, 2008, at 12:18 AM, Quincey Morris wrote: If you're doing this in the context of populating the data model (e.g. creating nodes when initializing a new document), you'd probably want to do it by brute force: create the model data, then examine suitable rows of the outline view (pos

[ANN] ANSystemSoundWrapper - Cocoa wrapper for changing system volume

2008-04-16 Thread Antonio Nunes
Hi, I've put together a simple wrapper to easily change the system sound volume using Objective-C, obviating the need to deal directly with lower-level CoreAudio calls. The files are available here: http://sintraworks.com/media/code/ANSystemSoundWrapper.zip The wrapper consists of a singl

Re: NSTreeController and NSOutlineView: How do I get to the outline view's item

2008-04-16 Thread Quincey Morris
On Apr 15, 2008, at 19:48, Markus Spoettl wrote: I have a NSDocument subclass with a simple tree structure attached to an NSOutlineView via NSTreeController and bindings. I learned - through this list - to add items in KVO compliant way like this TreeNode *node = [[TreeNode init] alloc]; [