Re: Opening and Saving an RTFD [Solved]

2008-08-05 Thread Mark Munz
It turns out that my code was working correctly. The bug was in another part of the app. The problem actually was in use of NSDirectoryEnumerator (via enumeratorAtPath) which was traversing into packages. So the code found the RTF file inside the package, which is read in and wrote out, stripping

Colour of Symlink

2008-08-05 Thread Gerriet M. Denkmann
I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get an FSRef, and then FSGetCatalogInfo to get the colour. But both FSPathMakeRef and CFURLGetFSRef seem to

File's Owner problems

2008-08-05 Thread Chris Idou
I've got a class, let's call it Foo, that loads a NIB called Bar. In IB, the File's owner of Bar is set to class Foo. When Foo loads Bar, passing self as the file's owner, Foo.awakeFromNib gets called during the nib loading process. Is that meant to happen? It doesn't make sense to me.

NSDocumentController openDocumentWithContentsOfURL

2008-08-05 Thread Mark Munz
Under 10.5, I'm trying to switch over to using UTI's but am seeing some weird results: Given a pathName: if I call NSWorkspaces' typeOfFile:pathName error:error, it returns the proper type (com.apple.rtfd) for an RTFD document. But when I then create an NSURL of the path and pass that URL to

Re: CGImageSourceCreateFromURL failed with error -11

2008-08-05 Thread Nicolas Zinovieff
David, the images are GIFs, roughly 40KB each, 200x100 (or 100x200). Nothing fancy. On 05 Aug 2008, at 01:05, David Duncan wrote: What types of images are you trying to load? -- Zino ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: NSDocumentController openDocumentWithContentsOfURL [Resolved]

2008-08-05 Thread Mark Munz
I ended up overriding NSDocumentController's typeForContentsOfURL: which seems to default to something different than what NSWorkspace calculates. Instead, I tested for a file path and then call NSWorkspace's routine on that path. On Mon, Aug 4, 2008 at 11:49 PM, Mark Munz [EMAIL PROTECTED]

image type of the AdressBook image data

2008-08-05 Thread Wayne Shao
Hello, from Address Book Objective-C Framework Reference http://developer.apple.com/documentation/UserExperience/Reference/AddressBook/Classes/ABPerson_Class/Reference/Reference.html#//apple_ref/occ/instm/ABPerson/imageData The imageData method returns NSData*. Is there anyway to know the

Re: Colour of Symlink

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 08:13, Gerriet M. Denkmann a écrit : I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get an FSRef, and then FSGetCatalogInfo to get the

Re: Bindings to display an NSArray of NSStrings as a single NSString?

2008-08-05 Thread Negm-Awad Amin
Bindings are made fpr entities (not only core data entiities, but entities). It is a *Key-Value*-Technologie. Strings have no properties, no keys, are not entities. Maybe you can fake it, if you add a category to the strings: @implementation NString( MirrorAddition ) - (NSString*)reflection

Re: Irritating Problem with NSString Method and File Paths

2008-08-05 Thread Negm-Awad Amin
The file is inside your application directory? Than you should use NSBundles's API to find resources. NSString* thePath = [[NSBundle mainBundle] pathForResource:filename ofType:@txt] Amin Am Mo,04.08.2008 um 06:43 schrieb Patrick Walker: It seems that whenever I use Xcode to spawn the

Re: Properties and memory management

2008-08-05 Thread Uli Kusterer
On 05.08.2008, at 05:55, Jonathan Hess wrote: The implementation of the property will manage the retaining and the releasing. You only need to worry about sending retain and release messages manually if you access the instance variable directly (not through a property). The only place you

Re: File's Owner problems

2008-08-05 Thread mmalc crawford
On Aug 4, 2008, at 11:38 PM, Chris Idou wrote: I've got a class, let's call it Foo, that loads a NIB called Bar. In IB, the File's owner of Bar is set to class Foo. When Foo loads Bar, passing self as the file's owner, Foo.awakeFromNib gets called during the nib loading process. Is that

Resizing a NSImage in a Cocoa command line tool

2008-08-05 Thread Dimitri Bouniol
I have been trying relentlessly to resize a NSImage and save it as a png file in a command line tool (not a windowed app, but I included AppKit to get NSImage support). I tried using setScalesWhenResized along with setSize to no avail (image is not resized when saved), and I also tried

Re: Properties and memory management

