Re: Switching methods in private classes in Apple frameworks

2010-03-12 Thread Paul Sanders
*Why* is there no supported way to replace (or, rather, augment) methods in a class which one cannot override because one does not create instances of that class oneself? It seems to me that this is just as legitimate as putting a category method on that class , but the latter approach is often

incorrect bitmap date from NSBitmapImageRep from NSDate

2010-03-12 Thread Ariel Feinerman
// not work NSData *data = [NSData dataWithContentsOfFile: filename]; NSBitmapImageRep *image = [[NSBitmapImageRep alloc] initWithData: data]; as opposed to: // works fine NSImage *source = [[NSImage alloc] initWithContentsOfFile: filename]; NSSize size = [source size]; [source lockFocus];

Re: Switching methods in private classes in Apple frameworks

2010-03-12 Thread Scott Morrison
You can access ivars just #include "objc/objc-class.h" and then use static Ivar theIvar; //create a static to cache the ivar information if (!theIvar) theIvar = class_getInstanceVariable([self class], "ivarName"); //look up the ivar information and cache it id aValue =

Re: Use of KVC Array operators

2010-03-12 Thread Alexander Spohr
Am 12.03.2010 um 04:34 schrieb Eli Bach: > The operators mentioned on this page, particularly "@unionOfSets". > > > > I have the following Core Data object's setup > > ClassA

Re: incorrect bitmap date from NSBitmapImageRep from NSDate

2010-03-12 Thread Alexander Spohr
Exactly what does not work? The loading? Or the opengl command? If the latter I suspect that your file is not in the needed format. Does your image have alpha? atze Am 12.03.2010 um 13:09 schrieb Ariel Feinerman: > // not work > > NSData *data = [NSData dataWithContentsOfFile: filena

Re: Bison/Yacc with Objective-C ?

2010-03-12 Thread steven Hooley
> Bloomin' magic! Thanks, Filip, it worketh well. Hardy souls all. > Tom W. Is it possible to see an example of how this might be used? I'd like to understand Bison/Yacc better and i think an example relevant to Cocoa / Objective-C would really help. Thanks, Steven ___

Re: Help visualizing something in IB

2010-03-12 Thread Brian Postow
On Mar 11, 2010, at 7:43 PM, Quincey Morris wrote: > On Mar 11, 2010, at 10:58, Brian Postow wrote: > >> I should be able to just use the clipRect of the superview, right? > > Well, you have to observe something that produces notifications -- which > means the bounds or frame of a view. You'r

Re: Bison/Yacc with Objective-C ?

2010-03-12 Thread Thomas Wetmore
On Mar 12, 2010, at 9:00 AM, steven Hooley wrote: >> Bloomin' magic! Thanks, Filip, it worketh well. Hardy souls all. >> Tom W. > > Is it possible to see an example of how this might be used? I'd like > to understand Bison/Yacc better and i think an example relevant to > Cocoa / Objective-C would

What would cause persistentStoreForURL: to return nil?

2010-03-12 Thread Gideon King
I know that the URL is valid and it's readable. I can open the file in my application. I can read it into an NSData with dataWithContentsOfURL: The purpose of what I am doing is trying to migrate to an XML store to see if that will help me isolate the problem I am having with "save as", which I

Re: What would cause persistentStoreForURL: to return nil?

2010-03-12 Thread Mike Abdullah
What if you print out [psc persistentStores] ? I think you'll find the PSC is surprisingly fussy about the URLs. e.g. capitalisation seems to matter. So do trailing slashes. Oh, and also the difference between: file:///foo.bar file://localhost/foo.bar On 12 Mar 2010, at 15:48, Gideon King wrot

Re: Use of KVC Array operators

2010-03-12 Thread Eli Bach
On Mar 12, 2010, at 5:37 AM, Alexander Spohr wrote: > Am 12.03.2010 um 04:34 schrieb Eli Bach: > >> The operators mentioned on this page, particularly "@unionOfSets". >> >> >> >>

performSelector doesn't work for modal window

2010-03-12 Thread Alexander Bokovikov
Hi, All, Unfortunately NSButton click is called when button is pressed, but not when it is released. Therefore any timeconsumming process, executed on the button click, will keep the button pressed. To avoid it I've decided to use performSelector:withObject:afterDelay: message. This appro

tracking Responder chain.

