Re: Pass-by value… warning

2010-07-07 Thread vincent habchi
Le 7 juil. 2010 à 08:54, Greg Guerin a écrit : > vincent habchi wrote: > >> The analyzer does not figure out that the pt array gets initialized through >> the loop by copying values directly from a chunk of memory, and spits out >> the warning about pt [•] not being defined. Maybe I should repo

Re: Pass-by value… warning

2010-07-07 Thread vincent habchi
Le 7 juil. 2010 à 09:23, vincent habchi a écrit : > That's true, the compiler cannot guarantee that dim > 1, which is always the > case actually. > I am going to put an extra text at the beginning of the method, like: "if > (dim < 1) return;" and see what happens. The warning goes away when I d

Re: Pass-by value… warning (was: NSText Field fieldeditor subclass example? (and an unrelate d other inquiry))

2010-07-07 Thread Graham Cox
On 07/07/2010, at 3:59 PM, vincent habchi wrote: > - (void)drawPoint:(CGContextRef)ctx origin:(CGPoint)origin dimension:(int)dim > data:(double **)data { > double pt [dim]; > > for (int i = 0 ; i < dim ; i ++, *data ++) { > memcpy (& (pt [i]), * data, sizeof (dou

Re: Pass-by value… warning (was: NSText Field fieldeditor subclass example? (and an unrelate d other inquiry))

2010-07-07 Thread vincent habchi
Le 7 juil. 2010 à 09:33, Graham Cox a écrit : > > On 07/07/2010, at 3:59 PM, vincent habchi wrote: > >> - (void)drawPoint:(CGContextRef)ctx origin:(CGPoint)origin >> dimension:(int)dim data:(double **)data { >> double pt [dim]; >> >> for (int i = 0 ; i < dim ; i ++, *data ++) {

Re: Accessing address bar data from Safari extension

2010-07-07 Thread cocoa learner
I am sorry. On Tue, Jul 6, 2010 at 7:08 PM, John Joyce wrote: > > On Jul 6, 2010, at 6:21 AM, cocoa learner wrote: > > > Hi All, > > > > Can we access address bar text box and bookmark data from Safari > extension? > > If yes, please share some thoughts or APIs. > > > > -- > > Thanks > > Cocoa.

Re: Scrolling not working ...

2010-07-07 Thread vincent habchi
Le 7 juil. 2010 à 08:42, Jay Reynolds Freeman a écrit : > I have has reasonable values. The actual code is based on the > example for program-controlled scrolling in the documentation, and > goes like this: > > NSPoint scrollerOrigin = [[ contentView] bounds].origin; > > Then, later: > > [[

Custom control and cells

2010-07-07 Thread Georg Seifert
Hi, I try to find an example on how to implement the mouse tracking and editing behavior of a NSCell from my own control (subclass of NSControl). I need a control that can handle several kinds of cells like ImageAndTextCell (with editing) or popup button cells. I read a lot about it but can’t

Re: Pass-by value… warning (was: NSText Field fieldeditor subclass example? (and an unrelate d other inquiry))

2010-07-07 Thread Graham Cox
On 07/07/2010, at 5:51 PM, vincent habchi wrote: > The double indirection is necessary in order for the master data pointer > (*data) to progress through the data chunk; since that chunk can hold > different items, I have to decode it on the fly and call the appropriate > method that interpret

Re: Run application before Login starts?

2010-07-07 Thread kirankumar
hi thanks greg guerin. From the SampleCode, i follow these steps for my application but its not displaying my application ,its displays only menubar at the top of the screen when login window appears. Any how my app works fine, but when i login my appl was quit.But i need my appl to work, for

Re: Continuous zoom in MKMapView

2010-07-07 Thread Paulo Andrade
On Jul 5, 2010, at 2:47 AM, Miguel Arroz wrote: > Hello, > > I'm trying to control a map view programmatically, and I need to zoom in and > out with high accuracy (like when the user pinches it for zomming, the map > may display an arbitrary level of zoom when the user stops touching the view

Mobileme syncing of core data persistent store

2010-07-07 Thread Martin Hewitson
Dear list, I have a core data app in which I have attempted to implement mobileme syncing. I have a helper class which implements the NSPersistentStoreCoordinatorSyncing protocol and I've implemented - (NSArray *)managedObjectContextsToMonitorWhenSyncingPersistentStoreCoordinator:(NSPersistent

UINavigationBar color in popover

2010-07-07 Thread Marcel Borsten
I've created a simple splitview. When the view is in portrait the tableview resides in a popover. In the popover view the navigationbar has a black color behind it (see image) <> Another popover that hold the same type of tableview does display normal: <> Anybody know what is going on here?

Re: Pass-by value… warning

2010-07-07 Thread Greg Guerin
vincent habchi wrote: That's true, the compiler cannot guarantee that dim > 1, which is always the case actually. I am going to put an extra text at the beginning of the method, like: "if (dim < 1) return;" and see what happens. If you need to guarantee dim > 1, then your if statement shou

NSButtonCell visibility in NSOutlineView.

2010-07-07 Thread Joshua Garnham
It seems to be a pretty simple task but I am unsure how to go about it. I am looking to hide a checkbox in Column 0 if the row it's on has any children. How would I do this? Cheers. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: NSButtonCell visibility in NSOutlineView.

2010-07-07 Thread Nick Zitzmann
On Jul 7, 2010, at 10:06 AM, Joshua Garnham wrote: > It seems to be a pretty simple task but I am unsure how to go about it. > I am looking to hide a checkbox in Column 0 if the row it's on has any > children. > > How would I do this? Try this: In your outline view delegate, implement -outlin

Re: NSButtonCell visibility in NSOutlineView.

2010-07-07 Thread Joshua Garnham
Thanks, that worked just how I wanted it too! From: Nick Zitzmann To: Joshua Garnham Cc: cocoa-dev@lists.apple.com Sent: Wed, 7 July, 2010 17:24:12 Subject: Re: NSButtonCell visibility in NSOutlineView. On Jul 7, 2010, at 10:06 AM, Joshua Garnham wrote: >

Building a Spotlight-like custom NSMenu with an embedded NSSearchField

2010-07-07 Thread augusto callejas
hi- i've built the beginning of my own custom NSMenu with an embedded NSSearchField. i was wondering if the following behavior is possible: in spotlight, when you enter a search term, you start getting results and the first term is highlighted: http://www.genielogic.com/page7/files/spotlightmen

iPad: CGPDF... methods and leak/cache

2010-07-07 Thread sebi
Hello, I'm writing an app on iPad that lets the user navigate through a >700 page pdf. When he's on some page I preload the next and previous pages as UIImage (using CGContextDrawPDFPage()) so navigation is faster. Everything is fine at first, but after a few tens of pages the memory gets full

Re: Pass-by value? warning (was: NSTextField fieldeditor subclass example? (and an unrelated other inquiry))

2010-07-07 Thread Matt Neuburg
On Wed, 7 Jul 2010 07:59:38 +0200, vincent habchi said: >Hi! > >Maybe I should report this to the LLVM team? You can, but I wouldn't get my knickers in a twist about it. The static analyzer is just an analyzer. It does get some false positives, but so what? Just think of it as a list of suggested

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

2010-07-07 Thread Kyle Sluder
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 thousands of small > memory blocks hanging around

Programmatically highlighting an NSMenuItem (was: Building a Spotlight-like custom NSMenu with an embedded NSSearchField)

2010-07-07 Thread augusto callejas
hi- i'd like to simplify my question from earlier: how do i programmatically highlight an NSMenuItem inside an NSMenu? i only see "isHighlighted" method in NSMenuItem, but no method for setting the currently highlighted menu item. thanks, augusto.___

Re: Pass-by value? warning (was: NSTextField fieldeditor subclass example? (and an unrelated other inquiry))

2010-07-07 Thread Bill Bumgarner
I missed the OP's post If the static analyzer is barfing up a false positive, please report it (http://bugreport.apple.com/ works fine). b.bum On Jul 7, 2010, at 10:34 AM, Matt Neuburg wrote: >> Maybe I should report this to the LLVM team? > > You can, but I wouldn't get my knickers in a

static analyzer

2010-07-07 Thread Matt Neuburg
On or about 7/7/10 11:17 AM, thus spake "Bill Bumgarner" : > I missed the OP's post > > If the static analyzer is barfing up a false positive, please report it > (http://bugreport.apple.com/ works fine). Is that generally true? I mean, first of all, false positives are a well-known phenomeno

Re: static analyzer

2010-07-07 Thread Bill Bumgarner
On Jul 7, 2010, at 11:33 AM, Matt Neuburg wrote: > On or about 7/7/10 11:17 AM, thus spake "Bill Bumgarner" : > >> I missed the OP's post >> >> If the static analyzer is barfing up a false positive, please report it >> (http://bugreport.apple.com/ works fine). > > Is that generally true? I

Re: Pass-by value … warning (was: NSTextFie ld fieldeditor subclass example? (and an unrelated other in quiry))

2010-07-07 Thread Sean McBride
On Wed, 7 Jul 2010 07:59:38 +0200, vincent habchi said: >The analyzer does not figure out that the pt array gets initialized >through the loop by copying values directly from a chunk of memory, and >spits out the warning about pt [•] not being defined. Maybe I should >report this to the LLVM team?

How to catch [NSEvent dealloc]?

2010-07-07 Thread Paul Sanders
I have a problem. I need to know when an NSApplicationDefined NSEvent is deallocated, because it contains a reference to an object in data1 and I want to release that object at that time. Problem is, you can't subclass NSEvent because there are no public initialisers. Short of swizzling [NSEv

Sanity Check

2010-07-07 Thread koko
Does this code make sense? Where [[ SewAndColorController alloc] initWithWindowNibName:@"nibName"] is called from another view action? @interface SewAndColorController : NSWindowController { NSPanel *m_panel; } @end #import "SewAndColorController.h" @implementation SewAndColorContr

Re: Sanity Check

2010-07-07 Thread Dave DeLong
Why are you retaining self? Other than that, yes it looks fine (assuming you're assigning the results of [[SewAndColorController alloc] init...] into a variable). Dave On Jul 7, 2010, at 2:07 PM, k...@highrolls.net wrote: > Does this code make sense? Where > > [[ SewAndColorController alloc]

Restricting control characters in an NSSearchField/NSTextField

2010-07-07 Thread augusto callejas
hi- i have an NSSearchField embedded in an NSMenu and when i have another NSMenuItem highlighted, and i navigate the menu using the up and down arrows, those characters are being added to my NSSearchField (i.e. 0x30, 0x31, etc), but i'd rather not have those characters added to the string text

2009 WWDC videos

2010-07-07 Thread Rainer Standke
Hello all, I just realized that the 2010 WWDC videos are accessible now - but what about the ones from 2009? Is there a way to ask Apple to make them available? Thanks, Rainer___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Fwd: Sanity Check

2010-07-07 Thread koko
Begin forwarded message: From: k...@highrolls.net Date: July 7, 2010 2:24:18 PM MDT To: Dave DeLong Subject: Re: Sanity Check Ok that was my concern. I am not assigning [[SewAndColorController alloc] init...] into a variable ergo I thought I should [self retain] and the release it when

Re: static analyzer

2010-07-07 Thread vincent habchi
Le 7 juil. 2010 à 20:35, Bill Bumgarner a écrit : >> Is that generally true? I mean, first of all, false positives are a >> well-known phenomenon with this static analyzer (the Web page at llvm.org >> talks about this). Second, they do no harm. I get a false positive in *any* >> of my apps that us

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 3:53 PM, Paul Sanders wrote: > I have a problem.  I need to know when an NSApplicationDefined NSEvent is > deallocated, because it contains a reference to an object in data1 and I want > to release that object at that time.  Problem is, you can't subclass NSEvent > becaus

Re: static analyzer

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 2:33 PM, Matt Neuburg wrote: > On or about 7/7/10 11:17 AM, thus spake "Bill Bumgarner" : > >> I missed the OP's post >> >> If the static analyzer is barfing up a false positive, please report it >> (http://bugreport.apple.com/ works fine). > > Is that generally true? I

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Paul Sanders
> If you can require 10.6 (or iOS 4, maybe?) then you can use the new > associated object API. Use objc_setAssociatedObject to attach your > object to the NSEvent object, and the runtime will automatically take > care of destroying it for you when the NSEvent is destroyed. Sadly (and possibly mist

NSWindowController window returns nil

2010-07-07 Thread koko
- (id) initWithWindowNibName:(NSString*)windowNibName andBFileName: (BFilename*)bfilename { self = [super initWithWindowNibName:windowNibName]; if (self != nil) { m_panel = [self window]; Design *cv = [m_panel contentView]; c

Re: Sanity Check

2010-07-07 Thread Chris Hanson
On Jul 7, 2010, at 1:25 PM, k...@highrolls.net wrote: > Ok that was my concern. I am not assigning [[SewAndColorController alloc] > init...] into a variable ergo I thought I should [self retain] and the > release it when the panel is closed. Better style would be to still assign the new instan

Re: Sanity Check

2010-07-07 Thread koko
Thank you Chris! Even though it would be better style would my approach cause any problem? I don't see any. -koko On Jul 7, 2010, at 5:02 PM, Chris Hanson wrote: On Jul 7, 2010, at 1:25 PM, k...@highrolls.net wrote: Ok that was my concern. I am not assigning [[SewAndColorController al

Programmatically closing a submenu (NSMenu)

2010-07-07 Thread augusto callejas
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 cancelTracking] says it dismisses the menu, but when i call that on

Re: NSWindowController window returns nil

2010-07-07 Thread Kyle Sluder
On Wed, Jul 7, 2010 at 3:54 PM, wrote: > - (id) initWithWindowNibName:(NSString*)windowNibName > andBFileName:(BFilename*)bfilename > { >        self = [super initWithWindowNibName:windowNibName]; >        if (self != nil) >        { >                m_panel = [self window]; >                Desi

Re: NSWindowController window returns nil

2010-07-07 Thread koko
Yeah, I remembered all those things after I posted ... sorry for wasting bandwidth! -koko On Jul 7, 2010, at 5:23 PM, Kyle Sluder wrote: On Wed, Jul 7, 2010 at 3:54 PM, wrote: - (id) initWithWindowNibName:(NSString*)windowNibName andBFileName:(BFilename*)bfilename { self = [super i

Re: Pass-by value… warning

2010-07-07 Thread Ken Thomases
On Jul 7, 2010, at 10:27 AM, Greg Guerin wrote: > vincent habchi wrote: > >> That's true, the compiler cannot guarantee that dim > 1, which is always the >> case actually. >> I am going to put an extra text at the beginning of the method, like: "if >> (dim < 1) return;" and see what happens. >

Re: Sanity Check

2010-07-07 Thread Ken Thomases
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) only release once when the panel closes. Thus, you are leaking the window cont

Re: Programmatically highlighting an NSMenuItem

2010-07-07 Thread Graham Cox
On 08/07/2010, at 3:47 AM, augusto callejas wrote: > hi- > > i'd like to simplify my question from earlier: > > how do i programmatically highlight an NSMenuItem inside an NSMenu? > i only see "isHighlighted" method in NSMenuItem, but no method for setting > the currently highlighted menu item

Re: static analyzer

2010-07-07 Thread Matt Neuburg
On Wed, 7 Jul 2010 17:54:58 -0400, Michael Ash said: >> I get a false positive in *any* >> of my apps that uses NSURLConnection, for example: >> >> NSURLConnection* con = [[NSURLConnection alloc] initWithRequest:req >> delegate:self]; >> >> That triggers a "potential leak" warning. Well, of course

Re: NSWindowController window returns nil

2010-07-07 Thread Matt Neuburg
On Wed, 7 Jul 2010 16:54:04 -0600, k...@highrolls.net said: >- (id) initWithWindowNibName:(NSString*)windowNibName andBFileName: >(BFilename*)bfilename >{ > self = [super initWithWindowNibName:windowNibName]; > if (self != nil) > { > m_panel = [self window]; > Design *cv = [m_panel contentView];

Re: NSWindowController window returns nil

2010-07-07 Thread Kyle Sluder
On Wed, Jul 7, 2010 at 5:47 PM, Matt Neuburg wrote: > You're speaking of the window too early. This is just the init; the nib > hasn't yet loaded and set up the connections. This is why you are given > windowDidLoad, so you know when the window *is* ready. -[NSWindowController window] loads the n

Re: Programmatically highlighting an NSMenuItem

2010-07-07 Thread Kyle Sluder
On Wed, Jul 7, 2010 at 5:29 PM, Graham Cox wrote: > NSMenuItemCell inherits -setHighlighted: from NSCell Does NSMenuItemCell match the appearance of menus on 10.5? --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Re: Programmatically highlighting an NSMenuItem

2010-07-07 Thread Graham Cox
On 08/07/2010, at 11:00 AM, Kyle Sluder wrote: > Does NSMenuItemCell match the appearance of menus on 10.5? No. I noticed this in the docs just after posting: "Note: NSMenuItemCell is no longer used to draw menus. Using it will not affect the appearance of your menus." Maybe the OP ought to

Re: NSWindowController window returns nil

2010-07-07 Thread koko
Thanks for th input Matt. I found that I had not connected the window outlet in Files Owner to the window in the nib. Upon doing so all works as I expected. As an FYI everything else works as I expect ... the delegate methods are called and the instance vars are good to go. One slight chan

Re: static analyzer

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 8:41 PM, Matt Neuburg wrote: > On Wed, 7 Jul 2010 17:54:58 -0400, Michael Ash said: >>> I get a false positive in *any* >>> of my apps that uses NSURLConnection, for example: >>> >>> NSURLConnection* con = [[NSURLConnection alloc] initWithRequest:req >>> delegate:self]; >>>

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 6:34 PM, Paul Sanders wrote: >> If you can require 10.6 (or iOS 4, maybe?) then you can use the new >> associated object API. Use objc_setAssociatedObject to attach your >> object to the NSEvent object, and the runtime will automatically take >> care of destroying it for you

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Ken Thomases
On Jul 8, 2010, at 12:03 AM, Michael Ash wrote: > On Wed, Jul 7, 2010 at 6:34 PM, Paul Sanders > wrote: >>> If you can require 10.6 (or iOS 4, maybe?) then you can use the new >>> associated object API. Use objc_setAssociatedObject to attach your >>> object to the NSEvent object, and the runtime

setting focus on NSSearchField in status bar menu item

2010-07-07 Thread Nava Carmon
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 application, make it front and click again on my status menu, the NSSearchField shows, but it's di

NSArchiverArchiveInconsistency

2010-07-07 Thread John MacMullin
I have been using NSStreams and the delegate with TCPServer quite successfully in the past to transmit data between a client and a server. In other words, the code was working on 10.5 before. Then I upgraded to 10.6 SDK with a deployment of 10.5. Everything runs fine between the 10.6 server a