CoreData regression or performance problem, anyone?

2014-11-12 Thread Vincent Habchi
Folks, the sqlite version installed on OS X machines has been bumped to 3.8.x in OS X 10.10. This apparently had the unfortunate side (or collateral) effect of plummeting performance of some requests (specifically, some Macports related database operations now take forever while they were fairl

Re: CoreData regression or performance problem, anyone?

2014-11-12 Thread Vincent Habchi
Jens, > If you're using CoreData I'm not sure if you'll be able to fix your database > schema, since presumably CoreData manages it and not you. So I'm not sure how > you'd work around the problem. Good luck! In fact, the Macports search engine is not, so I guess we’ll figure out a way to fix

CALayer's removeFromSuperlayer processing time

2010-03-31 Thread vincent habchi
Hi there, I'm back working on my small GIS after a while fighting with urgent things. My today concern is this: at some point, I must replace a CALayer by another. I therefore use [theCALayerIWantToRemove removeFromSuperlayer] However, I register quite a significant delay (sometimes 6 to 10 sec

Re: CALayer's removeFromSuperlayer processing time

2010-03-31 Thread vincent habchi
Hi Dave, >> However, I register quite a significant delay (sometimes 6 to 10 seconds) >> between this call and the actual call to [theCALayerIWantToRemove release]. >> Is this normal (due to some autorelease pool being drained?)? > > It is normal in terms of us making no guarantees as to the t

Re: CALayer's removeFromSuperlayer processing time

2010-03-31 Thread vincent habchi
Kyle, > For all you know or care the layer may never be released at all. All > you can do is balance your own retains and releases as appropriate. Okay, if I understand correctly, the only guarantee you have is that the layer is erased from screen, but nothing else. Thanks a lot! Vincent___

Re: CALayer's removeFromSuperlayer processing time

2010-04-01 Thread vincent habchi
Le 31 mars 2010 à 22:02, vincent habchi a écrit : > For some unknown reason (I am investigating on that), the new layer I create > to replace the old won't be displayed before the old get deallocated. So I > get a visible glitch while the old layer is removed from scre

NSLayerStack/NSArrayController/NSButton action puzzle

2010-04-01 Thread vincent habchi
Hi there, sorry for maybe asking a silly question, I could not get a clue elsewhere. I have a NSLayerStack whose subviews represent a certain kind of object stored in a list controlled by a NSArrayController. Each of these subviews features two buttons, one is of the "Momentarily push-in" type,

Re: NSCollectionView/NSArrayController/NSButton action puzzle

2010-04-01 Thread vincent habchi
Kyle, > Um, what is an NSLayerStack? An April fool? :) No, seriously, sorry, I was a bit tired: it's a NSCollectionView that I subclassed and I called it LayerStack. I updated the subject accordingly. > Wire up the action to some other method that looks at the view's > represented object and

"Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Hi there, I've been fiddling with NSAttributedString lately, and the way to display them through Core Text. In the docs, I've read that NSAttributedString and CFAttributedStringRef were supposed to be "toll free" bridged; I assumed that meant that one could be used in lieu of the other with (or

Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Glenn, > NSAttributedString and CFAttributedStringRef "the data structure" are toll > free bridged, but that just means that the objects themselves can be > interchanged. The problem is that, like an NSDictionary, they can store > arbitrary objects that may not be toll free bridged - in this c

CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Hi, I was running quite an intensive test on creating/freeing threads running RunLoops, and I got a rather unexpected crash while executing CFRunLoopStop (): Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0002, 0x Crashed Thread: 0 Dispatch queue: com.

