Re: iPad: CGPDF... methods and leak/cache

2010-07-08 Thread sebi
On 07.07.2010, at 19:35, Kyle Sluder wrote: > On Wed, Jul 7, 2010 at 10:21 AM, sebi wrote: >> When I get a memory warning I unload most of the images and I also release >> the current CGPDFDocumentRef which should release the memory. >> Unfortunately it doesn't. ObjectAlloc shows me that I have

Re: Sanity Check

2010-07-08 Thread Mike Abdullah
On 7 Jul 2010, at 21:07, k...@highrolls.net wrote: > Does this code make sense? Where > > [[ SewAndColorController alloc] initWithWindowNibName:@"nibName"] > > is called from another view action? > > > @interface SewAndColorController : NSWindowController { > > NSPanel *m_panel; > } >

Re: How to catch [NSEvent dealloc]?

2010-07-08 Thread Paul Sanders
>> In that case I'd guess you might want to use method swizzling on >> -[NSEvent dealloc]: >> >> http://www.cocoadev.com/index.pl?MethodSwizzling >> >> Beware that swizzling is a powerful and dangerous technique, and you >> want to code your override with the utmost caution, but it's a great >> w

Re: Sanity Check

2010-07-08 Thread koko
his seems weird. Why assign the panel/window to your own ivar when this is exactly -[NSWindowController window] is designed to do for you? I was thinking I might need to reference it and rather than call for it just have it hanging around. Yes, no? -koko On Jul 8, 2010, at 4:44 AM, Mi

Re: Sanity Check