2010-03-12 Thread Brian Postow
I have a plugin (Mozilla in case it matters) which creates a window (for registration information) with an NSTextField. I want to be able to cut and paste. However, when I do it nothing happens (The edit menu flashes, but nothing gets pasted, etc. From doing a little reading my theory is that s

Re: performSelector doesn't work for modal window

2010-03-12 Thread Paul Sanders
Try using: performSelector:withObject:afterDelay:inModes: passing: [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSModalPanelRunLoopMode, nil] to inModes: Paul Sanders - Original Message - From: "Alexander Bokovikov" To: Sent: Friday, March 12, 2010 4:34 PM Subject: per

Re: What would cause persistentStoreForURL: to return nil?

2010-03-12 Thread Gideon King
Ah, I think I had a fundamental misunderstanding - I thought it would load the store, but it only returns it if it's already loaded in the coordinator. The documentation gives no clue of this - all it says is: Parameters URL An URL object that specifies the location of a persistent store. Retur

RE: IKFilterUIView - Problem with text fields

2010-03-12 Thread paul morel
Hi all,I reply to my own question!Actually I managed to find what I was looking for. Look my first point below to understand what I was talking about. My problem didn't really come from the IKFilterUIView but more from the way I was applying the CIKernel in the CIFilter ! here is what I wrote :

calling the run method in an AppleScript from a cocoa application

2010-03-12 Thread David Alter
I need the ability to call an AppleScript from a Cocoa Application. I have done this in the past using NSAppleScript and it works great. This time I need to call the "on run" and pass in parameters. That I have not done. I looked at the following Tech note Technical Note TN2084: Using AppleScript S

Re: Use of KVC Array operators

2010-03-12 Thread Alexander Spohr
Am 12.03.2010 um 17:32 schrieb Eli Bach: > On Mar 12, 2010, at 5:37 AM, Alexander Spohr wrote: > >> Am 12.03.2010 um 04:34 schrieb Eli Bach: >> >>> The operators mentioned on this page, particularly "@unionOfSets". >>> >>>

Re: What would cause persistentStoreForURL: to return nil?

2010-03-12 Thread Mike Abdullah
On 12 Mar 2010, at 16:48, Gideon King wrote: > Ah, I think I had a fundamental misunderstanding - I thought it would load > the store, but it only returns it if it's already loaded in the coordinator. > > The documentation gives no clue of this - all it says is: > Parameters > URL > An URL obj

Re: Better sorting using threads?

2010-03-12 Thread Gwynne Raskind
On Mar 12, 2010, at 2:25 AM, Ken Ferry wrote: >> Does Cocoa have sorted containers so that an object can be inserted in > sorted order? If so it seems like this would be far less expensive. > > Probably the best thing to do if you want this is to maintain the sort > yourself by inserting new obje

Re: calling the run method in an AppleScript from a cocoa application

2010-03-12 Thread Kevin Wojniak
Hey Dave, I think this may be what you want: http://homepage.mac.com/kenferry/software.html#KFAppleScript Kevin On Mar 12, 2010, at 8:56 AM, David Alter wrote: > I need the ability to call an AppleScript from a Cocoa Application. I have > done this in the past using NSAppleScript and it works

Re: calling the run method in an AppleScript from a cocoa application

2010-03-12 Thread jonat...@mugginsoft.com
On 12 Mar 2010, at 16:56, David Alter wrote: > I need the ability to call an AppleScript from a Cocoa Application. I have > done this in the past using NSAppleScript and it works great. This time I > need to call the "on run" and pass in parameters. That I have not done. I > looked at the followi

Key-Value Observing speed

2010-03-12 Thread Gwynne Raskind
While profiling a project I'm working on, I found that while most of my time was being spent in glFlush() (which is completely expected for an OpenGL-based game), a non-trivial amount of time is being spent in dozens of KVO internal methods and functions. Most especially, I noticed that KVO (or

Re: incorrect bitmap date from NSBitmapImageRep from NSDate

2010-03-12 Thread Ariel Feinerman
2010/3/12 Alexander Spohr Exactly what does not work? > The loading? Or the opengl command? > > texture is corrupted with artifact on the screen and sometimes gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, [image pixelsWide], [image pixelsHigh], GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, [image bitmapDa

Forcing text layout

2010-03-12 Thread Keith Blount
Hello, I have a page layout view, roughly based on the one in TextEdit although not quite the same. When text gets loaded into the page layout view, I need to force layout so that at least the first few pages get added (or removed if I'm replacing text that was already in there) properly. So fa

.ini file class?

2010-03-12 Thread Fritz Anderson
It should be easy to write an Objective-C class that reads and writes .ini files, but I'd prefer to use existing art if any exists. Googling "Cocoa ini file class" and "Objective-C ini file class" turned up nothing. Any leads? — F ___ Cocoa-

Re: Problem with "save as" and freed managed object context

2010-03-12 Thread Gideon King
Further information: I have just gone through every place in our code where it makes reference to the managed object context (there's only 90 of them thank goodness), and there is nothing there where we either retain or release a managed object context, or use one in a notification or anything l

Re: .ini file class?

2010-03-12 Thread Kevin Wojniak
You could write a Cocoa wrapper around an existing C/C++ library. For example http://ndevilla.free.fr/iniparser/ On Mar 12, 2010, at 10:34 AM, Fritz Anderson wrote: > It should be easy to write an Objective-C class that reads and writes .ini > files, but I'd prefer to use existing art if any e

Re: Use of KVC Array operators

2010-03-12 Thread Eli Bach
On Mar 12, 2010, at 9:58 AM, Alexander Spohr wrote: >> I'll try this, but I don't expect it to work, because there can be 0 or more >> relationB object's, and each of those object's can have 0 or more relationC >> objects, and just 'plain' dot syntax won't produce a superset of relationC >> ob

Re: Better sorting using threads?

2010-03-12 Thread Andrew James
All, My concern is that keeping traditional C-arrays in sorted order means 1) finding the location for insert ( O(n) ) 2) copying a range of contiguous memory to make the location available 3) copying in new value I've made the assumption that NSArray wraps an old school contiguous C-style arra

Re: Use of KVC Array operators

2010-03-12 Thread Eli Bach
On Mar 12, 2010, at 12:19 PM, Eli Bach wrote: > > On Mar 12, 2010, at 9:58 AM, Alexander Spohr wrote: > >> >> what is your understanding of KVC? > > That it wouldn't do this merging of set's automatically. > > And I did just try it, and got a binding error: > > Cocoa Bindings: Error setting

Re: Better sorting using threads?

2010-03-12 Thread Kyle Sluder
On Fri, Mar 12, 2010 at 11:55 AM, Andrew James wrote: > I've made the assumption that NSArray wraps an old school contiguous C-style > array ( ala C++ std:::vector ) This assumption is false. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.

Re: Better sorting using threads?

2010-03-12 Thread Chris Ridd
On 12 Mar 2010, at 20:20, Kyle Sluder wrote: > On Fri, Mar 12, 2010 at 11:55 AM, Andrew James > wrote: >> I've made the assumption that NSArray wraps an old school contiguous C-style >> array ( ala C++ std:::vector ) > > This assumption is false. There was a good analysis of NSArrays at

Setting cursor for subview of NSTextView

2010-03-12 Thread Stefan Haller
I have a custom NSTextAttachmentCell that does its work by adding subviews to the NSTextView (e.g. NSButtons). This works fine. What I can't get to work is cursor handling; I always get an arrow cursor when the mouse is over my views. I overwrite resetCursorRects, like this: - (void) resetCursorR

Clicking on an NSColorWell

2010-03-12 Thread Jonathon Kuo
How can I intercept or get notified when a user clicks on an NSColorWell? OSX 10.6.2 ___ 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

NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
Hi everyone, I'm trying to build a custom predicate editor row template that lets me do predicates like "in the last 30 days" or "since {aDate}". For the simple date comparison, I'm returning an NSDatePicker as the third view in my templateViews. My problem is that I only want to return the NS

Re: Key-Value Observing speed

2010-03-12 Thread Peter Ammon
On Mar 12, 2010, at 9:35 AM, Gwynne Raskind wrote: > While profiling a project I'm working on, I found that while most of my time > was being spent in glFlush() (which is completely expected for an > OpenGL-based game), a non-trivial amount of time is being spent in dozens of > KVO internal me

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Peter Ammon
On Mar 12, 2010, at 1:47 PM, Dave DeLong wrote: > Hi everyone, > > I'm trying to build a custom predicate editor row template that lets me do > predicates like "in the last 30 days" or "since {aDate}". For the simple > date comparison, I'm returning an NSDatePicker as the third view in my >

Re: Clicking on an NSColorWell

2010-03-12 Thread Kevin Wojniak
Subclass and override mouseDown: - however if you're trying to intercept right before the color panel is shown, or a drag starts, that may be trickier. What are you trying to do generally? On Mar 12, 2010, at 1:30 PM, Jonathon Kuo wrote: > How can I intercept or get notified when a user clicks

Re: Clicking on an NSColorWell

2010-03-12 Thread Jonathon Kuo
I need to generate an ad-hoc number of color swatches in a floating window so that when a user clicks on one of them, the 'active' color of a stylus will change to that color. Most likely NSColorWell is not the right tool for the job... On Mar 12, 2010, at 2:10 PM, Kevin Wojniak wrote: > Subcl

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
This seems so obvious in retrospect that I can't believe I didn't think of that. Thank you so much! Dave On Mar 12, 2010, at 2:57 PM, Peter Ammon wrote: > What you want to do here is to create two separate templates. One "looks > like" this: > > [Creation Date, Modification Date]

Re: Use of KVC Array operators

2010-03-12 Thread Alexander Spohr
Am 12.03.2010 um 21:06 schrieb Eli Bach: > On Mar 12, 2010, at 12:19 PM, Eli Bach wrote: > >> And I did just try it, and got a binding error: >> >> Cocoa Bindings: Error setting value for bound property instanceOfA of object >> : [<_NSFaultingMutableSet 0x1006eab90> >> addObserver:forKeyPath:

Re: Key-Value Observing speed

2010-03-12 Thread Gwynne Raskind
On Mar 12, 2010, at 4:52 PM, Peter Ammon wrote: >> While profiling a project I'm working on, I found that while most of my time >> was being spent in glFlush() (which is completely expected for an >> OpenGL-based game), a non-trivial amount of time is being spent in dozens of >> KVO internal met

Re: Key-Value Observing speed

2010-03-12 Thread Greg Parker
On Mar 12, 2010, at 2:41 PM, Gwynne Raskind wrote: > You're right; the specific call that's causing the worst speed issues is > returning a property typed with this structure: > > typedef struct { int32_t x, y; } IntegerPoint; > > It's not necessarily feasible to switch this to an NSPoint; it me

Re: Forcing text layout

2010-03-12 Thread Martin Wierschin
Hello Keith! - (void)forceInitialLayout { NSInteger charIndex = (5 > [[self textStorage] length] ? [[self textStorage] length] : 5); if (charIndex > 0) { charIndex -= 1; [layoutManagerlocationForGlyphAtIndex:charIndex]; You shouldn't play loose which character/glyph indexes. I'm sur

Re: 10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5 [KIND OF SOLVED]

2010-03-12 Thread Steve Mykytyn
Thanks to everyone for their suggestions, particularly Greg Parker for the unambiguous clarification. While the safest approach is to use NSClassFromString to ensure that you can run in 64 bit on 10.5, I opted not to do that because it's not enough to actually get all 64-bit apps to work on 10.

Re: Clicking on an NSColorWell

2010-03-12 Thread Corbin Dunn
Try the "AnimatedTableView" example. Feel free to post questions after you run it. It has a custom mini color picker thingy. corbin On Mar 12, 2010, at 2:17 PM, Jonathon Kuo wrote: > I need to generate an ad-hoc number of color swatches in a floating window so > that when a user clicks on one

Re: Key-Value Observing speed

2010-03-12 Thread Eli Bach
On Mar 12, 2010, at 3:41 PM, Gwynne Raskind wrote: > You're right; the specific call that's causing the worst speed issues is > returning a property typed with this structure: > > typedef struct { int32_t x, y; } IntegerPoint; > > It's not necessarily feasible to switch this to an NSPoint; it

Re: Use of KVC Array operators

2010-03-12 Thread Eli Bach
On Mar 12, 2010, at 3:40 PM, Alexander Spohr wrote: > Maybe you can not bind that way. I have more experience using KVC than KVO. > KVC should work that way. > > Sorry to have bothered you, > > atze > It's not a problem. In retrospect, doing this would mean that KVO would need to aut

Re: Setting cursor for subview of NSTextView

2010-03-12 Thread Martin Wierschin
I have a custom NSTextAttachmentCell that does its work by adding subviews to the NSTextView (e.g. NSButtons). This works fine. What I can't get to work is cursor handling; I always get an arrow cursor when the mouse is over my views. I overwrite resetCursorRects, like this: ... This doesn't hel

Re: Key-Value Observing speed

2010-03-12 Thread Mike Abdullah
On 12 Mar 2010, at 22:41, Gwynne Raskind wrote: > On Mar 12, 2010, at 4:52 PM, Peter Ammon wrote: >>> While profiling a project I'm working on, I found that while most of my >>> time was being spent in glFlush() (which is completely expected for an >>> OpenGL-based game), a non-trivial amount o

Re: Better sorting using threads?

2010-03-12 Thread Paul Sanders
Just a heads-up to say that when I created an NSMutableDictionary on the main thread and then tried to mutate it in a subthread, Snow Leopard threw an exception ("trying to mutate a non-mutable object", or somesuch). I was, of course, protecting the mutable dictionary against reentrancy problem

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-12 Thread Corbin Dunn
On Mar 11, 2010, at 7:55 PM, Alexander Bokovikov wrote: > > On 11.03.2010, at 23:25, Corbin Dunn wrote: > >> http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/ > > I've done what was told there. No difference. I just get EXC_BAD_ACCESS in > XCode status line

Re: [NSTableview] can't make selected text stay black

2010-03-12 Thread Corbin Dunn
Please don't override the private method. Your app is likely to break if you do so. > > Your solution was perfect. (It didn't work at first, but that's because I had > somehow left HighlightStyle as source list in IB while I was trying > everything. Per your note, the first thing I checked & th

Re: [NSTableview] can't make selected text stay black

2010-03-12 Thread Corbin Dunn
> > P.S. I'm hesitant about mentioning private methods here, but I don't think > there's another way of doing it - I filed an enhancement request for this > method to be made public back in April '06, ID#4521167, so please do the same > if you think it would be useful. I'm CC'ing Corbin so he c

Re: Key-Value Observing speed

2010-03-12 Thread Gwynne Raskind
On Mar 12, 2010, at 5:49 PM, Greg Parker wrote: >> You're right; the specific call that's causing the worst speed issues is >> returning a property typed with this structure: >> >> typedef struct { int32_t x, y; } IntegerPoint; >> >> It's not necessarily feasible to switch this to an NSPoint; it

Re: Problem with "save as" and freed managed object context

2010-03-12 Thread Ben Trumbull
> Further information: I have just gone through every place in our code where > it makes reference to the managed object context (there's only 90 of them > thank goodness), and there is nothing there where we either retain or release > a managed object context, or use one in a notification or an

Re: [NSTableview] can't make selected text stay black

2010-03-12 Thread Keith Blount
Hi Corbin, Many thanks for the clarification, and for providing the official and better way of doing this. Although I will now go through my code an try to do this at the cell level, as obviously I'd much rather my app be future-proofed and avoid using private methods, it's not the ideal "perfe

re: Core Data & Spotlight: Record-Level Indexing : Issues?

2010-03-12 Thread Ben Trumbull
> "On Mac OS X v10.6 and later, for non-document-based programs, you can create > Spotlight indexes where each record is indexed individually." [1] I > interpret this to mean that users can get results for my app's records in > their Spotlight searches, the way they get Safari bookmarks and Add

Re: Forcing text layout

2010-03-12 Thread Keith Blount
Hi Martin, Many thanks for your reply (as always :) ). And d'oh, yes, the glyph/character thing was an oversight - I'm usually very careful about this as I am aware they can be very different, so thanks for picking me up on that. Also thanks for the pointer to -ensureLayoutForCharacterRange: -

Re: incorrect bitmap date from NSBitmapImageRep from NSDate

2010-03-12 Thread Ken Ferry
Hi, Please go down to the phrase "apps are rather fond of hardcoding bitmap formats" in the AppKit release notes. http://developer.apple.com/mac/library/releasenotes/cocoa/appkit.html > If the latter I suspect that your file is not in the needed format. Does your image have alpha? format is bm

Re: Better sorting using threads?

2010-03-12 Thread Greg Parker
On Mar 12, 2010, at 3:23 PM, Paul Sanders wrote: > Just a heads-up to say that when I created an NSMutableDictionary on the main > thread and then tried to mutate it in a subthread, Snow Leopard threw an > exception ("trying to mutate a non-mutable object", or somesuch). I was, of > course, pro

Re: 10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5 [KIND OF SOLVED]

2010-03-12 Thread Nick Zitzmann
On Mar 12, 2010, at 3:52 PM, Steve Mykytyn wrote: > While the safest approach is to use NSClassFromString to ensure that you can > run in 64 bit on 10.5 There are a lot of hidden pitfalls with targeting 64-bit architectures on Leopard, because there's a lot of UI-related things that should wor

Re: Better sorting using threads?

2010-03-12 Thread Ken Ferry
No, that would mean that you tried to mutate a non-mutable dictionary. :-) You were getting lucky before in that some dictionary was passed to you that was typed as NSDictionary, but _happened_ to be of the subclass NSMutableDictionary. _That's_ what changed on you. Be aware that if you send -co

Re: Problem with "save as" and freed managed object context

2010-03-12 Thread Gideon King
Thanks for that suggestion Ben - I haven't come across that method of debugging before. I tried doing it based on the address that I got from the stack trace, but I just seem to get the things relevant to the NSNumber: $ /Developer/usr/bin/malloc_history 12908 0x100e00860 ALLOC 0x100e00860-0x10

Re: Key-Value Observing speed

2010-03-12 Thread Quincey Morris
On Mar 12, 2010, at 14:41, Gwynne Raskind wrote: > You're right; the specific call that's causing the worst speed issues is > returning a property typed with this structure: > > typedef struct { int32_t x, y; } IntegerPoint; > > It's not necessarily feasible to switch this to an NSPoint; it mea

Re: Key-Value Observing speed

2010-03-12 Thread Mike Abdullah
On 12 Mar 2010, at 23:32, Gwynne Raskind wrote: > On Mar 12, 2010, at 5:49 PM, Greg Parker wrote: >>> You're right; the specific call that's causing the worst speed issues is >>> returning a property typed with this structure: >>> >>> typedef struct { int32_t x, y; } IntegerPoint; >>> >>> It's

Re: [NSTableview] can't make selected text stay black

2010-03-12 Thread Keith Blount
Actually, after testing this, does overriding NSCell's -highlightColorWithFrame:controlView: really have the same effect as overriding the _highlightColorForCell: private message? I assume the latter just calls the former, but I must be doing something wrong because overriding -highlightColorWi

Re: Core Data: inverse relationship not updated until next Run Loop

2010-03-12 Thread Eric Lin
I see. Thanks for both of your responses. Eric On Thu, Mar 11, 2010 at 10:26 PM, Frank Illenberger wrote: > >> In using Core Data, I was under the impression that if I do this: > >> > >> [department addEmployeesObject:employee] // department now has 1 > employee > >> [moc deleteObject:employee]

Re: performSelector doesn't work for modal window

2010-03-12 Thread Ken Thomases
On Mar 12, 2010, at 10:34 AM, Alexander Bokovikov wrote: > Unfortunately NSButton click is called when button is pressed, but not when > it is released. This is incorrect. You can click in a button, hold, drag out of the button, and release, and the button won't perform its action. The action

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
OK, continuing this thread on a related note: My date row templates allow me to do: "aDate is after aSpecificDate" and "aDate is in the last 30 days" Both of these are technically: "aDate > anotherDate" When I -init these custom row templates, I need to pass in an array of operators. I can't

Dragging rows in NSPredicateEditor

2010-03-12 Thread Graham Cox
I'm using the NSPredicateEditor control for the first time, and so far it's going well. I notice though that at runtime I'm able to drag an image of each row. What can I do with this drag? I either need to be able to process it in some meaningful way (there may be none for my app) or turn it of

Re: Dragging rows in NSPredicateEditor

2010-03-12 Thread Graham Cox
On 13/03/2010, at 2:03 PM, Graham Cox wrote: > I notice though that at runtime I'm able to drag an image of each row. What > can I do with this drag? I just realised that the drag allows me to reorder the rows - is that its only purpose? I didn't realise that before because it is still draggab

Re: Key-Value Observing speed

2010-03-12 Thread Michael Ash
On Fri, Mar 12, 2010 at 5:41 PM, Gwynne Raskind wrote: > On Mar 12, 2010, at 4:52 PM, Peter Ammon wrote: >>> While profiling a project I'm working on, I found that while most of my >>> time was being spent in glFlush() (which is completely expected for an >>> OpenGL-based game), a non-trivial am

Re: Key-Value Observing speed

2010-03-12 Thread Gwynne Raskind
On Mar 12, 2010, at 10:22 PM, Michael Ash wrote: >> You're right; the specific call that's causing the worst speed issues is >> returning a property typed with this structure: >> >> typedef struct { int32_t x, y; } IntegerPoint; >> >> It's not necessarily feasible to switch this to an NSPoint; i

Re: Dragging rows in NSPredicateEditor

2010-03-12 Thread Peter Ammon
On Mar 12, 2010, at 7:17 PM, Graham Cox wrote: > > On 13/03/2010, at 2:03 PM, Graham Cox wrote: > >> I notice though that at runtime I'm able to drag an image of each row. What >> can I do with this drag? > > I just realised that the drag allows me to reorder the rows - is that its > only pu

NSResponder / acceptsFirstResponder

2010-03-12 Thread David Blanton
How does one get a views acceptFirstResponder method called without having to click on the view? If a class subclasses NSResponder so it can get events how does one get an instance of this class in the responder chain? -db ___ Cocoa-dev mailing l

Re: Key-Value Observing speed

2010-03-12 Thread Don Quixote de la Mancha
On Fri, Mar 12, 2010 at 2:41 PM, Gwynne Raskind wrote: > (It's even more annoying because it *was* an NSPoint in a much earlier > iteration of the code and I changed it because it simplified the code in two > dozen places, and because the property in question is integer and doesn't > need the s

Which iPhone Program?

2010-03-12 Thread Don Quixote de la Mancha
Greetings, Earthlings, I just subscribed. I'm just about to sign up for the paid iPhone developer program, but I'm not able to tell from Apple's website which program I should join. Presently I am the only developer, but we have two QA testers who will need to build my code on their own Macs, as

Re: NSResponder / acceptsFirstResponder

2010-03-12 Thread Kyle Sluder
On Fri, Mar 12, 2010 at 10:17 AM, David Blanton wrote: > How does one get a views acceptFirstResponder method called without having > to click on the view? -acceptsFirstResponder should just return YES or NO based on the current state. Are you referring to -becomeFirstResponder? -[NSWindow makeFi

Re: Problem with "save as" and freed managed object context

2010-03-12 Thread Gideon King
Finally some progress. I found that the error message I was getting appeared to be a total red herring, and eventually tracked it down to an issue that appeared to be happening during the store migration, where it would have a validation error against a mandatory attribute which I normally set l

Re: NSTextView backed by core data, undo problems

2010-03-12 Thread Kyle Sluder
On Thu, Mar 11, 2010 at 11:38 PM, Martin Hewitson wrote: > Thanks, Kyle. I figured the answer would be something like this. OK, then > I'll need to rethink the architecture a bit. I was aiming for an Xcode-like > interface with potentially multiple views to the same file content, but > without

Re: Switching methods in private classes in Apple frameworks

2010-03-12 Thread Jean-Daniel Dupas
Method exchange is dangerous because if the target class (NSConcreteNotification) does not override the target function (dealloc), you may exchange it's superclass dealloc method instead and may end up overriding a method in a base class. Use it with great care and avoid it in production code i

Problem with "save as" and freed managed object context

2010-03-12 Thread Gideon King
Having sorted out the problem that occurred when I closed files, I am now back to the "save as" issue (I was hoping that the two problems were related, but apparently not). I have reverted to using a stock standard NSManagedObjectContext I still haven't a clue where to look to debug this. Runni

Re: NSTextView backed by core data, undo problems

2010-03-12 Thread Martin Hewitson
Thanks a lot, I'll proceed as suggested. Martin On Mar 12, 2010, at 9:07 AM, Kyle Sluder wrote: > On Thu, Mar 11, 2010 at 11:38 PM, Martin Hewitson > wrote: >> Thanks, Kyle. I figured the answer would be something like this. OK, then >> I'll need to rethink the architecture a bit. I was aiming

Re: Switching methods in private classes in Apple frameworks

2010-03-12 Thread Daniel DeCovnick
Wow, that's really, really awesome. Do you have any more details on why you can't use ivars? Not calling super makes sense. Can you access properties? On Mar 11, 2010, at 8:58 PM, Gideon King wrote: Thanks Jerry, I should mention that I did get this caveat note from Greg Parker (Apple's "ru