2008-08-05 Thread mmalc crawford
On Aug 5, 2008, at 3:00 AM, mmalc crawford wrote: No, this is not the case -- Ken's reply was correct. If you use automatic KVO notifications, your accessors will still have side effects. Although I should add that of course by the time you reach dealloc you should not have

Re: Properties and memory management

2008-08-05 Thread Uli Kusterer
You may fire off observer methods too, which is probably undesirable. Lucky then, that I adopted GNUstep-style ASSIGN() and DESTROY() macros for these purposes, and since most of my code still needs to be 10.4-compatible, I've mostly been using those:

Re: Properties and memory management

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 12:05 schrieb mmalc crawford: On Aug 5, 2008, at 3:00 AM, mmalc crawford wrote: No, this is not the case -- Ken's reply was correct. If you use automatic KVO notifications, your accessors will still have side effects. Although I should add that of course by the

Re: Localize App Title?

2008-08-05 Thread mmalc crawford
On Aug 5, 2008, at 3:40 AM, Chunk 1978 wrote: and then of course i have a Localizable.Strings file in the app's resources... so is there someway to do the same with the name of the app? http://developer.apple.com/cgi-bin/search.pl?q=localize+application+namenum=10site=default_collection

Re: Properties and memory management – sorr y, not send to the list

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 11:57 schrieb Uli Kusterer: You may fire off observer methods too, which is probably undesirable. Lucky then, that I adopted GNUstep-style ASSIGN() and DESTROY() macros for these purposes, and since most of my code still needs to be 10.4-compatible, I've mostly been

Re: Message Framework and Garbage Collection

2008-08-05 Thread Ruotger Skupin
Hi B. I'm trying not to sound mean or angry here but I doubt that Apple will fix such an obvious bug in a deprecated framework, since it didn't do so already. So filing a radar bug seems to be a waste of time (again). Does anyone know, a way to send a mail programmatically in the

Re: Properties and memory management

2008-08-05 Thread mmalc crawford
On Aug 5, 2008, at 2:48 AM, Negm-Awad Amin wrote: This is the mirror of the problem, when you initialize an object. Of course, theoretically in both cases the usage of setters are dangerous. In most cases the deallocation of the object in reverse order to its initialization will not lead

Re: Localize App Title?

2008-08-05 Thread Chunk 1978
i've localized the info.plist file, and added these keys to the english subfile: keyLSHasLocalizedDisplayName/key true/ keyCFBundleDisplayName/key stringNew App Title/string but it still shows my original app name... On Tue, Aug 5, 2008 at 7:04 AM, mmalc crawford [EMAIL PROTECTED] wrote:

Re: Properties and memory management

2008-08-05 Thread Ken Ferry
On Tue, Aug 5, 2008 at 1:12 AM, Uli Kusterer [EMAIL PROTECTED] wrote: On 05.08.2008, at 05:55, Jonathan Hess wrote: The implementation of the property will manage the retaining and the releasing. You only need to worry about sending retain and release messages manually if you access the

Re: image type of the AdressBook image data

2008-08-05 Thread Heinrich Giesen
On 05.08.2008, at 10:03, Wayne Shao wrote: The imageData method returns NSData*. Is there anyway to know the image type (e.g, PNG, TIFF, or JPEG) of the data? besides that what Ken Ferry wrote you may also use (as I do) a low level way to determine the image type: check for the magic

Re: Properties and memory management

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 12:00 schrieb mmalc crawford: On Aug 5, 2008, at 2:48 AM, Negm-Awad Amin wrote: This is the mirror of the problem, when you initialize an object. Of course, theoretically in both cases the usage of setters are dangerous. In most cases the deallocation of the object

Localize App Title?

2008-08-05 Thread Chunk 1978
i'm fairly new to localization, but i can't figure out how to localize the app's name. this is how i localize the strings in my app: static NSString * CONSTwelcome; -(void)awakeFromNib { CONSTwelcome = NSLocalizedString (@Welcome!, nil); bla bla bla } and then of course i have a

Re: Localize App Title?

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 13:25, Chunk 1978 a écrit : i've localized the info.plist file, and added these keys to the english subfile: keyLSHasLocalizedDisplayName/key true/ keyCFBundleDisplayName/key stringNew App Title/string but it still shows my original app name... Please read the

Using performSelector: on super