Re: CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Well, I forgot to mention that each thread is responsible for the drawing of a CATileLayer, if that matters. Vincent ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Adam, > You need to have a current NSGraphicsContext for NSColor (and possibly other) > attributes. This is pretty easy, as in the following snippet from my own > code: > >[NSGraphicsContext saveGraphicsState]; >[NSGraphicsContext setCurrentContext:[NSGraphicsContext > graphicsContext

Re: CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Jesper, > FYI: Remember that corefoundation is open source. 10.6.2 can be found at: > http://www.opensource.apple.com/source/CF/CF-550.13/ Thanks for the link, very instructive. > void CFRunLoopWakeUp(CFRunLoopRef rl) { > CHECK_FOR_FORK(); > #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET

Re: CFRunLoopStop exception

2010-04-09 Thread vincent habchi
Le 9 avr. 2010 à 08:08, Greg Parker a écrit : > In this circumstance, mach_msg() will block if the queue is full, and either > succeed later or time out. Neither of those paths should end up at HALT. > (mach_msg() may do other things in other circumstances.) > > Presumably mach_msg() returned s

Re: CFRunLoopStop exception

2010-04-09 Thread vincent habchi
Steve, > Pulling these out, it may be time to look at WAYRTTD. > > Creating/destroying lots of threads to render tiles seems massively > inefficient for lots of reasons and Mac OS X has much better mechanisms for > this. > > Depending on what minimum OS requirements you might get much better r

NSArrayController in entity mode and permutations (CoreData question)

2010-04-12 Thread vincent habchi
Hi again! I'd like to change the place of a NSManagedObject stored in a NSArrayController in entity mode (after a drag'n drop operation). I didn't find any suitable primitive, so I decided to go something like "removeAtSomeIndex" and then immediately after "insertAtSomeOtherIndex". However, it

Re: NSArrayController in entity mode and permutations (CoreData question)

2010-04-12 Thread vincent habchi
Quincy, (sorry for the double answer) > This is likely NOT a Core Data question. Most likely you're not doing your > memory management quite correctly. Look here under the heading "Mutable > Arrays": > > > http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Collections/

Re: NSArrayController in entity mode and permutations (CoreData question)

2010-04-12 Thread vincent habchi
Quincey, thanks a lot > Surely it would be more robust to make the order explicit in your data model > (with a transient property if the order really is transient) and let the > array controller keep the displayed content sorted according to that order? Sure, I could do that. In fact I have do

Re: NSArrayController in entity mode and permutations (CoreData question)

2010-04-13 Thread vincent habchi
Le 12 avr. 2010 à 22:22, Kyle Sluder a écrit : > On Mon, Apr 12, 2010 at 12:12 PM, vincent habchi wrote: >> Besides, the proxy solution has one advantage: since the object in the >> NSArrayController reacts to actions performed on buttons linked to it, I >> think it is b

Re: NSArrayController in entity mode and permutations (CoreData question)

2010-04-13 Thread vincent habchi
Le 12 avr. 2010 à 23:17, Quincey Morris a écrit : > I think I'm confused now about what scenario we are talking about. Are you > saying that the object you insert with [NSArrayController insertObject...] is > *not* a NSManagedObject, but is a proxy object that is linked to the > NSManagedObject

Re: Text file

2010-04-15 Thread vincent habchi
Hi, > 0x91dc507e <+0334> call 0x91e68a50 > 0x91dc5083 <+0339> mov%esi,(%esp) > 0x91dc5086 <+0342> call 0x91ebf566 > 0x91dc508b <+0347> lea-0x80(%ebp),%esi > 0x91dc508e <+0350> mov%esi,(%esp) > 0x91dc5091 <+0353> call 0x91ebfb36 > 0x91dc5096 <+0358> mov%esi,(%

HUD window widgets

2010-04-16 Thread vincent habchi
Hi again, I'd like to add some widgets in a HUD window, like, for example, a small pop-up button, with a non-white menu background, small non-black text, etc. How can I achieve this? By subclassing NSPopUpButtonCell? Thanks, Vincent ___ Cocoa-dev m

Re: HUD window widgets

2010-04-17 Thread vincent habchi
> I know of three frameworks that provide controls for use in HUD windows (in > order of recommendation): > > BWToolkit - http://www.brandonwalkin.com/bwtoolkit/ > BGHUDAppKit - http://www.binarymethod.com/bghudappkit/ > HMBlkAppKit - http://shiira.jp/hmblkappkit/en.html Thanks a lot to both. BW

Creating temporary NSManagedObjects

2010-04-26 Thread vincent habchi
Hi to all, I need to create a short-lived NSManagedObject; ideally, I'd want it not to be inserted in the Core Data underlying framework, because I need it only during the display of an auxiliary window, and I don't want it saved anyway. I've tried a simple alloc, an alloc and init, but to no a

Re: Creating temporary NSManagedObjects

2010-04-26 Thread vincent habchi
Jack, > What you want to do, probably, is create an object that doesn't belong > to a context (the context is what ends up saving your object to a data > store). You should be able to do something like this: > > // assuming your app delegate contains the "managedObjectModel" method, which > // t

Re: Creating temporary NSManagedObjects (PS)

2010-04-26 Thread vincent habchi
Le 26 avr. 2010 à 11:04, Jack Nutting a écrit : > // assuming your app delegate contains the "managedObjectModel" method, which > // the standard Xcode-generated CoreData app typically does > NSManagedObjectModel *managedObjectModel = [[NSApplication delegate] > managedObjectModel]; > NSEntityDesc

Re: Creating temporary NSManagedObjects

2010-04-26 Thread vincent habchi
Hi Joanna, > Do you really need an NSManagedObject? > Do you ever need to store instances of this particular class? Yes. That NSObject holds some properties associated with a graphical layer. I have a lot of them, that I classically save in order to be able to restore the state of the applicati

Re: Creating temporary NSManagedObjects (PS)

2010-04-26 Thread vincent habchi
Le 26 avr. 2010 à 15:50, Jack Nutting a écrit : > Well I haven't actually tried it yet, so don't thank me yet! ;) The > docs for "initWithEntity:insertIntoManagedObjectContext :" do include > the text "If context is not nil, this method..." though, which seems > to imply that you should be able

Re: Creating temporary NSManagedObjects (PS)

2010-04-26 Thread vincent habchi
Le 26 avr. 2010 à 15:50, Jack Nutting a écrit : > Well I haven't actually tried it yet, so don't thank me yet! ;) The > docs for "initWithEntity:insertIntoManagedObjectContext :" do include > the text "If context is not nil, this method..." though, which seems > to imply that you should be able

