Coloring a Row in a NSTableView.

2010-01-10 Thread Joshua Garnham
What I am looking to do is set the background color of the selected row in an NSTableView when a I button is clicked. I've seen other cases where people have used tableView:willDisplayCell:forTableColumn:row: and setBackgroundColor: but I don't think that will work in my situation where I want

iPhone interruption with OpenAL?

2010-01-10 Thread Chunk 1978
i'm using an interruption listener callback with audiotoolbox to shut off music when a call (or something else) comes in to interrupt the app. however, i'd simply like to remove all AVFoundation from the code and strictly rely on OpenAL for sound. will OpenAL automatically pause like the rest of

Re: Enabling NSZombieEnabled programatically

2010-01-10 Thread Graham Cox
I tried +load, and just before NSApplicationMain() (obviously that's within main, not before it), but got the same result. My +load method was in my NSApplication subclass - maybe that's not the right place to put it? I'll peruse the documentation cited when I get a moment, but for now the

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-10 Thread Russell Gray
I have tried modifying subscriptions (in the method openABPFeed:(NSURL*)feed), with the following: [subscriptionsArrayController addObject: subscriptionInfo]; [[self mutableArrayValueForKey: @subscriptions] addObject: subscriptionInfo]; [[self mutableArrayValueForKey: @subscriptions]

Re: Enabling NSZombieEnabled programatically

2010-01-10 Thread Quincey Morris
On Jan 9, 2010, at 16:54, Graham Cox wrote: I'm getting something odd though. If I set NSZombieEnabled during app delegate -applicationDidFinishLaunching: method from my preference, a later deliberate over-release still causes a EXC_BAD_ACCESS. If I set it as an environment variable (Xcode

Re: NSTextView EXC_BAD_ACCESS in deferred layout (RESOLVED)

2010-01-10 Thread jonat...@mugginsoft.com
On 8 Jan 2010, at 11:35, jonat...@mugginsoft.com wrote: My GC app has two NSTextViews in two windows. Distinct attributed text can loaded into both NSTextView instances. The problem test text data size is 2MB. The problem does not manifest itself for smaller data sizes. The 2MB test

Re: Enabling NSZombieEnabled programatically

2010-01-10 Thread Paul Sanders
You could try setting it in a C++ constructor (in a source file with extension .mm). Constructors for statically allocated objects run before main. Typed in mail: - class EnableZombies { public: // Constructor EnableZombies () { setenv

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-10 Thread Quincey Morris
On Jan 10, 2010, at 02:54, Russell Gray wrote: As for the two arrays: subscriptions subscriptionsArray subscriptions is the mutable array that subscriptionsArrayContoller is bound to for its content. and subscriptionsArray is a mutable array that I use to read/write my plist file. I

Re: Enabling NSZombieEnabled programatically

2010-01-10 Thread Dave Keck
After checking the CF sources for 10.5 (http://opensource.apple.com/source/CF/CF-476.19/CFRuntime.c), it would appear that the check for the NSZombieEnabled environment variable comes in a GCC constructor. Therefore setting the NSZombieEnabled environment variable from within your app's image

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
Also, an isAutoReleased message would be worthless. At any point in time, you have no idea how many times library routines that you've called might have retained/released/autoreleased, nor should you care. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: Enabling NSZombieEnabled programatically

2010-01-10 Thread Ben Haller
On 10-Jan-10, at 8:41 AM, Dave Keck wrote: After checking the CF sources for 10.5 (http://opensource.apple.com/source/CF/CF-476.19/CFRuntime.c), it would appear that the check for the NSZombieEnabled environment variable comes in a GCC constructor. Therefore setting the NSZombieEnabled

[MEET] CocoaHeads-NYC this Thursday, 11/12

2010-01-10 Thread Andy Lee
Alex McAuley will give a talk entitled (ahem) Bad Apple: Classes and Methods That Suck. *NOTE* that we are back to our usual location at Tekserve. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and we like to see code and try to help. (2)

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Glenn L. Austin
On Jan 10, 2010, at 8:01 AM, Scott Ribe wrote: Also, an isAutoReleased message would be worthless. At any point in time, you have no idea how many times library routines that you've called might have retained/released/autoreleased, nor should you care. Actually, it would be nice to have *in a

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-10 Thread mmalc Crawford
On Jan 10, 2010, at 4:57 am, Quincey Morris wrote: I'm not sure where to go next with this ... I would strongly recommend dispensing with bindings for the moment: it's not an entry-level technology; it depends on an understanding of the fundamentals of Cocoa development including object

Re: [self frame].size.width reporting incorrectly

2010-01-10 Thread PCWiz
Yep, its definitely the correct text field. Well there are many NSTextFields on the screen (each in a collection view item) and all of them resize in unison when the window is resized. It still is reporting 185 as the width. e.g.: 0x20046df80 Str: “60 Unique 404 Error Pages” http://is.gd/5X43e

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Julien Jalon
You have Instruments for that (ObjectAlloc instrument or Zombie/leaks templates). Also under certain conditions, you have the static analyzer. -- Julien from his iPhone Le 10 janv. 2010 à 18:13, Glenn L. Austin gl...@austin-soft.com a écrit : On Jan 10, 2010, at 8:01 AM, Scott Ribe

Re: Landscape view drawing as if in portrait mode

2010-01-10 Thread Ian was here
By releasing the view controller's view and replacing it with a new one, I was losing the landscape translate coordinates, causing them to reset to their default (portrait). The solution is to setup the view controller with its default view at startup to landscape, then add the desired view as

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Joar Wingfors
On 10 jan 2010, at 09.13, Glenn L. Austin wrote: [pObj release]; // -- This should assert in a debug context, since it is already in the current autorelease pool. There is nothing wrong with releasing objects that have been added to autorelease pools per se, what could be considered

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Dave Camp
On Jan 10, 2010, at 9:13 AM, Glenn L. Austin wrote: On Jan 10, 2010, at 8:01 AM, Scott Ribe wrote: Also, an isAutoReleased message would be worthless. At any point in time, you have no idea how many times library routines that you've called might have retained/released/autoreleased, nor

Re: iPhone interruption with OpenAL?

2010-01-10 Thread Hank Heijink (Mailinglists)
Check the docs: http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html There's a section called OpenAL and Audio Interruptions that explains it. Good luck, Hank On Jan 10, 2010, at 4:23

Re: A password strength checker

2010-01-10 Thread Howard Siegel
Have a look at the source code for KeePass Password Safe ( http://keepass.info/). It has a password generator and strength computation. Version 1.x is written in C++ for MS Windows (using MFC). Version 2.x is a rewrite in C# for .NET. It has been ported as KeyPassX for Mac OS X and Linux. - h

Objective-C class generator for XML Schema

2010-01-10 Thread Rick Lee
Does anyone know of any a good Objective-C class generator for an XML schema? Best regards, Rick ___ 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

Re: NSPopupButton menu not showing in custom view for NSMenuItem

2010-01-10 Thread Daniel Meachum
Thank you Mr. Cox and Mr. Schlegel for your help. I'm using the nsmenuitem view to be displayed when clicking a status item (from the menu bar). Would it be better to display the view another way? Maybe in a window attached at the point of the status item? On Jan 8, 2010, at 9:21 AM, Graham

Using a NSButtonCell with template image in a NSTableView, through Interface Builder

2010-01-10 Thread Eloy Duran
In Interface Builder, I have set the dataCell of one of the columns of my NSTableView instance to be NSButtonCell. This works as expected, however, trying to use a ‘template’ image doesn't yield the expected visual result when clicking the button. How I configure the NSButtonCell: • Image:

How do I know when a new object is added to an NSArray or NSCollectionView?

2010-01-10 Thread Brad Stone
I'd like a viewController to be notified whenever an arrayController adds a new object. Here's why: I have an NSTextField in a view that gets added in an NSCollectionView. There's also an array controller and when I fire the add: selector the new view shows up in the collection. The view

Supported API for handling bad server certificates in NSURLConnection

2010-01-10 Thread Gordon Henriksen
[This is a faux follow-up to several year-old post in hopes of supplanting in Google the widespread information about using the private methods allowsAnyHTTPSCertificateForHost: and setAllowsAnyCertificate:forHost: and complete lack of information on the supported mechanism for accomplishing

Custom sheet question - which variable?

2010-01-10 Thread Jenny M
Hi, I have what may seem like a very stupid question about custom sheets. I am following this Apple dev tutorial: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCustomSheets.html and I'm looking at this piece of code here: if (!myCustomSheet) //Check

MFMailComposeViewController issue with not receiving taps

2010-01-10 Thread Brian Pink
Hey, my goal is to send an email w/attachment from within my app. I have a view with a couple UIPickerViews and some buttons on screen. One button triggers this code ( as simplified as I can make it and still reproduce the issue ) // mailDialog is a MFMailComposeViewController class variable

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Glenn L. Austin
On Jan 10, 2010, at 9:25 AM, Julien Jalon wrote: You have Instruments for that (ObjectAlloc instrument or Zombie/leaks templates). Also under certain conditions, you have the static analyzer. There's not a lot of options when running your project causes Instruments (or ObjectAlloc) to crash

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Julien Jalon
This is the purpose of the zombie instrument. Once you know what object is overreleased, you click on the arrow and voilà, you get the list of retain/release/autorelease so you can look where is the extra one. -- Julien from his iPhone Le 10 janv. 2010 à 19:19, Glenn L. Austin

Re: Custom sheet question - which variable?

2010-01-10 Thread Hank Heijink (Mailinglists)
That example assumes you have an instance variable called myCustomSheet in your class. You can tell from the method signature of the following method (called in the example you refer to) what type it should be: - (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Glenn L. Austin
On Jan 10, 2010, at 10:25 AM, Julien Jalon wrote: This is the purpose of the zombie instrument. Once you know what object is overreleased, you click on the arrow and voilà, you get the list of retain/release/autorelease so you can look where is the extra one. Le 10 janv. 2010 à 19:19,

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Bill Bumgarner
On Jan 10, 2010, at 10:29 AM, Glenn L. Austin wrote: If Instruments didn't crash on launch of our app, it would have been very helpful. I use it for my own projects (which aren't quite as large), but it wasn't available for this case. malloc_history and MallocStackLoggingNoCompact would

Application defaults and toolbar items

2010-01-10 Thread Martin Hewitson
Dear list, I'm somewhat confused about the proper way to distribute application updates when it comes to the toolbar in the app. The app has a toolbar with is configurable, which (I believe) means that the configuration of the toolbar is stored in the user's application defaults under

Re: Application defaults and toolbar items

2010-01-10 Thread Seth Willits
On Jan 10, 2010, at 10:46 AM, Martin Hewitson wrote: Is there a recommended way to handle this situation? Should I just tell the user that they should edit the toolbar to add the new button? Can I do something programatically to add the new button? Advice is very much welcome. 1) Do

Re: [self frame].size.width reporting incorrectly

2010-01-10 Thread Paul Sanders
I don't know if this is relevant, and I have not been following this discussion, but an NSTextField is temporarily 'overlayed' with an NSTextView (the field editor) while it has keyview status. This is all covered in the docs somewhere. Maybe there is a clue there for you. OK, I found a

RE: iCal-style NSTextFields

2010-01-10 Thread Ulai Beekam
No ideas at all? Were my instructions on how to find the iCal text fields that I want unclear? Please let me know if that is the case. Go into iCal (in Snow Leopard) and create a new event and and then click outside that event. Then double-click on that event and hit the Edit button. In

Re: iCal-style NSTextFields

2010-01-10 Thread Seth Willits
On Jan 10, 2010, at 11:49 AM, Ulai Beekam wrote: Go into iCal (in Snow Leopard) and create a new event and and then click outside that event. Then double-click on that event and hit the Edit button. In the window you see, you have some neat looking text fields that show only text when not

Differentiate FAT16 and FAT32

2010-01-10 Thread Matthias Arndt
Hi! I currently stuck, maybe someone can point my into the right direction! In my app I have to differentiate between USB storage devices formatted with a MSDOS-FAT16 or with MSDOS-FAT32 file system. At the moment I use [NSWorkspace getFileSystemInfoForPath] to get some information: BOOL

Re: How do I know when a new object is added to an NSArray or NSCollectionView?

2010-01-10 Thread Quincey Morris
On Jan 8, 2010, at 17:02, Brad Stone wrote: I'd like a viewController to be notified whenever an arrayController adds a new object. Here's why: ... 1) how do I get notified if a new object is added?

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
Actually, it would be nice to have *in a debugging context* since trying to track down a pointer that is in the autorelease pool the number of times it has been retained when you do a release would be very beneficial. Yes, it would slow things down, but it would sure save a lot of time when

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Paul Sanders
Try this, maybe it will help: http://www.fromconcentratesoftware.com/2007/08/09/nszombieenabled-for-the-debugger-adverse/ I haven't tried this myself, but it looks like you will be able to inspect the object in gdb just before it gets zombified. Once you know something about the object (i.e.

Re: Differentiate FAT16 and FAT32

2010-01-10 Thread Alastair Houghton
On 10 Jan 2010, at 20:04, Matthias Arndt wrote: In my app I have to differentiate between USB storage devices formatted with a MSDOS-FAT16 or with MSDOS-FAT32 file system. Because? Remember that the flavour of FAT in use is defined *entirely* by the number of clusters on the volume... (i.e.

Re: Differentiate FAT16 and FAT32

2010-01-10 Thread Matthias Arndt
Alastair, Am 10.01.2010 um 21:34 schrieb Alastair Houghton: In my app I have to differentiate between USB storage devices formatted with a MSDOS-FAT16 or with MSDOS-FAT32 file system. Because? Remember that the flavour of FAT in use is defined *entirely* by the number of clusters on the

Re: iCal-style NSTextFields

2010-01-10 Thread Josh Abernathy
If you're asking about the shadow, create a child window and move them to that when they're editing. On Jan 10, 2010, at 11:56 AM, Seth Willits wrote: On Jan 10, 2010, at 11:49 AM, Ulai Beekam wrote: Go into iCal (in Snow Leopard) and create a new event and and then click outside that

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Graham Cox
On 11/01/2010, at 4:43 AM, Joar Wingfors wrote: [pObj release]; // -- This should assert in a debug context, since it is already in the current autorelease pool. There is nothing wrong with releasing objects that have been added to autorelease pools per se, what could be

Re: iCal-style NSTextFields

2010-01-10 Thread Seth Willits
On Jan 10, 2010, at 2:54 PM, Josh Abernathy wrote: If you're asking about the shadow, create a child window and move them to that when they're editing. Oops. My memory of them was foggy. :-) Borderless child window it is. -- Seth Willits ___

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Graham Cox
On 11/01/2010, at 10:35 AM, Joar Wingfors wrote: I don't really see what that would give you that you don't already have with zombies + memory management history in Instruments? With that functionality so readily available in Instruments, there's really very little detective work left in

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Paul Sanders
I think this is a great idea! I personally find the fact that autorelease pools are totally opaque extremely unhelpful. Have you got the energy to file an enhancement request Graham? I'd like to see a method to dump out all the objects in the current chain of autoreleasepools, too. I did

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Bill Bumgarner
On Jan 10, 2010, at 4:01 PM, Paul Sanders wrote: It would be extremely simple for Apple to implement this suggestion and there's no question in my mind that it would rapidly nail a certain class of bug, so what's to lose? Famous last words ;) b.bum

Re: Custom sheet question - which variable?

2010-01-10 Thread John Joyce
On Jan 10, 2010, at 2:01 PM, cocoa-dev-requ...@lists.apple.com wrote: From: Jenny M safflo...@gmail.com Subject: Custom sheet question - which variable? To: cocoa-dev@lists.apple.com Message-ID: a9653e641001091840u374008f5v3c4de5d8d519b...@mail.gmail.com Content-Type: text/plain;

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Bill Bumgarner
On Jan 10, 2010, at 4:01 PM, Paul Sanders wrote: It would be extremely simple for Apple to implement this suggestion and there's no question in my mind that it would rapidly nail a certain class of bug, so what's to lose? Famous last words ;) All snark aside, I wrote a weblog post

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Graham Cox
On 11/01/2010, at 11:01 AM, Paul Sanders wrote: Have you got the energy to file an enhancement request Graham? Filed: #7528006 It would be useful to have available the following two debugging functions: a) A way to test whether a given object is referenced by any current autorelease

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Chris Parker
On 10 Jan 2010, at 5:17 PM, Graham Cox wrote: On 11/01/2010, at 11:01 AM, Paul Sanders wrote: Have you got the energy to file an enhancement request Graham? Filed: #7528006 It would be useful to have available the following two debugging functions: a) A way to test whether a given

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Alex Kac
B) is possible now. I used it a few months ago when debugging a ton of nested auto-release pools. I can’t remember the commands right now, but it required some stuff at the beginning to turn on auto-release debug support. Then I could walk through auto-release pools in the debugger or even

Re: if statement causing 32 Byte leak?

2010-01-10 Thread Scott Ribe
Just a quick note: one problem with this is false positives; you don't necessarily control all the code that handles the object in question. I think perhaps you didn't notice that he said at -dealloc time. There is no case in which an autorelease pool should have a reference to an object when

How to know whether property in Cocoa class is KVO-compliant?

2010-01-10 Thread Jerry Krinock
After studying some about bindings during the last week, I decided that, just for fun, I would bind an NSSegmentedControl to its window controller using a binding instead of target/action. I thought that selectedSegment might be a KVO-compliant property of NSSegmentedControl because it has a

Re: How to know whether property in Cocoa class is KVO-compliant?

2010-01-10 Thread Dave Fernandes
Look for Cocoa Bindings Guide in the docs. It would be nice if it were cross-referenced in every class description. SelectedIndex should work for a segmented control. Haven't tried it myself though. Cheers, Dave On 2010-01-10, at 10:58 PM, Jerry Krinock wrote: After studying some about

Re: Custom sheet question - which variable?

2010-01-10 Thread Jenny M
Ah! Duh, thanks. So my related question is, I have the NSWindow object is a separate xib file, and that xib file's File's Owner is of a custom NSWindowController class, so how would I link the window inside the NewObject xib to the main application controller? The Apple documentation indicates it

Re: How to know whether property in Cocoa class is KVO-compliant?

2010-01-10 Thread mmalc Crawford
On Jan 10, 2010, at 8:18 pm, Dave Fernandes wrote: Look for Cocoa Bindings Guide in the docs. It would be nice if it were cross-referenced in every class description. SelectedIndex should work for a segmented control. Haven't tried it myself though. No; the Cocoa Bindings Reference

Need some help with custom views . . .

2010-01-10 Thread Michael A. Crawford
I'm trying to create come custom views with attributes exhibited in this screen shot snippet: files.me.com/michaelacrawford/iy4bhj I'm looking for suggestions on how I might accomplish some of these effects. Here are some ideas I've come up with on my own, some of which I have already tried

Re: Custom sheet question - which variable?

2010-01-10 Thread Jerry Krinock
On 2010 Jan 10, at 20:25, Jenny M wrote: What I'm trying to do is this. I have a main window with a button to say Create New, and I have an NSWindowController class to handle the creation/check/storage of that new object. Learning your way around the documentation takes awhile, but do it