2008-08-05 Thread [EMAIL PROTECTED]
Hello list My superclass (SuperSocket) provides a private method -close. My subclass overrides this private method as follows: - (void)close { SEL closeSelector = @selector(close); if ([SuperSocket instancesRespondToSelector:closeSelector]) { [super

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
Hmmm. Does not seem to be doing it. Unfortunately, I'm out of ideas; these were mainly off the top of my head. Without seeing your specific source code, I can't offer any more suggestions -- it is quite possible something else is wrong (ie: the identifier isn't set). You probably want

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
One other thing I'm not sure I understand - Are you calling setAutosaveName: yourself? Set it to nil in the nib. Then, call it yourself. Why can't this be set in the nib? I would have thought this is the logical place to set it, and that once set any changes to the table would be

Re: Using performSelector: on super

2008-08-05 Thread Clark Cox
On Tue, Aug 5, 2008 at 5:41 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello list My superclass (SuperSocket) provides a private method -close. My subclass overrides this private method as follows: - (void)close { SEL closeSelector = @selector(close); Note, for getting the

Re: Using performSelector: on super

2008-08-05 Thread I. Savant
On Tue, Aug 5, 2008 at 9:38 AM, Clark Cox [EMAIL PROTECTED] wrote: If [super performSelector:closeSelector] is replaced by [super close] then the super object receives the close message as expected. Remember, there is no such thing as a super object. super is just a keyword that tells the

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
More observations on this - Unfortunately, I'm out of ideas; these were mainly off the top of my head. Without seeing your specific source code, I can't offer any more suggestions -- it is quite possible something else is wrong (ie: the identifier isn't set). The identifier is

Re: Resizing a NSImage in a Cocoa command line tool

2008-08-05 Thread Ken Ferry
Hi Dimitri, The size property describes a more abstract size than pixels. If you set it, you're changing the DPI of the image you write out, not how many pixels it has. It's not safe in general to use AppKit from an app that cannot connect to the window server �C see

Re: Colour of Symlink

2008-08-05 Thread Gerriet M. Denkmann
On 5 Aug 2008, at 14:37, Jean-Daniel Dupas wrote: Le 5 août 08 à 08:13, Gerriet M. Denkmann a écrit : I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get

Re: Message Framework and Garbage Collection

2008-08-05 Thread Nick Zitzmann
On Aug 5, 2008, at 4:18 AM, Ruotger Skupin wrote: Does anyone know, a way to send a mail programmatically in the background, i.e. without opening a mailto:; url? You can either write your own code to talk directly to an SMTP server, or use Pantomime, or use the Scripting Bridge. Check

Re: Colour of Symlink

2008-08-05 Thread Sean McBride
On 8/5/08 8:34 PM, Gerriet M. Denkmann said: Thank you very much, this is exactly what I was looking for. Only I was looking at the wrong place. The only location where this function is mentioned (at least in the Tiger documentation) is the Core Services Reference Update (without any info except

indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Roland King
I've now read the KVC documentation quite a number of times .. especially with regards to indexed accessor properties trying to really understand them. After a bit of messing about in code this is my understanding .. 1) if your property is an array you don't need to supply the countOfkey

IKSlideshow Question

2008-08-05 Thread Robert McCullough
The IKSlideshowDataSource protocol for IKSlideshow includes several optional methods, one of which is nameOfSlideshowItemAtIndex. However, this method NEVER seems to be called. Anyone know why? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Negm-Awad Amin
The basic problem is, that KVO needs Notification-Messages. If you use KVC-compliant accessor methods this will be done for you by a faked class. If you have a mutable array and change the content (removal, insertion …), there is no chance of the KVO-runtime system to get a notification

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Jeff Johnson
On Aug 5, 2008, at 10:22 AM, Roland King wrote: I've now read the KVC documentation quite a number of times .. especially with regards to indexed accessor properties trying to really understand them. After a bit of messing about in code this is my understanding .. 1) if your property is

Re: GetDblTime, 64-bit, and cocoa

2008-08-05 Thread Sean McBride
On 7/22/08 11:48 AM, [EMAIL PROTECTED] said: i need to set a timer when i get a first mouse click and perform something if i don't get another click within the double click time. i found this old thread (from 2003) in the archives:

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Roland King
On Aug 5, 2008, at 11:50 PM, Jeff Johnson wrote: On Aug 5, 2008, at 10:22 AM, Roland King wrote: I've now read the KVC documentation quite a number of times .. especially with regards to indexed accessor properties trying to really understand them. After a bit of messing about in code

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 17:50 schrieb Jeff Johnson: On Aug 5, 2008, at 10:22 AM, Roland King wrote: I've now read the KVC documentation quite a number of times .. especially with regards to indexed accessor properties trying to really understand them. After a bit of messing about in code this

Re: image type of the AdressBook image data

2008-08-05 Thread Wayne Shao
Heinrich, Ken, Thank you both for the information. Wayne On Tue, Aug 5, 2008 at 2:51 AM, Heinrich Giesen [EMAIL PROTECTED] wrote: On 05.08.2008, at 10:03, Wayne Shao wrote: The imageData method returns NSData*. Is there anyway to know the image type (e.g, PNG, TIFF, or JPEG) of the data?

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Roland King
On Aug 5, 2008, at 11:50 PM, Jeff Johnson wrote: On Aug 5, 2008, at 10:22 AM, Roland King wrote: I've now read the KVC documentation quite a number of times .. especially with regards to indexed accessor properties trying to really understand them. After a bit of messing about in code

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Jeff Johnson
On Aug 5, 2008, at 11:56 AM, Roland King wrote: On Aug 5, 2008, at 11:50 PM, Jeff Johnson wrote: Roland, How are you mutating your array? If you do [[myObject mutableArrayValueForKey:@myArray] addObject:anObject], it should preserve the current NSMutableArray even without indexed

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Roland King
Roland, How are you mutating your array? If you do [[myObject mutableArrayValueForKey:@myArray] addObject:anObject], it should preserve the current NSMutableArray even without indexed accessors. This seems to work in my testing, at least. Yup, that works, because the methods

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Jeff Johnson
On Aug 5, 2008, at 11:01 AM, Negm-Awad Amin wrote: 2.1. If -mutableCollectionValueForKey: should work efficient, you have to return a mutable ivar on your accessors (getter). This means, that *everyone* can change items in that collection without triggering kvo. This is the opposition of

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 19:11 schrieb Roland King: Roland, How are you mutating your array? If you do [[myObject mutableArrayValueForKey:@myArray] addObject:anObject], it should preserve the current NSMutableArray even without indexed accessors. This seems to work in my testing, at least.

How is image drawing rate effected by image resolution and size?

2008-08-05 Thread Frederick Bartram
I am having difficulty understanding the issues involved in image drawing speed. I have a large, ~10K x 10K image in a scrolling view. The image is loaded as a PNG file into an NSImageView from a nib. I am getting large differences in the image drawing speed that I do not understand. The

Re: GetDblTime, 64-bit, and cocoa

2008-08-05 Thread Gary L. Wade
Well, the global domain has this key: com.apple.mouse.doubleClickThreshold On 7/22/08 11:48 AM, [EMAIL PROTECTED] said: i need to set a timer when i get a first mouse click and perform something if i don't get another click within the double click time. i found this old thread (from 2003)

Loading a class with a specific superclass from a bundle

2008-08-05 Thread Elan Feingold
Hi, I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); However, I have a situation where I have a bundle that has a class *without* a principal class, but it has a class that is a

Re: reloading an NSTreeController

2008-08-05 Thread Jonathan Dann
On 4 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 16:53, Jonathan Dann wrote: On 3 Aug 2008, at 04:35, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 05:51, Jonathan Dann wrote: On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Bill Bumgarner
On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote: I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); However, I have a situation where I have a bundle that has a class *without* a

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Negm-Awad Amin
Am Di,05.08.2008 um 20:41 schrieb Bill Bumgarner: On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote: I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); However, I have a situation

Re: GetDblTime, 64-bit, and cocoa

2008-08-05 Thread Sean McBride
On 8/5/08 2:00 PM, Gary L. Wade said: Well, the global domain has this key: com.apple.mouse.doubleClickThreshold Good find. Alas, the only hits on Apple's website are posts on this list, which pretty much makes it an undocumented API; as opposed to GetDblTime() which was a supported API.

Re: How is image drawing rate effected by image resolution and size?

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 19:48, Frederick Bartram a écrit : I am having difficulty understanding the issues involved in image drawing speed. I have a large, ~10K x 10K image in a scrolling view. The image is loaded as a PNG file into an NSImageView from a nib. I am getting large differences in

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 5:41 AM +0100): My superclass (SuperSocket) provides a private method -close. Others have adiquetly explained the whole 'self' vs. 'super' issue, but this statement still has me stumped and I'm wondering why this even

ERROR in Xcode 3 Unleashed

2008-08-05 Thread Fritz Anderson
I want you to be aware of an error in Chapter 8 (page 97) of my book, Xcode 3 Unleashed. This chapter covers setting up for version control with Subversion, and advises that the following be added to the global-ignores line of the ~/.subversion/config file: build * .nib *.so *.pbxuser

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Michael Ash
On Tue, Aug 5, 2008 at 2:19 PM, Elan Feingold [EMAIL PROTECTED] wrote: Hi, I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); However, I have a situation where I have a bundle that

Re: Using performSelector: on super

2008-08-05 Thread Shawn Erickson
On Tue, Aug 5, 2008 at 12:18 PM, James Bucanek [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 5:41 AM +0100): My superclass (SuperSocket) provides a private method -close. Others have adiquetly explained the whole 'self' vs. 'super' issue,

Re: Using performSelector: on super

2008-08-05 Thread I. Savant
There is no such thing as a private method in Objective-C. The @private, @protected, @public keywords only work on instance variables. So if the super class implements -close, there should never be anything stopping your subclass from simply calling [super close]. In this case, [super

Re: ERROR in Xcode 3 Unleashed

2008-08-05 Thread Fritz Anderson
On 5 Aug 2008, at 2:37 PM, Kyle Sluder wrote: Sounds like the book was typeset in TeX. I've been there before. ;-) You got it. Colored, indented, and brace-balanced source code was an adventure, too. — F ___ Cocoa-dev mailing list

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Chris Hanson
On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote: I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); Actually, this loads the bundle and then gets its principal class. Loading a

Re: Using performSelector: on super

2008-08-05 Thread Andy Lee
On Aug 5, 2008, at 3:39 PM, I. Savant wrote: I'm going to make a bold statement: You should only ever call [super someMethod] from within an overridden someMethod implementation. I believe this is true in all cases (because I can't at the moment imagine a case where you'd do otherwise). Third

Re: Using performSelector: on super

2008-08-05 Thread I. Savant
On Tue, Aug 5, 2008 at 4:20 PM, Andy Lee [EMAIL PROTECTED] wrote: The one case that comes to mind is when a designated initializer calls its superclass's different designated initializer. BINGO! We have a winner! :-) -- I.S. ___ Cocoa-dev mailing

Re: Properties and memory management

2008-08-05 Thread Marcel Weiher
On Aug 5, 2008, at 2:57 , Uli Kusterer wrote: You may fire off observer methods too, which is probably undesirable. Lucky then, that I adopted GNUstep-style ASSIGN() and DESTROY() macros for these purposes, and since most of my code still needs to be 10.4-compatible, I've mostly been

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
I. Savant mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 12:39 PM -0400): There is no such thing as a private method in Objective-C. The @private, @protected, @public keywords only work on instance variables. So if the super class implements -close, there should never be anything

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
Shawn Erickson mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 12:38 PM -0700): On Tue, Aug 5, 2008 at 12:18 PM, James Bucanek [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 5:41 AM +0100): My superclass (SuperSocket) provides a