NSManagedObject, retain count and dealloc:

2010-04-26 Thread vincent habchi
Hi again, I am unable to see a NSManagedObject go through the dealloc: method, even after its removal from the MOC. It seems these objects are created after a initWithEntity:insertIntoMOC: with an initial retain count of 2, and, of course, it is impossible to make the retain count (by honest me

Re: NSManagedObject, retain count and dealloc:

2010-04-26 Thread vincent habchi
Le 27 avr. 2010 à 00:18, Kyle Sluder a écrit : > If your object is holding on to some resource which you need it to > release, write a method called -invalidate or -letGoOfImportantThing > or something and call that at a deterministic time. Understood. I'll do that. I must admit I have a tendency

Re: white screen windows at first

2010-04-27 Thread vincent habchi
Le 26 avr. 2010 à 23:35, Bill Appleton a écrit : > hi all, > > when my windows are first shown there is no drawing inside, they are white > > but when i slowly move the mouse over to the close box and the close box > responds to the mouse hover suddenly they draw their content properly > > does

Re: Creating temporary NSManagedObjects

2010-04-27 Thread vincent habchi
Quincey, > Notwithstanding the discussion in this thread so far, I don't quite > understand why you wouldn't do this the easy way: create a NSManagedObject in > your managed context, and delete it when you're done with it. > > The documentation explicitly describes the managed context as a "scr

Re: menu madness with retain count

2010-04-27 Thread vincent habchi
Le 27 avr. 2010 à 20:42, Jens Alfke a écrit : > What you "own" are references. If you call a method that creates a reference, > like +alloc, -retain or -copy, then you now own a reference to that object. > For as long as you own that reference, the object will stay around. When you > don't need

Re: menu madness with retain count

2010-04-27 Thread vincent habchi
Le 27 avr. 2010 à 21:21, Scott Ribe a écrit : >> By the way, how are exactly multiple calls to [object autorelease] handled >> by the pool? Does this give rise to as many calls to release: as they are >> autorelease references stored, or does the pool directly adjust the retain >> count? > > W

Re: menu madness with retain count

2010-04-27 Thread vincent habchi
Le 27 avr. 2010 à 21:17, Jens Alfke a écrit : > Remember that in a ref-counted (or GC'd) system you can't force an object to > deallocate (even 'self'.) The deallocation is under control of all the other > objects that have references, and the runtime itself. So you should never put > any code

Re: menu madness with retain count

2010-04-27 Thread vincent habchi
Le 27 avr. 2010 à 21:57, Jens Alfke a écrit : >> I registered most curious behaviors, for example objects released while the >> last time their retain count was printed it was equal to 2. No 1, no 0. >> That's why I asked, just to know if autorelease does not short-circuit the >> traditional re

Re: Selecting an object based on the value of one of its attributes

2010-04-27 Thread vincent habchi
Le 28 avr. 2010 à 04:37, Lynn Barton a écrit : > Newbie question: Consider an array of dictionary objects, all of the same > class. One of the ivars of that class is an NSString which is unique for each > instance. Does there already exist a method that will identify the one > dictionary object

Re: white screen windows at first

2010-04-28 Thread vincent habchi
Bill, > my windows are NSBackingStoreBuffered > is that what you mean by background property? i am just using a subclassed > NSView & a CGContext for drawing Yes. Please verify that you set the opaque property of your backing layer to YES : [[self layer] setOpaque:YES], otherwise you might get

Re: white screen windows at first

2010-04-28 Thread vincent habchi
Le 28 avr. 2010 à 10:10, Paul Sanders a écrit : >> this problem must be because i am using core graphics There is no problem using Core Graphics, especially if your NSView is backed by a CALayer. I do that routinely on the small GIS I try to develop. Vincent_

Woes with an NSBox

2010-04-28 Thread vincent habchi
HI there, I have a standard NSBox inside a NSView. I set its border radius and width all right. But when I enable backing layer, the border disappear. Is this normal? Vincent___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: white screen windows at first

2010-04-29 Thread vincent habchi
Le 28 avr. 2010 à 20:29, Bill Appleton a écrit : > this appears to only work from inside the drawRect routine, if i get here > from some other event it doesn't work > > so is it "legal" to draw on an NSWindow from some other event? > if not, what the heck does QDEndCGContext do that makes it wo

Re: NSKeyedArchiver and NSPoints

2010-04-29 Thread vincent habchi
Le 29 avr. 2010 à 05:49, Michael Ash a écrit : > Actually, while there are finite decimal numbers with no finite binary > representation, the reverse is not true. Every binary number can be > represented by a finite number of decimal digits. I believe this is > because 2 is a factor of 10. To prov

NSTableView sort with a data source (silly question ?)

2010-05-03 Thread vincent habchi
Hi, this might be a silly question but, before doing any further implementation, and having found no definite answer, I dare ask it. Is there a way to sort the contents of a NSTableView whose data is provided by a data source, besides sorting at the source itself (via a suitable query)? Thanks

Re: NSTableView sort with a data source (silly question ?)

2010-05-03 Thread vincent habchi
Le 3 mai 2010 à 17:08, Graham Cox a écrit : >> this might be a silly question but, before doing any further implementation, >> and having found no definite answer, I dare ask it. Is there a way to sort >> the contents of a NSTableView whose data is provided by a data source, >> besides sorting

Strange NSView/NSWindow behavior

2010-05-04 Thread vincent habchi
Hi again, again, and… (let's be short :)) I have a NSView in a NSWindow. That NSView handles mouse events (mouseDown:, Dragged:, Up:). But, to my great astonishment, the event propagates through the underlying window, so that when I drag inside the view, the window also moves. How come? Any ide

Re: Strange NSView/NSWindow behavior

2010-05-04 Thread vincent habchi
Le 4 mai 2010 à 20:26, Greg Parker a écrit : > On May 4, 2010, at 11:18 AM, vincent habchi wrote: >> Hi again, again, and… (let's be short :)) >> >> I have a NSView in a NSWindow. That NSView handles mouse events (mouseDown:, >> Dragged:, Up:). But, to

Re: Strange NSView/NSWindow behavior

2010-05-04 Thread vincent habchi
> Keeping it short: look up -[NSView mouseDownCanMoveWindow]. Override it to > return NO if you never want a click in the view to drag the window. Thanks a lot, by the way! :) Vincent___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 13:40, jonat...@mugginsoft.com a écrit : > A subclass ivar is apparently overwriting a super class ivar. > When an instance of MGS_B sets stderrData the super class ivar tempFilePath > gets overwritten. If I am not mistaken, if your superclass ivar is private (!= protected), it

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 14:22, Graham Cox a écrit : > I'm pretty sure you are mistaken. If this were even remotely true, object > programming would be impossible. > > @private only declares the visibility of an ivar to its subclasses, it does > not give the compiler carte blanche to write over anythin

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 14:53, Graham Cox a écrit : > > On 26/05/2010, at 10:41 PM, vincent habchi wrote: > >> Hmmm... Let's say you have a class A with a private variable "priv" and b a >> pointer to a subclass of A. Is: >> >> [(A *)b priv] >

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 15:24, Jean-Daniel Dupas a écrit : > Who knows what a class does when you set an ivar using the accessor. It would > badly break encapsulation principle. > For example, what would append if a NSView subclass change the view frame by > accessing the _frame ivar directly ? You a

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Jens, > I think you’re confusing an inaccessible variable with an unused variable. > Those are very different concepts. For example, NSView’s _frame instance > variable is inaccessible from any subclass, but the variable is of course a > crucial part of the view’s state and is accessed by lots

Re: Erasing drawn content

2010-06-09 Thread vincent habchi
Oops, wrong email address, I try again: > Pity, I like the idea of more bee-based metaphors in APIs (or Apis). It could > be known as Bee-OS. That was a pun in latin? Vincent___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: Erasing drawn content

2010-06-09 Thread vincent habchi
Le 9 juin 2010 à 13:33, Alastair Houghton a écrit : > On 9 Jun 2010, at 10:02, vincent habchi wrote: >>> Pity, I like the idea of more bee-based metaphors in APIs (or Apis). It >>> could be known as Bee-OS. >> >> That was a pun in latin? > > <http://e

Re: Erasing drawn content

2010-06-09 Thread vincent habchi
Le 9 juin 2010 à 13:44, Graham Cox a écrit : > > On 09/06/2010, at 9:38 PM, vincent habchi wrote: > >> But the point was that "apis", in latin, means "bee". > > > I think we ought to buzz off and hive this off-list, or else we're likely to

KVO oddity (or am I *really* idiot ?)

2010-06-09 Thread vincent habchi
Hi there, no latin this time, I swear! :) Well, please tell me I am a fool: when I execute those two lines: NSLog(@"%@", [[NSApp delegate] appController]); NSLog(@"%@", [NSApp valueForKey:@"delegate.appController"]); I get this result: 2010-06-09 15:52:57.525 PostSIG[5503:a0b]

Re: KVO oddity (or am I *really* idiot ?)

2010-06-09 Thread vincent habchi
Le 9 juin 2010 à 16:10, Graham Cox a écrit : > > On 10/06/2010, at 12:05 AM, vincent habchi wrote: > >> 2010-06-09 15:52:57.526 PostSIG[5503:a0b] [ >> valueForUndefinedKey:]: this class is not key value coding-compliant for the >> key delegate.appController

Re: KVO oddity (or am I *really* idiot ?)

2010-06-09 Thread vincent habchi
Le 9 juin 2010 à 16:10, Kyle Sluder a écrit : > @"delegate.appController" is a keypath, not a key. Thanks Kyle. As I said (privately) to Graham, I am even better than a moron: an oxymoron. Cheers and forgive my stupidity. Enjoy WWDC! Vincent___ Cocoa

NSDictionaryController code example

2010-06-09 Thread vincent habchi
Hi again, like some other before (pfiuh, I'm not alone this time!), I have some difficulties to fully grasp the way NSDictionaryController works (especially how to subclass -newObject to fit my needs). Does anybody, by chance, have a sample code that would demonstrate some basic use? I couldn't

Re: NSOutlineView drag and drop problem

2010-06-11 Thread vincent habchi
Le 11 juin 2010 à 07:24, Graham Cox a écrit : > The two methods do much the same work so there's a good opportunity to factor > the code as Jens suggests, but locally saving the return value from > validation works OK and appears to be all I can do. Saving a return value in a ivar is usually no

Double binding not possible?

2010-06-11 Thread vincent habchi
Hi there, I hope this question will be less silly as the previous ones. Yet, it is very simple: I have a popUp button with which I'd like to update two objects at the same time (one with the selected index, and the other with the selected value). Can you confirm me it is impossible (once one bind

Re: Double binding not possible?

2010-06-11 Thread vincent habchi
Ken, > Yes, it is impossible. That's what I thought. > Those bindings are two-way. (Not all are, but those are.) Thus, when the > bound-to property changes, so does the view's selection. Now, how would this > work if the view's selection were bound to two different properties? What if > t

NSArrayController/Modal dialog/KVO Gordian knot

2010-06-12 Thread vincent habchi
Hi again, I am still stuck in my (very simple) dialog management. Briefly, I have a modal dialog that allows the user to create objects whose attributes are derived from various fields. I need to set the a default value to one attribute of a newly created object (after clicking on a button); ho

Re: NSArrayController/Modal dialog/KVO Gordian knot

2010-06-12 Thread vincent habchi
Le 12 juin 2010 à 16:10, Keary Suska a écrit : > Normally, default value logic should be within the model object, not the > controller. If the defaults are specific to the controller or situation (and > not to any other controller or situation), the controller should be told to > prepare its ow

Re: NSArrayController/Modal dialog/KVO Gordian knot

2010-06-13 Thread vincent habchi
Hallo Reinhard, Le 13 juin 2010 à 09:36, Reinhard Segeler a écrit : > I am not familiar with the NSDictionaryController but the keypath looks a bit > strange: > > if theDictionary is what the name says, then a member selection calls a > member value calls a member color. That's not the case, i

Re: Core Data issue .. where is my bug?

2010-06-13 Thread vincent habchi
Le 14 juin 2010 à 07:32, Robert Lorentz a écrit : > Now - this is where my issue starts - if I instead bind my NSTextField to > "array controller - selection.description", my program crashes with EXC BAD > ACCESS! I have edited the store file, and confirmed that yes I do have > attribute entri

Re: NSRunLoop

2010-06-14 Thread vincent habchi
Le 15 juin 2010 à 00:41, Jean-Daniel Dupas a écrit : > > Le 15 juin 2010 à 00:22, Ariel Feinerman a écrit : > >> Hi, >> I wish to make programme has cpu-related (one thread per core) number of >> worker threads. When user inputs the data, main thread splits up the data >> and send to the workers

Re: Notification when network volume disappears

2010-06-14 Thread vincent habchi
Le 14 juin 2010 à 20:37, Jens Alfke a écrit : > Last I heard (admittedly, a few years ago) there wasn’t any good way to do > async/nonblocking filesystem operations. The standard system calls block; the > O_NONBLOCK mode for fcntl only works on network socket streams; and the AIO > API has (had

NSTextField selection customization

2010-06-15 Thread vincent habchi
Hi there, I'd like to customize the way an NSTextField works, especially the selection mechanism (I'd would like the selection to break only at word boundaries, instead of at every character). Is this possible, or shall I turn to the bigger and bulkier NSTextView? Thanks, Vincent__

Re: NSTextField selection customization

2010-06-15 Thread vincent habchi
Le 15 juin 2010 à 21:58, Jens Alfke a écrit : > You’ll end up working with NSTextView regardless. NSTextField doesn’t do its > own text editing, it overlays a text view called the ‘field editor’ that’s > used by all controls in the window. So to make this work in a text field > you’d need to cr

Re: NSTextField selection customization

2010-06-15 Thread vincent habchi
Jens, Graham, > Note that NSTextView has: - > (void)setSelectionGranularity:(NSSelectionGranularity)granularity Yes, I saw that, it's a nice method. > which might be all you need - just set it to NSSelectByWord every time you > change the selection. This will keep getting reset so something wi

Re: Memory management on returning nil in init

2010-06-21 Thread vincent habchi
Le 21 juin 2010 à 16:43, Eiko Bleicher a écrit : > One of my initializers can fail and thus it should return nil. Consider the > following example: > > -(id) initWithBool:(BOOL)ok > { > if (self = [super init]) > { > if (!ok) { > return nil; // Point of interest > } > }

Re: Smooth OpenGL animation possible, even if main thread blocks?

2010-06-25 Thread vincent habchi
> So what are we supposed to do? Is there something I'm overlooking here or > should we maybe stop using CALayers and instead use NSOpenGLView or maybe > even manage our own OpenGL Context, render into a background buffer (e.g. > some kind of image) and then directly paint this image from within

Re: Toolbar Icon Workflow

2010-06-27 Thread vincent habchi
Le 27 juin 2010 à 12:42, Graham Cox a écrit : > It shouldn't, as it has no native resolution. What can happen though is that > NSImage caches it to a bitmap and reuses the bitmap, which can become fuzzy > when scaled up. You could investigate turning off caching on the image to > avoid that. >

Re: Smooth OpenGL animation possible, even if main thread blocks?

2010-06-28 Thread vincent habchi
Markus, > "Possible" or "Allowed"? ;-) Both, I think. If I am not mistaken, it was some Apple guy (David Duncan?) who pointed out the role of the runloop. I therefore take for granted that, if it is not "allowed", it must at least be "tolerated". > It is also possible to use Cocoa UI objects fr

Re: Smooth OpenGL animation possible, even if main thread blocks?

2010-06-28 Thread vincent habchi
Le 28 juin 2010 à 15:01, Markus Hanauska a écrit : > What does work, but I doubt it is allowed, is to directly call 'display' on > the CALayer. Apple says "you should not call this method directly", but so > far it seems to work and has not crashed... on the other hand it might crash > if the C

Re: How tell tell if an NSNumber was initialized from a float or int?

2010-06-28 Thread vincent habchi
Le 28 juin 2010 à 15:19, Kyle Sluder a écrit : > Tell you what, I'm gonna stop posting to the list within the 10 > minutes after I first wake up. Then maybe I wouldn't have overlooked Allow yourself at least the time to get a deep intravenous injection of dark coffee! :) Vincent _

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread vincent habchi
Afaik, no. Why would you do that? Sent from my iPhone4 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Uns

NSTextField fieldeditor subclass example? (and an unrelated other inquiry)

2010-07-06 Thread vincent habchi
Hi there, after a small interruption, I am about to resume Cocoa coding with what seems to me one of the hardest things I ever made so far with the Mac: coding a SQL custom editor with token handling (keyword and column name coloring, completion, automatic selection extension on keyword boundar

Re: NSTextField fieldeditor subclass example? (and an unrelated other inquiry)

2010-07-06 Thread vincent habchi
Le 6 juil. 2010 à 21:59, Matt Neuburg a écrit : > On Tue, 6 Jul 2010 20:31:06 +0200, vincent habchi said: >> BTW, another unrelated question. I have a method that takes an NSPoint as an > argument. I call it this way: >> >> [foo point:NSMakePoint(x, y)] >> >>

Re: How to debug crash on startup of 64-bit build

2010-07-06 Thread vincent habchi
Le 6 juil. 2010 à 22:49, Jeffrey J. Early a écrit : > Importantly, I'm not calling any code framework A that depends on framework > B. Because of this, in 32-bit mode, it ended up being totally okay that > framework B was missing (presumably because it never had to resolve any > symbols from th

How to properly print a SEL type variable?

2010-07-06 Thread vincent habchi
Hi there, this is a very simple question, but I don't seem to find the answer anywhere. What is the proper format to use in NSLog to print out a SEL type variable? E.g. SEL aSelector = @selector (foo); NSLog ("%", foo); If I use %s, it works, but I get a warning because the variable is not of th

Re: How to properly print a SEL type variable?

2010-07-06 Thread vincent habchi
Le 7 juil. 2010 à 07:10, Stephen J. Butler a écrit : > NSStringFromSelector() and then use %@ in the format string. Thanks! Well, I guessed there had to be such a function, but I don't know why they are not at least referenced in the NSString class doc page. I know there are not part of the NSS

Pass-by value… warning (was: NSTextField fieldeditor subclass example? (and an unrelated othe r inquiry))

2010-07-06 Thread vincent habchi
Hi! Le 6 juil. 2010 à 21:59, Matt Neuburg a écrit : > On Tue, 6 Jul 2010 20:31:06 +0200, vincent habchi said: >> BTW, another unrelated question. I have a method that takes an NSPoint as an > argument. I call it this way: >> >> [foo point:NSMakePoint(x, y)] >>

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

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 happe

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]; >> >>

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: > > [[

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: 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 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: Use of blocks

2010-07-12 Thread vincent habchi
Buongiorno :) Le 12 juil. 2010 à 09:34, Giannandrea Castaldi a écrit : > I want to use blocks to extract the min price and the max price from > an NSArray of trips. I've found the following way: > >float minValue = 0.0; >[someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, > B

Re: Animate NSWindow frame using Core Animation?

2010-07-16 Thread vincent habchi
Le 16 juil. 2010 à 12:38, Oleg Krupnov a écrit : > Any other ideas? Is your view CALayer backed? Vincent___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Initializing unichar variable with a human readable letter

2010-07-17 Thread vincent habchi
Hi there, I have a very simple problem: I'd like to affect to a unichar variable the value of the glyph é (or any non-ascii character). If I (naively) write: "unichar foo = 'é';", I get a warning from the compiler about multibyte const and it does not work. I'd like to avoid twisted constructs

Re: Initializing unichar variable with a human readable letter

2010-07-18 Thread vincent habchi
Hi Ken, > Doing this will probably work: > unichar foo = L'é'; Thanks, that's perfect. > With modern compilers, it should be possible to do (roughly) what you want if > the source file is UTF-8 encoded. However, note that "é" is often > represented as "e" followed by U+0301 COMBINING ACUTE AC

Small caps in NSTextView

2010-07-22 Thread Vincent Habchi
Hi! I'd like to highlight some text in a NSTextView by showing it in small caps. It seems this is not a standard text attribute, so this is not possible unless changing [NSTextView string] contents. Is this right? Thanks! Vincent___ Cocoa-dev mailing

Re: Small caps in NSTextView

2010-07-22 Thread vincent habchi
Ross, thanks a lot for your hints. > Small caps is not a trivial thing to implement, especially if you care about > how they look. Not too much. I just want to dynamically highlight keywords in a SQL sentence (e.g. out of "select * from" -> "SELECT * FROM"). My present solution is to get the

  1   2   3   4   >