2010-07-08 Thread koko
Thanks Ken. I'll do 2. -koko On Jul 7, 2010, at 6:15 PM, Ken Thomases wrote: On Jul 7, 2010, at 6:09 PM, k...@highrolls.net wrote: Even though it would be better style would my approach cause any problem? I don't see any. Yes. You alloc+init and you also retain. Then, you (presumably

Re: Sanity Check

2010-07-08 Thread Kyle Sluder
\On Thu, Jul 8, 2010 at 7:19 AM, wrote: >> his seems weird. Why assign the panel/window to your own ivar when this is >> exactly -[NSWindowController window] is designed to do for you? > > I was thinking I might need to reference it and rather than call for it just > have it hanging around. Yes,

Re: Sanity Check

2010-07-08 Thread Sherm Pendley
On Thu, Jul 8, 2010 at 10:19 AM, wrote: >> his seems weird. Why assign the panel/window to your own ivar when this is >> exactly -[NSWindowController window] is designed to do for you? > > I was thinking I might need to reference it and rather than call for it just > have it hanging around. Yes,

Re: Programmatically closing a submenu (NSMenu)

2010-07-08 Thread Eric Schlegel
On Jul 7, 2010, at 4:20 PM, augusto callejas wrote: > hi- > > i have an NSMenu that has another NSMenu as a submenu (via an NSMenuItem). > in a certain situation, when the submenu is visible, i want to close that > submenu, but without closing the main NSMenu. > the documentation for [NSMenu ca

Re: Sanity Check

2010-07-08 Thread koko
I have taken all advice and the code now looks like below which cleans up the pointed out controller leak and does not store [self window]: - (IBAction)sewing:(id)sender { [[[SewingController alloc] initWithWindowNibName:@"Sewing and Color" andBFileName:&mBFilename] release]; } - (id

Re: Sanity Check

2010-07-08 Thread John Johnson
> I have taken all advice and the code now looks like below which cleans up the > pointed out controller leak and does not store [self window]: There still seems to be some problems with your code... > - (IBAction)sewing:(id)sender { > > [[[SewingController alloc] initWithWindowNibName:@"

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread augusto callejas
i'm trying to replicate the functionality of spotlight using an embedded NSSearchField inside an NSMenu. when a search is performed, i add NSMenuItems to the NSMenu. when you perform a search in spotlight, the first search result is highlighted and you can immediately use the up/down arrows to

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread Graham Cox
On 09/07/2010, at 2:30 AM, Augusto Callejas wrote: > i'm trying to replicate the functionality of spotlight using an embedded > NSSearchField inside an NSMenu. > when a search is performed, i add NSMenuItems to the NSMenu. when you > perform a search in spotlight, > the first search result is

Re: Sanity Check

2010-07-08 Thread Kyle Sluder
On Thu, Jul 8, 2010 at 8:57 AM, wrote: > - (IBAction)sewing:(id)sender   { > >        [[[SewingController alloc] initWithWindowNibName:@"Sewing and Color" > andBFileName:&mBFilename] release]; This is entirely wrong. Why would you create an object just to immediately release it? Please review th

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread augusto callejas
yes i know its not a real menu, but given it mostly behaves like one, i was trying to use existing functionality without having to rewrite the menu-ing system. thanks, augusto. On Jul 8, 2010, at 9:38 AM, Graham Cox wrote: > > On 09/07/2010, at 2:30 AM, Augusto Callejas wrote: > >> i'm tryin

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread Kyle Sluder
On Thu, Jul 8, 2010 at 9:57 AM, augusto callejas wrote: > yes i know its not a real menu, but given it mostly behaves like one, > i was trying to use existing functionality without having to rewrite the > menu-ing system. Given that you're going to want to do a significant amount of custom work,

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread Eric Schlegel
On Jul 8, 2010, at 9:34 AM, augusto callejas wrote: > i'm trying to replicate the functionality of spotlight using an embedded > NSSearchField inside an NSMenu. > when a search is performed, i add NSMenuItems to the NSMenu. when you > perform a search in spotlight, > the first search result is

Re: Sanity Check

2010-07-08 Thread koko
On Jul 8, 2010, at 10:30 AM, John Johnson wrote: I have taken all advice and the code now looks like below which cleans up the pointed out controller leak and does not store [self window]: There still seems to be some problems with your code... - (IBAction)sewing:(id)sender { [[[Sewi

Re: Sanity Check

2010-07-08 Thread koko
On Jul 8, 2010, at 10:41 AM, Kyle Sluder wrote: On Thu, Jul 8, 2010 at 8:57 AM, wrote: - (IBAction)sewing:(id)sender { [[[SewingController alloc] initWithWindowNibName:@"Sewing and Color" andBFileName:&mBFilename] release]; This is entirely wrong. Why would you create an objec

Re: Sanity Check

2010-07-08 Thread Kyle Sluder
On Thu, Jul 8, 2010 at 10:19 AM, wrote: > > On Jul 8, 2010, at 10:41 AM, Kyle Sluder wrote: > >> On Thu, Jul 8, 2010 at 8:57 AM,   wrote: >>> >>> - (IBAction)sewing:(id)sender   { >>> >>>       [[[SewingController alloc] initWithWindowNibName:@"Sewing and >>> Color" >>> andBFileName:&mBFilename]

Re: Sanity Check

2010-07-08 Thread vincent habchi
Le 8 juil. 2010 à 19:34, Kyle Sluder a écrit : >> Because I retain it in the init method , I don't need a reference to it >> where the alloc is called > > Retaining self in -init is wrong. It doesn't matter if it works. You can retain your controller in -windowDidLoad and (auto)release it in -w

Re: Programmatically highlighting an NSMenuItem

2010-07-08 Thread vincent habchi
Le 8 juil. 2010 à 18:57, augusto callejas a écrit : > yes i know its not a real menu, but given it mostly behaves like one, > i was trying to use existing functionality without having to rewrite the > menu-ing system. As far as I know, you cannot use menu to do what you seek to achieve. You woul

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Nava Carmon
Can somebody answer this please? On Jul 8, 2010, at 8:41 AM, Nava Carmon wrote: > Hi, > > I added a custom view with a NSSearchField as a first menu item to a status > bar menu. When I run the application from debugger I can click and write in > the NSSearchField. After I go to another applica

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread vincent habchi
Le 8 juil. 2010 à 21:26, Nava Carmon a écrit : > Can somebody answer this please? > >> I added a custom view with a NSSearchField as a first menu item to a status >> bar menu. When I run the application from debugger I can click and write in >> the NSSearchField. After I go to another applicati

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread augusto callejas
when you click again on your status menu, try making your app the active app: [NSApp activateIgnoringOtherApps:YES]; augusto. On Jul 8, 2010, at 12:26 PM, Nava Carmon wrote: > Can somebody answer this please? > > On Jul 8, 2010, at 8:41 AM, Nava Carmon wrote: > >> Hi, >> >> I added a custom

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Nava Carmon
Hi, thank you for answering. I do the following: - (void) menuWillOpen:(NSMenu *)menu { > [statusItem popUpStatusItemMenu: menu]; > [NSApp activateIgnoringOtherApps:YES]; } It brings the process to the front, but on first click the menu doesn't stay open, so i have to click it again to show u

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread augusto callejas
try delaying displaying the menu through a notification: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showPopupMenu:) name:NSApplicationDidBecomeActiveNotification object:nil] On Jul 8, 2010, at 1:53 PM, Nava Carmon wrote: > Hi, thank you for answering. > > I do

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Nava Carmon
Tried it, In awakwFromNib I added: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showPopupMenu:) name:NSApplicationDidBecomeActiveNotification object:nil]; added a function: - (void)showPopupMenu:(NSNotification *)notification { [statusItem popUpSt

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread augusto callejas
not sure how to prevent flickering, this entire approach is hack-ish anyhow :) On Jul 8, 2010, at 2:09 PM, Nava Carmon wrote: > Tried it, > > In awakwFromNib I added: > > [[NSNotificationCenter defaultCenter] addObserver:self > selector:@selector(showPopupMenu:) > name:NSApplicationDid

ABPeoplePickerView setSources

2010-07-08 Thread Jonathan Nathan
In various Mac OS X 10.6 Apple apps (e.g., Address Book, iChat, etc.) there are ABPeoplePickerView objects that show sources in the Group column that go beyond the default "On My Mac" group (e.g., LDAP directories, Exchange servers, etc.). When I include an ABPeoplePickerView in my app (from IB), i

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Nava Carmon
So what is the best and by-the-book approach? Spotlight does it so smooth... On Jul 9, 2010, at 12:12 AM, augusto callejas wrote: > not sure how to prevent flickering, this entire approach is hack-ish anyhow :) > > On Jul 8, 2010, at 2:09 PM, Nava Carmon wrote: > >> Tried it, >> >> In awakwFr

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Kyle Sluder
On Thu, Jul 8, 2010 at 2:29 PM, Nava Carmon wrote: > So what is the best and by-the-book approach? Spotlight does it so smooth... As was discussed in the other thread on this topic, don't use an NSMenu for this. --Kyle Sluder ___ Cocoa-dev mailing lis

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Eric Schlegel
On Jul 8, 2010, at 2:29 PM, Nava Carmon wrote: > So what is the best and by-the-book approach? Spotlight does it so smooth... Spotlight presents its own window and does not use a menu at all. -eric ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.c

Re: setting focus on NSSearchField in status bar menu item

2010-07-08 Thread Nava Carmon
Can you point me on this thread please? Thanks a lot! On Jul 9, 2010, at 12:36 AM, Kyle Sluder wrote: > On Thu, Jul 8, 2010 at 2:29 PM, Nava Carmon wrote: >> So what is the best and by-the-book approach? Spotlight does it so smooth... > > As was discussed in the other thread on this topic, don

-processPendingChanges removing changed objects from -updatedObjects list

2010-07-08 Thread Daniel DeCovnick
Hi all, I'm really stumped by something. The short version is that calling - [NSManagedObjectContext processPendingChanges] is actually removing changed managed objects from the list returned by - [NSManagedObjectContext updatedObjects]. Anyone know why this would happen? The long version

Re: NSView Docs. Was: Binding -- or not -- a button created in code

2010-07-08 Thread Jerry Krinock
Well, I'm still using -[NSView viewWillMoveToWindow:] to remove my observers and unbind my bindings, with no problems. But I'm still scared that someday it might not be invoked when a window is closed. So I filed a bug on the documentation. Problem ID: 8172493 Title: -[NSView viewWillMoveToW

Re: CoreData and undo/redo : how to add a managed object with attributes already set in the undo/redo stack ?

2010-07-08 Thread Guillaume Laurent
On Jun 29, 2010, at 22:47 , Sean McBride wrote: > I don't believe that's the right pattern. In awakeFromInsert/Fetch, one > should be using primitive setters. The docs say "If you want to set > attribute values in an implementation of this method, you should > typically use primitive accessor me

Re: CoreData and undo/redo : how to add a managed object with attributes already set in the undo/redo stack ?

2010-07-08 Thread Guillaume Laurent
On Jun 28, 2010, at 12:33 , Mike Abdullah wrote: > > On 27 Jun 2010, at 00:01, Guillaume Laurent wrote: > >> Hi all, >> >> I'm having difficulties with the undo/redo mechanism and my Core Data >> objects. The problem is that I create a CoreData object (say a rectangle), >> then set some of i

Re: CoreData and undo/redo : how to add a managed object with attributes already set in the undo/redo stack ?

2010-07-08 Thread Guillaume Laurent
On Jun 27, 2010, at 4:08 , Jerry Krinock wrote: > > On 2010 Jun 26, at 16:01, Guillaume Laurent wrote: > >> I'm having difficulties with the undo/redo mechanism and my Core Data >> objects. > > Uh-huh. > >> The problem is that I create a CoreData object (say a rectangle), then set >> some o

Pipelining HTTP Requests?

2010-07-08 Thread Dave DeLong
Hi everyone, Is there a way to pipeline HTTP requests on the Mac (and pre-iOS4)? I've found vague references in the CFNetwork source from 10.4 to "_CFNetConnectionSetShouldPipeline()", but that's not a reliable option. I've also seen mentioned that CFHTTPStream supposedly supports pipelining,

Display problem when drag session interrupted

2010-07-08 Thread Laurent Daudelin
I'm allowing drag into my NSOutlineView and I've been using the example "DragNDropOutlineView" as a guide. Everything works fine except when I interrupt a drag session by pressing escape. The drag session is canceled and my outline view is left with some artifact from the drag, an insertion line

Another basic CoreData question

2010-07-08 Thread gumboots
Using the standard Employee/Department example, Whats the best way to set a default department for an Employee? So that every employee is created with a relationship to the "mailRoom" department. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Jerry Krinock
Consider this XML: wherein there is a linefeed (0x0a) followed by two spaces between the command and "California". The accented é is represented by two bytes, 0xa3 0xc9. It's all nice UTF-8, as indicated in the header. When I parse this using NSXMLParser, the value for the key "locatio

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Steve Bird
On Jul 8, 2010, at 10:04 PM, Jerry Krinock wrote: > Consider this XML: > > > > > > > wherein there is a linefeed (0x0a) followed by two spaces between the command > and "California". The accented é is represented by two bytes, 0xa3 0xc9. > It's all nice UTF-8, as indicated in the heade

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread Jeff Johnson
No, I don't believe that this is a bug. See section 3.3.3 Attribute-Value Normalization: http://www.xml.com/axml/testaxml.htm -Jeff On Jul 8, 2010, at 9:04 PM, Jerry Krinock wrote: > Consider this XML: > > > > > > > wherein there is a linefeed (0x0a) followed by two spaces between the

Re: Another basic CoreData question

2010-07-08 Thread Noah Desch
On Jul 8, 2010, at 7:33 PM, gumbo...@mac.com wrote: > Using the standard Employee/Department example, Whats the best way to set a > default department for an Employee? > So that every employee is created with a relationship to the "mailRoom" > department. Probably to add some custom code to

Re: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-08 Thread John Joyce
You may need to escape it first if it is CDATA. You might benefit from growing the schema to have Then you can insert new line characters as you wish for presentation of the data elsewhere. New lines would often be considered presentational stuff. On Jul 8, 2010, at 9:18 PM, Jeff Johnson wrot