Re: Using performSelector: on super

2008-08-05 Thread I. Savant
On Tue, Aug 5, 2008 at 4:31 PM, James Bucanek [EMAIL PROTECTED] wrote: The OP did override -close in their subclass and were attempting to call [super close] from the subclass' -close method. The OP stated that they couldn't simply use [super close] because -close was private, which didn't

Re: Using performSelector: on super

2008-08-05 Thread Michael Ash
On Tue, Aug 5, 2008 at 8:41 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Or am I on the wrong page entirely. I'd suggest that you need to re-evaluate if this method should be private. In OO languages with access controls, private usually means that it's hidden from subclasses too. Protected

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 21:59, Chris Hanson a écrit : On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote: I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@...]; Class exampleClass = [bundleToLoad principalClass]); Actually, this loads the bundle and

Re: Using performSelector: on super

2008-08-05 Thread [EMAIL PROTECTED]
Sorry for the inaccuracy. I am well aware that there is no such thing as a true private method in Objective-C, though it seems generally common to refer to such contraptions (A, B and Y's Cocoa Programming contains such usage, page 81). I of course mean that the SuperSocket class

CGGStackRestore: gstack underflow

2008-08-05 Thread Gordon Apple
I'm getting a ton of console messages: Tue Aug 5 16:34:13 Macintosh-5.local RTP[2209] Error: CGGStackRestore: gstack underflow. What should I be looking for to find the problem? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: CGGStackRestore: gstack underflow

2008-08-05 Thread Kyle Sluder
On Tue, Aug 5, 2008 at 5:44 PM, Gordon Apple [EMAIL PROTECTED] wrote: What should I be looking for to find the problem? I'm not a CoreGraphics expert, but my first instinct is too many calls to -[NSGraphicsContext restoreGraphicsState]. --Kyle Sluder

Re: Properties and memory management

2008-08-05 Thread Uli Kusterer
On 05.08.2008, at 22:24, Marcel Weiher wrote: On Aug 5, 2008, at 2:57 , Uli Kusterer wrote: You may fire off observer methods too, which is probably undesirable. Lucky then, that I adopted GNUstep-style ASSIGN() and DESTROY() macros for these purposes, and since most of my code still

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 2:19 PM +0100): Sorry for the inaccuracy. No problem. I of course mean that the SuperSocket class responds to the -close method but does not declare it in its interface file. -close is indeed declared as a method on

Re: Using performSelector: on super

2008-08-05 Thread Charles Steinman
--- On Tue, 8/5/08, James Bucanek [EMAIL PROTECTED] wrote: In your original code, you had SEL closeSelector = @selector(close); if ([SuperSocket instancesRespondToSelector:closeSelector]) { ... This does not, as I think you believe, test to see if an object of the

How to enable/disable buttons immediately after focus transfer

2008-08-05 Thread an0
I know how to do this for NSValidatedUserInterfaceItem by implementing `- (BOOL)validateUserInterfaceItem:(id NSValidatedUserInterfaceItem )anItem'; however, NSSegmentedControl and NSButton do not conform to NSValidatedUserInterfaceItem protocol, then how can I switch the enable status of these

Re: Bindings to display an NSArray of NSStrings as a single NSString?

2008-08-05 Thread Hamish Allan
On Mon, Aug 4, 2008 at 6:32 PM, Dustin Robert Kick [EMAIL PROTECTED] wrote: This seems like it would be common enough, to me, that it would have bindings for it. You could add a category to NSArray... @implementation NSArray (ArrayOfStringsAsSingleString) - (NSString

control user interface of an external application

2008-08-05 Thread falcon
Hello, I have an application written using Qt. Is there any way to control it from another cocoa application? For example something like following: 1) Get Qt application handle (or what ???) 2) Send something like keyboard event Tab to change active control till the necessary one. 3) Send

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
Charles Steinman mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 4:20 PM -0700): --- On Tue, 8/5/08, James Bucanek [EMAIL PROTECTED] wrote: In your original code, you had SEL closeSelector = @selector(close); if ([SuperSocket instancesRespondToSelector:closeSelector]) { ... This

Re: [SOLVED] Resizing a NSImage in a Cocoa command line tool

2008-08-05 Thread Dimitri Bouniol
Thank you very much - that worked perfectly. On Aug 5, 2008, at 7:20 AM, Ken Ferry wrote: Hi Dimitri, The size property describes a more abstract size than pixels. If you set it, you're changing the DPI of the image you write out, not how many pixels it has. It's not safe in general to use

Re: Using performSelector: on super

2008-08-05 Thread [EMAIL PROTECTED]
On 5 Aug 2008, at 23:38, James Bucanek wrote: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Tuesday, August 5, 2008 2:19 PM +0100): Sorry for the inaccuracy. No problem. I of course mean that the SuperSocket class responds to the -close method but does not declare it in its

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Roland King
Roland, Right, that's because you've defined a setter. See the search algorithm documented for mutableArrayValueForKey: at http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/doc/uid/2471-BABJFEAE.

Re: Localize App Title?

2008-08-05 Thread Chunk 1978
so i got it to work, but it still show's the original CFBundleDisplayName as the Dock label, eventhough the finder lists the CFBundleDisplayName as the new localized name, and the CFBundleName is also localized for the NIB file... is there some other key like CFBundleDockName ??? On Tue, Aug 5,

Re: Localize App Title?

2008-08-05 Thread Chunk 1978
oh... you're correct... i had to logout/restart... simply relaunching the finder wasn't cutting it for the dock's label... works now... On Tue, Aug 5, 2008 at 8:48 PM, Rua Haszard Morris [EMAIL PROTECTED] wrote: Possibly just need to reboot, killall dock, do a headstand, power off for 5

Re: indexed accessor properties and NSArray/NSMutableArray's

2008-08-05 Thread Jeff Johnson
On Aug 5, 2008, at 7:27 PM, Roland King wrote: Thanks. There's always just ONE more piece of documentation to read isn't there. So here's my (possibly) last question. If you define neither the accessor methods nor a getter/setter and make mutableArrayValueByKey use direct access to the

Re: Bindings to display an NSArray of NSStrings as a single NSString?

2008-08-05 Thread Dustin Robert Kick
yes, indeed, that does seem to be the simplest solution, thanks. Dustin KC9MEL On Aug 5, 2008, at 8:14 AM, Hamish Allan wrote: On Mon, Aug 4, 2008 at 6:32 PM, Dustin Robert Kick [EMAIL PROTECTED] wrote: This seems like it would be common enough, to me, that it would have

handling idle events

2008-08-05 Thread Jim Crafton
Is there a way to handle idle time in an NSApplication? In Win32 or Carbon, since you manually write the actual while loop that processes the events, this is pretty easy to do. Is there anything like this in Cocoa? I've got some objects whose state (possibly) needs to be updated, and I was

post events to NSApplication

2008-08-05 Thread Jim Crafton
Is it possible to create a custom event for an apps internal usage and have it posted to the NSApp, and then processed later on? If so, how would one do this? I'm not sure how to a) create the event b) get notified when the event is recv'd and ready for processing The event loop is whatever is

Re: Bindings to display an NSArray of NSStrings as a single NSString?

2008-08-05 Thread Erik Buck
You could add a category to NSArray... @implementation NSArray (ArrayOfStringsAsSingleString) - (NSString *)arrayOfStringsAsSingleString { return [self componentsJoinedByString:@, ]; } @end ...and then bind to values.arrayOfStringsAsSingleString. Um, why not just bind to

Re: handling idle events

2008-08-05 Thread Jonathan Hess
Hey Jim - The typical way that I like to handle this is with these methods from NSRunLoop.h: @interface NSObject (NSDelayedPerforming) - (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay inModes:(NSArray *)modes; -

Re: Bindings to display an NSArray of NSStrings as a single NSString?

2008-08-05 Thread Jonathan Hess
On Aug 5, 2008, at 7:27 PM, Erik Buck wrote: You could add a category to NSArray... @implementation NSArray (ArrayOfStringsAsSingleString) - (NSString *)arrayOfStringsAsSingleString { return [self componentsJoinedByString:@, ]; } @end ...and then bind to

How to debug a corrupted stack

2008-08-05 Thread Gerriet M. Denkmann
I have a document based app which works perfectly with -O0 or -O1 but crashes with -O2 or higher. When the crash occurs the debugger comes up and says: Previous frame identical to this frame (corrupt stack?) When I try to step through the function (which is kind of difficult, as the

Re: Using performSelector: on super

2008-08-05 Thread James Bucanek
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote (Wednesday, August 6, 2008 4:49 PM +0100): Are you sure about that James? No, I'm not. I apparently have lost the ability to read code. I read it as respondsToSelector:, not instancesRespondToSelector:. [(id)super close]; //

Re: handling idle events

2008-08-05 Thread chaitanya pandit
Hi, You can use NSNotificationQueue to post your custom notification when the run loop is idle (NSPostWhenIdle), and do the processing in it's listener method. On 05-Aug-08, at 10:16 PM, Jim Crafton wrote: Is there a way to handle idle time in an NSApplication? In Win32 or Carbon, since

NSDocument opening folders

2008-08-05 Thread Chris Idou
I have a document based application that needs to be able to open folders. I'm calling: [[NSDocumentController sharedDocumentController] openDocument:myfolderurl ofType:@mytype display:YES error:error]; but I get the error: Error Domain=NSCocoaErrorDomain Code=256 UserInfo=0x10be490

How to use a button to update an application with a text field value

2008-08-05 Thread Tron Thomas
I am writing a Cocoa application that contains an NSTextField control. Things are such that when a user types a value into this control and hits enter, a binding will update an NSController instance in the application with the value contained in the text field. This is more elegant that

Re: post events to NSApplication

2008-08-05 Thread Ken Thomases
On Aug 5, 2008, at 9:18 PM, Jim Crafton wrote: Is it possible to create a custom event for an apps internal usage and have it posted to the NSApp, and then processed later on? If so, how would one do this? I'm not sure how to a) create the event b) get notified when the event is recv'd and

  1   2   >