Unable to open Core Data documents

2009-11-02 Thread Niko Matsakis
Hello, I recently recompiled an existing project for 10.6. I made no changes to the code. However, the resulting binary is no longer able to open older files created by this program. The error message is: The document “Budget.drachma” could not be opened. drachma cannot open files of t

NSInvocation and methods with non-pointer parameters

2009-11-02 Thread Jim Kang
I seem to be able to use NSInvocation to execute methods that have parameters are pointers, like NSString* or NSDictionary*, but when I try to invoke a method with a parameter that is not a point, like this - (void)methodWithCGPoint: (CGPoint)pos; - I get an EXC_BAD_ACCESS when I run it with cod

Handling projects with several XIBs

2009-11-02 Thread Tobias Jordan
Hey guys, I was just wondering if there's a special technique for managing a project with several localizations. The problem I am currently having is that when updating the interface I have to a) make my changes to every localization (en, ge, fr, jp, etc.) or b) re-create all of the loca

Re: NSInvocation and methods with non-pointer parameters

2009-11-02 Thread Dave Keck
>            sig = [[self class] instanceMethodSignatureForSelector:sel]; See -methodSignatureForSelector. > What is the correct way to set the CGPoint argument to NSInvocation? The > CGPoint can't get released before the invocation is finished, so [invocation > retain] doesn't help. The code yo

Re: Editing in a tableview without selecting

2009-11-02 Thread Ben Haller
On 1-Nov-09, at 11:37 PM, Graham Cox wrote: On 02/11/2009, at 1:04 PM, Ben Haller wrote: I think I will have to construct a test case to see if I can reproduce this in a simple, isolated way. If that test case reproduces the problem, then I will post it somewhere and follow up on the lis

Re: Editing in a tableview without selecting

2009-11-02 Thread Ben Haller
On 1-Nov-09, at 11:44 PM, Kyle Sluder wrote: On Sun, Nov 1, 2009 at 9:42 AM, Ben Haller > wrote: - (void)tableView:(NSTableView *)aTableView setObjectValue: (id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex You might want to double-check that you didn't typo th

Re: Handling projects with several XIBs

2009-11-02 Thread Alexander Spohr
Am 02.11.2009 um 11:55 schrieb Tobias Jordan: The problem I am currently having is that when updating the interface I have to a) make my changes to every localization (en, ge, fr, jp, etc.) or b) re-create all of the localizations which isn't that easy to handle since I am not the one tra

Re: Editing in a tableview without selecting

2009-11-02 Thread Ben Haller
On 2-Nov-09, at 1:43 AM, Kyle Sluder wrote: On Sun, Nov 1, 2009 at 9:42 AM, Ben Haller wrote:\ The only unusual thing about this tableview is that I set it up in code instead of in IB, so I assume the root of the problem is in my programmatic setup code. But where? I've been hunting for

Binding problem : getter not called when property change

2009-11-02 Thread Eric Morand
Hi guys, I have a NSImageView instance that I want to display a default image when the user delete its content - namely, I want it to display a question mark instead of displaying an empty space. The image view "Value" property is bound to the "icon" property of my controller, which is of c

Re: Binding problem : getter not called when property change

2009-11-02 Thread Uli Kusterer
On 02.11.2009, at 13:49, Eric Morand wrote: The setIcon: method is successfully called when I delete the content of the image view, sending nil as the newImage parameter. Great. But the image view doesn't update its content. In other words, the icon getter method is not called event though

Re: Handling projects with several XIBs

2009-11-02 Thread Tobias Jordan
Thanks Alex and Peter. Your link to Wil's blog post is exactly what I was looking for. Best regards, Tobias Jordan. On Nov 2, 2009, at 2:08 PM, Peter Ilberg wrote: The other day, Wil Shipley shared his solution to the localization problem: http://wilshipley.com/blog/2009/10/pimp-my-code-p

Re: Binding problem : getter not called when property change

2009-11-02 Thread Eric Morand
Thanks a lot for the clarification, you made my day. I'll try to subclass NSImageView to achieve what I need. Kind regards, Eric. Le 2 nov. 2009 à 14:42, Uli Kusterer a écrit : On 02.11.2009, at 13:49, Eric Morand wrote: The setIcon: method is successfully called when I delete the conte

Re: Editing in a tableview without selecting

2009-11-02 Thread Graham Cox
On 02/11/2009, at 10:46 PM, Ben Haller wrote: There are a variable number of them per window, of a variable size and layout, depending upon data. (There are a variable number of objects being observed by the user, each of which gets a tableview, and each object has a variable set of prope

Re: NSInvocation and methods with non-pointer parameters

2009-11-02 Thread Jim Kang
Argh. I actually had invalid arguments, and there was indeed nothing wrong with the invocation code itself. Thanks for attempting to help! I'll make sure I'm less tired next time I post. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do n

Re: Editing in a tableview without selecting

2009-11-02 Thread Ben Haller
On 1-Nov-09, at 9:04 PM, Ben Haller wrote: On 1-Nov-09, at 6:01 PM, Graham Cox wrote: On 02/11/2009, at 4:42 AM, Ben Haller wrote: But where? I've been hunting for a -setEditable:YES method somewhere that I need to call, but I haven't found it... Have you tried -setEditable:YES on the te

Re: Editing in a tableview without selecting

2009-11-02 Thread Ben Haller
On 2-Nov-09, at 9:26 AM, Graham Cox wrote: On 02/11/2009, at 10:46 PM, Ben Haller wrote: There are a variable number of them per window, of a variable size and layout, depending upon data. (There are a variable number of objects being observed by the user, each of which gets a tableview,

Re: Asynchronous downloading again

2009-11-02 Thread Alex Kac
Would this be helpful? http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/ It shows how to use NSOperationQueue, but it uses downloading HTML pages as an example. On Oct 31, 2009, at 11:19 PM, DKJ wrote: On 2009-10-31, at 19:34 , Roland King wrote: . And why ar

Re: "Could not merge data"-error on save in a single moc app

2009-11-02 Thread Ruotger Skupin
On 29.10.2009, at 20:05, Ben Trumbull wrote: I get a "Could not merge changes"-error on save in a single moc app (*). The docs state this is a problem of a multi-moc setup: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdTroubleshooting.html Yes, the

Re: Asynchronous downloading again

2009-11-02 Thread Alastair Houghton
On 2 Nov 2009, at 15:05, Alex Kac wrote: Would this be helpful? http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/ It shows how to use NSOperationQueue, but it uses downloading HTML pages as an example. It isn't really a good example of downloading HTML pages

Re: NSInvocation and methods with non-pointer parameters

2009-11-02 Thread Bill Bumgarner
On Nov 2, 2009, at 2:17 AM, Jim Kang wrote: > I seem to be able to use NSInvocation to execute methods that have > parameters are pointers, like NSString* or NSDictionary*, but when I try to > invoke a method with a parameter that is not a point, like this - > > (void)methodWithCGPoint: (CGPoint)

Re: Create an NSCharacterSet constant

2009-11-02 Thread Michael Ash
On Mon, Nov 2, 2009 at 12:29 AM, Kyle Sluder wrote: > On Sun, Nov 1, 2009 at 9:19 PM, John Joyce > wrote: >> Is it possible to create an NSCharacterSet constant? > > No.  By definition, constants are assigned values at compile time. > Objects other than strings can only be created at runtime.  Th

Re: Create an NSCharacterSet constant

2009-11-02 Thread Kyle Sluder
On Mon, Nov 2, 2009 at 8:20 AM, Michael Ash wrote: > Watch out! The 'once' variable must be declared static as well. > Without it, if you're unlucky to get a zero-filled 'once' every time > through, this call will appear to work but leak a new Foo every time > you call it. Oops. Caveat composewi

why use pow(x, 2)?

2009-11-02 Thread Chunk 1978
i just came across some code, and i'm trying to understand why the developer chose to use the pow() function instead of simply multiplying as the 2nd arguments are always 2. i'm certainly no mathematician, but if the 2nd argument is going to be 2, why use pow()? is it just a matter of taste? why

Re: why use pow(x, 2)?

2009-11-02 Thread Kyle Sluder
On Mon, Nov 2, 2009 at 11:01 AM, Chunk 1978 wrote: > float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2); > > float dist = ((red - r) *  2) + ((green - g) * 2) + ((blue - b) * 2); You are aware that x^2 != 2x, right? --Kyle Sluder ___

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
On Nov 2, 2009, at 11:01 AM, Chunk 1978 wrote: i just came across some code, and i'm trying to understand why the developer chose to use the pow() function instead of simply multiplying as the 2nd arguments are always 2. i'm certainly no mathematician, but if the 2nd argument is going to

Re: why use pow(x, 2)?

2009-11-02 Thread Jean-Daniel Dupas
Le 2 nov. 2009 à 20:01, Chunk 1978 a écrit : i just came across some code, and i'm trying to understand why the developer chose to use the pow() function instead of simply multiplying as the 2nd arguments are always 2. i'm certainly no mathematician, but if the 2nd argument is going to be

Re: why use pow(x, 2)?

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 11:01 AM, Chunk 1978 wrote: why use this: float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2); instead of: float dist = ((red - r) * 2) + ((green - g) * 2) + ((blue - b) * 2); Um, "*" is multiplication, not exponentiation. Maybe you're thinking of the

Re: why use pow(x, 2)?

2009-11-02 Thread Chunk 1978
ouf! dumbest question ever. please ignore. On Mon, Nov 2, 2009 at 2:07 PM, Jens Alfke wrote: > > On Nov 2, 2009, at 11:01 AM, Chunk 1978 wrote: > > why use this: >> >> float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2); >> >> instead of: >> >> float dist = ((red - r) * 2) +

Re: why use pow(x, 2)?

2009-11-02 Thread Ed Wynne
On Mon, Nov 2, 2009 at 2:07 PM, Jens Alfke wrote: On Nov 2, 2009, at 11:01 AM, Chunk 1978 wrote: why use this: float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2); instead of: float dist = ((red - r) * 2) + ((green - g) * 2) + ((blue - b) * 2); Um, "*" is multiplication, no

Re: why use pow(x, 2)?

2009-11-02 Thread Sherm Pendley
On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne wrote: > > That said, the original question is a good one. Using x*x instead of > pow(x,2) would be quite a bit faster Are you certain of that? With loop unrolling and inlined functions, it should result in identical code being produced by the compiler. >

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
On Nov 2, 2009, at 11:25 AM, Ed Wynne wrote: On Mon, Nov 2, 2009 at 2:07 PM, Jens Alfke wrote: On Nov 2, 2009, at 11:01 AM, Chunk 1978 wrote: why use this: float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2); instead of: float dist = ((red - r) * 2) + ((green - g) * 2) +

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
On Nov 2, 2009, at 11:36 AM, Sherm Pendley wrote: On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster Are you certain of that? With loop unrolling and inlined functions, it should result i

Ruby Grammar for TDParseKit

2009-11-02 Thread Alexander Cohen
Hello, Has anyone created a grammar file for Ruby for use with TDParseKit. Seems like thats pretty much the best option out there ( it rocks ), but i'd rather check for a grammar file before i start a new one. thx AC ___ Cocoa-dev mailing list (

Re: why use pow(x, 2)?

2009-11-02 Thread Stephen J. Butler
On Mon, Nov 2, 2009 at 1:37 PM, Luke the Hiesterman wrote: > Would it really be that much faster? I don't know exactly how pow() is > implemented, but I assume it's basically just a loop of multiplications, in > which case it would basically be the same as x*x in this case, since it > would exit a

Re: why use pow(x, 2)?

2009-11-02 Thread James Walker
Luke the Hiesterman wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster, so except for clarity reasons, there isn't a good reason to use pow() in that case. Would it really be that much faster? I don't know exactly how pow() is im

Re: why use pow(x, 2)?

2009-11-02 Thread Gary L. Wade
On 11/02/2009 12:37 PM, "Luke the Hiesterman" wrote: > Would it really be that much faster? I don't know exactly how pow() is > implemented, but I assume it's basically just a loop of > multiplications, in which case it would basically be the same as x*x > in this case, since it would exit after

Re: Ruby Grammar for TDParseKit

2009-11-02 Thread Dave DeLong
TDParseKit can accept a BNF for a grammar, and a quick google search reveals that there are many ruby BNFs out there. Here's one: http://www.cse.buffalo.edu/~regan/cse305/RubyBNF.pdf Cheers, Dave On Nov 2, 2009, at 12:56 PM, Alexander Cohen wrote: Has anyone created a grammar file for Ruby

Re: why use pow(x, 2)?

2009-11-02 Thread Stephen J. Butler
On Mon, Nov 2, 2009 at 2:03 PM, Stephen J. Butler wrote: > On Mon, Nov 2, 2009 at 1:37 PM, Luke the Hiesterman > wrote: >> Would it really be that much faster? I don't know exactly how pow() is >> implemented, but I assume it's basically just a loop of multiplications, in >> which case it would

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
On Nov 2, 2009, at 12:15 PM, Stephen J. Butler wrote: On Mon, Nov 2, 2009 at 2:03 PM, Stephen J. Butler wrote: On Mon, Nov 2, 2009 at 1:37 PM, Luke the Hiesterman > wrote: Would it really be that much faster? I don't know exactly how pow () is implemented, but I assume it's basically just a l

Re: why use pow(x, 2)?

2009-11-02 Thread Ed Wynne
On Nov 2, 2009, at 11:36 AM, Sherm Pendley wrote: On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster Are you certain of that? With loop unrolling and inlined functions, it should result in

Re: why use pow(x, 2)?

2009-11-02 Thread Greg Parker
On Nov 2, 2009, at 12:03 PM, Stephen J. Butler wrote: I scanned through, and while there are some simple cases these implementations check for, it doesn't appear x^2 is one of them. So pow(x,2) is likely to be much slower than x*x. The Libc implementations don't check, but the compiler does. It

Re: Core Data not fulfill a fault (now: observer) after Save As

2009-11-02 Thread Ben Trumbull
> On 2009 Oct 14, at 12:47, Jim Thomason wrote: > >> On Wed, Oct 14, 2009 at 2:25 PM, Ben Trumbull >> wrote: The short description is this - I have a document based CoreData app. I can carefully craft a set of data. I then open the document, select a particular reco

NSObjectController add: Method RunLoop Deferral

2009-11-02 Thread Richard Somers
Consider a NSObjectController, controller, which is in entity mode and bound to a managed object context. The following code is in an initialization method. [controller add:self]; id value = [controller valueForKeyPath:@"selection.numObj"]; double num = [value doubleValue]; Th

re: Core Data design question: receiving KVO notifications of partially mutated objects

2009-11-02 Thread Ben Trumbull
> What is considered best practice when it comes to mutating many > properties of a managed object, specifically with regard to KVO > observers getting notified before all mutations are finished? This is a problem intrinsic to the design of KVO. KVO is all about fine grained per property notific

re: Unable to open Core Data documents

2009-11-02 Thread Ben Trumbull
> I recently recompiled an existing project for 10.6. I made no changes > to the code. However, the resulting binary is no longer able to open > older files created by this program. The error message is: > >> The document „Budget.drachma‰ could not be opened. drachma cannot >> open files

Re: "Could not merge data"-error on save in a single moc app

2009-11-02 Thread Ben Trumbull
> On 29.10.2009, at 20:05, Ben Trumbull wrote: > >>> I get a "Could not merge changes"-error on save in a single moc app >>> (*). The docs state this is a problem of a multi-moc setup: >>> >>> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdTroubleshootin

Re: Help debugging "Dangling reference to an invalid object." Core Data error

2009-11-02 Thread Ben Trumbull
> On 10/29/09 5:23 PM, Ben Trumbull said: > >>> Even if I do [scene addTargetsWeak:[scene targetsWeak]] I get the error. >>> >>> Does this make any sense to anyone? >> >> The only caveat is you cannot change relationships from within - >> awakeFromFetch. This is documented: > > Ben, > > This

Re: NSObjectController add: Method RunLoop Deferral

2009-11-02 Thread Jason Foreman
On Nov 2, 2009, at 2:51 PM, Richard Somers wrote: I think the problem is with the add: method. The documentation states "Beginning with Mac OS X v10.4 the result of this method is deferred until the next iteration of the runloop so that the error presentation mechanism can provide feedba

Strange behaviour with NSTableView binded to NSArrayController with NSSet as content

2009-11-02 Thread Christian Ziegler
Hi all! I have a strange problem which I can't figure out. I got an NSTableView binded to an NSArrayController (Values, Sort Descriptors, Selection), which itself is binded to a class' NSMutableSet via the ContentSet binding. The NSTableView is filled via Drag & Drop or File/Open. For an i

Re: why use pow(x, 2)?

2009-11-02 Thread Chris Williams
How completely rude of you, Greg, to confuse a good argument with facts :) But it still does leave the style question: is pow(x,2) clearer than x*x? In the case from the OP, I think that the pow is clearer, because it is implementing an algorithm that calls specifically for x-squared. And in the

Re: 64 bit cocoa version of HIViewFlashDirtyArea() ?

2009-11-02 Thread David M. Cotter
okay what i really want to know is: how does QuartzDebug programmatically turn on this flash region thing? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
I can't speak for others, but I never meant to actually argue that pow (x, 2) is clearer than x * x. My argument was that each author should use whichever version he or she thinks is clearer. There are rarely absolutes about that sort of thing, as clarity is subjective by its very nature. I

Re: why use pow(x, 2)?

2009-11-02 Thread Greg Parker
On Nov 2, 2009, at 2:01 PM, Chris Williams wrote: How completely rude of you, Greg, to confuse a good argument with facts :) But it still does leave the style question: is pow(x,2) clearer than x*x? Stylistically, I like this best. It's clearer than either. static inline double sqr(do

Re: why use pow(x, 2)?

2009-11-02 Thread Mark Gallegly
Hasn't this gone off topic? Shouldn't this be discussed on the pow(x,x) Vs. x * x forum? On 11/2/09 2:10 PM, "Luke the Hiesterman" wrote: > I can't speak for others, but I never meant to actually argue that pow > (x, 2) is clearer than x * x. My argument was that each author should > use whiche

Re: why use pow(x, 2)?

2009-11-02 Thread Gregory Weston
Luke the Hiesterman wrote: On Nov 2, 2009, at 11:25 AM, Ed Wynne wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster, so except for clarity reasons, there isn't a good reason to use pow() in that case. Would it really be that mu

Re: why use pow(x, 2)?

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 2:01 PM, Chris Williams wrote: But it still does leave the style question: is pow(x,2) clearer than x*x? For arbitrary values of "x" they won't even give the same results. (Consider if the value being squared were "q++".) And if the value being squared contains functio

Keeping NSTimeInterval updated with current time

2009-11-02 Thread PCWiz
In my model class I have 2 properties, timeInterval and postedTime. postedTime contains a static date. timeInterval uses the timeIntervalSinceNow method to find the number of seconds that has passed by since the date in postedTime. What I want to do is around every 5 minutes, update the tim

Re: Core Data design question: receiving KVO notifications of partially mutated objects

2009-11-02 Thread Sean McBride
Graham, Thanks for the detailed reply! >I'd say you're going down the wrong path there. Agreed, hence my post. :) >Set each property individually. Yes, it will trigger a notification >for each one - doesn't or shouldn't matter, and unless you can show it >causes a performance problem, shouldn't

Re: Core Data design question: receiving KVO notifications of partially mutated objects

2009-11-02 Thread Sean McBride
On 11/2/09 12:58 PM, Ben Trumbull said: >> What is considered best practice when it comes to mutating many >> properties of a managed object, specifically with regard to KVO >> observers getting notified before all mutations are finished? > >This is a problem intrinsic to the design of KVO. KVO i

Re: 64 bit cocoa version of HIViewFlashDirtyArea() ?

2009-11-02 Thread Sean McBride
On 11/2/09 2:08 PM, David M. Cotter said: >okay what i really want to know is: > >how does QuartzDebug programmatically turn on this flash region thing? Presumably by using non-public APIs. At this point, you might find that the people on quartz-dev would have a better answer:

Re: why use pow(x, 2)?

2009-11-02 Thread Bob Smith
On Nov 2, 2009, at 11:38 AM, Luke the Hiesterman wrote: On Nov 2, 2009, at 11:36 AM, Sherm Pendley wrote: On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster Are you certain of that? Wi

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 3:10 PM, PCWiz wrote: What I want to do is around every 5 minutes, update the timeInterval to be consistent with the current time. The problem is that I need to do this update for a large number of instances of the object. One way I could think to do this would be to enu

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread Sean McBride
On 11/2/09 4:10 PM, PCWiz said: >In my model class I have 2 properties, timeInterval and postedTime. >postedTime contains a static date. timeInterval uses the >timeIntervalSinceNow method to find the number of seconds that has >passed by since the date in postedTime. What do you mean 'static'? I

Re: Core Data design question: receiving KVO notifications of partially mutated objects

2009-11-02 Thread Ben Trumbull
>> If your issue is that drawing or recalculation is occurring too >> frequently after KVO changes, you can consider coalescing and deferring >> the observers' actions instead of performing them synchronously. This >> can be valuable even for less complex KVO issues. >> >> You could also refactor

Re: why use pow(x, 2)?

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 3:22 PM, Bob Smith wrote: True, and not true, IMHO. It can be a pitfall to worry about performance issues too early in a coding project. On the other hand, by the time you know there is a performance problem it can easily be too late for low-level code optimization, an

Re: why use pow(x, 2)?

2009-11-02 Thread Luke the Hiesterman
On Nov 2, 2009, at 3:22 PM, Bob Smith wrote: All you youngsters who never ran an app on a CPU at less than GHz speeds, you ought to be forced to write code for an early-80's PC. Now that was _real_ programming! Also simply isn't reality anymore. Period. No matter how nostalgic you wish

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread PCWiz
postedTime is a static date object. timeInterval is the number of seconds from the postedTime TO the current time, so timeInterval is variable. I haven't observed a performance problem on my machine, I'm just considering less powerful computers and how they might handle it, but if thats t

pointer to structure member reference?

2009-11-02 Thread Chunk 1978
having a bit of a time understanding this: -> i think it's used to point to a member of a supplied argument of the method? - (void)method:(NSRange *)aRange ofSize:(NSSize *)aSize { aRange->location = 0; aSize->height = 4.0; } is it not possible to use dot notation here?

Re: pointer to structure member reference?

2009-11-02 Thread Thomas Wetmore
Chuck, NSRange and NSSize are C structures, not Objective-C objects. The -> operator is the C operator used to access structure fields from a structure pointer. You can use dot notation if you like: (*aRange).location = 0; (*aSize).height = 4.0; But if you do so you are NOT using the new O

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread Graham Cox
On 03/11/2009, at 10:10 AM, PCWiz wrote: What I want to do is around every 5 minutes, update the timeInterval to be consistent with the current time. The problem is that I need to do this update for a large number of instances of the object. One way I could think to do this would be to enu

Re: pointer to structure member reference?

2009-11-02 Thread Graham Cox
On 03/11/2009, at 11:58 AM, Chunk 1978 wrote: having a bit of a time understanding this: -> i think it's used to point to a member of a supplied argument of the method? - (void)method:(NSRange *)aRange ofSize:(NSSize *)aSize { aRange->location = 0; aSize->height = 4.0; } -> is just a po

Re: pointer to structure member reference?

2009-11-02 Thread Chunk 1978
ah, ok... i get it now. thanks for the responses. On Mon, Nov 2, 2009 at 8:13 PM, Graham Cox wrote: > > On 03/11/2009, at 11:58 AM, Chunk 1978 wrote: > > having a bit of a time understanding this: -> >> >> i think it's used to point to a member of a supplied argument of the >> method? >> >> -

Crash invoking Front Row - WTF?

2009-11-02 Thread Graham Cox
Hi all, A user is reporting a crash with my app where the crash causes the system to bring up Front Row. Has anyone ever seen anything like this, or can offer an explanation for it? I can't even see how an app could bring up Front Row if it wanted to, let alone accidentally like this! Nat

NSObjectController -selectedObjects

2009-11-02 Thread Richard Somers
Why does NSObjectController have a -selectedObjects method? I thought NSObjectController worked with a single object. Richard ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: NSObjectController -selectedObjects

2009-11-02 Thread Graham Cox
On 03/11/2009, at 1:13 PM, Richard Somers wrote: Why does NSObjectController have a -selectedObjects method? I thought NSObjectController worked with a single object. Probably because it's the base class for all the other kinds of controllers that deal with multiple objects. The docs sugg

CAAnimation retains its delegate

2009-11-02 Thread Matt Neuburg
Apropos of nothing at all, here's a little tip from the Department of Lessons Learned: A CAAnimation retains its delegate, which is a severe exception to the general rules and expectations about memory management. Of course one can see why this might be (animations take time, so let's make sure our

[MEET] (Sydney/Australia) CHANGE OF VENUE - CocoaHeads/NSCoder Sydney - November 5th - Mac/iPhone hack night

2009-11-02 Thread Mark Aufflick
Hi All, The kind people at Snepo are letting us use their offices for our hack night this Friday, including Wifi and a fridge (fridge contents not included I'm assuming). Snepo Research office is at 2/21 Mary St, Surry Hills, Cameron will need to buzz you in, so buzz Unit 2 when you arrive or cal

Re: [MEET] (Sydney/Australia) CHANGE OF VENUE - CocoaHeads/NSCoder Sydney - November 5th - Mac/iPhone hack night

2009-11-02 Thread Mark Aufflick
Typo - It's this Thursday Nov 5th, not Friday. On Tue, Nov 3, 2009 at 1:49 PM, Mark Aufflick wrote: > Hi All, > > The kind people at Snepo are letting us use their offices for our hack > night this Friday, including Wifi and a fridge (fridge contents not included > I'm assuming). > > Snepo Resear

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread Ken Thomases
On Nov 2, 2009, at 7:10 PM, Graham Cox wrote: On 03/11/2009, at 10:10 AM, PCWiz wrote: What I want to do is around every 5 minutes, update the timeInterval to be consistent with the current time. The problem is that I need to do this update for a large number of instances of the object. O

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Ken Thomases
On Nov 2, 2009, at 7:20 PM, Graham Cox wrote: A user is reporting a crash with my app where the crash causes the system to bring up Front Row. Has anyone ever seen anything like this, or can offer an explanation for it? I can't even see how an app could bring up Front Row if it wanted to, l

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Graham Cox
Thanks Ken, I'll follow up with the user with these points. My app doesn't post keyboard events itself, but on further discussion it sounds like the app is hanging rather than actually crashing, so the Force Quit situation definitely could be the case. The default key combo for Front Row se

NSMatrix -renewRows:columns: doesn't change cell count

2009-11-02 Thread Matt Neuburg
If I say: [myMatrix renewRows:5 columns:5]; and then later: [myMatrix renewRows:3 columns:3]; int i = [[myMatrix cells] count]; // i is 25 Is this a bug? I know that renewRows:columns: doesn't release cells (the docs tell me so), but I do expect that the "cells" method will report the cells tha

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Roland King
Graham Cox wrote: Thanks Ken, I'll follow up with the user with these points. My app doesn't post keyboard events itself, but on further discussion it sounds like the app is hanging rather than actually crashing, so the Force Quit situation definitely could be the case. The default key c

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Bryan Matteson
The default key combo for Front Row seems to be command + enter, Force Quit is command + option + escape, so they don't seem to be all that similar. But it could be some other user error. On my system, the default is command + escape, so they are in fact similar. -B

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Stephen J. Butler
On Mon, Nov 2, 2009 at 9:24 PM, Graham Cox wrote: > The default key combo for Front Row seems to be command + enter, Force Quit > is command + option + escape, so they don't seem to be all that similar. But > it could be some other user error. On my machine it's Command + Escape, which is just on

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Graham Cox
On 03/11/2009, at 2:32 PM, Stephen J. Butler wrote: On my machine it's Command + Escape, which is just one key away from Force Quit. I never use Front Row, so I doubt I've ever changed the shortcut mapping. My bad, it is command-escape on mine also. I misinterpreted the icon as meaning ente

Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Leonardo Borsten
Hello all, I'm getting a EXC_BAD_ACCESS error with the explanation "Unable to disassemble objc_assign_strongCast" when I get to save the NSManagedContext in one of my functions. Using a breakpoint, I see that the debugger stops right after 0x904c6e76 <+1414> call 0x90573efe These ar

override behaviour of handling NSLinkAttributeName

2009-11-02 Thread PCWiz
I'm making text clinks in an NSMutableString clickable through adding the NSLinkAttributeName attribute to any text that is a URL inside the string. By default the clicked URL just opens in the default web browser. Is there any way to override this behaviour and have my own code run in pl

Re: override behaviour of handling NSLinkAttributeName

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 8:01 PM, PCWiz wrote: By default the clicked URL just opens in the default web browser. Is there any way to override this behaviour and have my own code run in place of just opening the URL. There's an NSTextView delegate method for this: - (BOOL)textView:(NSTextView *)

Re: override behaviour of handling NSLinkAttributeName

2009-11-02 Thread PCWiz
I probably should have mentioned that I'm using an NSTextField, not an NSTextView to display the text. And based on the current limitations imposed by my app, I cannot use an NSTextView. Is there an equivalent delegate method to this for NSTextField? Thanks On 2009-11-02, at 9:05 PM, Jens Al

[moderator Re: why use pow(x, 2)?

2009-11-02 Thread Scott Anguish
On Nov 2, 2009, at 2:01 PM, Chunk 1978 wrote: > i just came across some code, and i'm trying to understand why the developer > chose to use the pow() function instead of simply multiplying as the 2nd > arguments are always 2. i'm certainly no mathematician, but if the 2nd > argument is going to

[moderator] Re: why use pow(x, 2)?

2009-11-02 Thread Scott Anguish
On Nov 2, 2009, at 2:25 PM, Ed Wynne wrote: >> Um, "*" is multiplication, not exponentiation. Maybe you're thinking of the >> "**" operator found in some languages, though not in C :) > > That said, the original question is a good one. Using x*x instead of pow(x,2) > would be quite a bit faster,

Re: override behaviour of handling NSLinkAttributeName

2009-11-02 Thread PCWiz
Oops, my mistake. That delegate method seems to work fine on NSTextField as well many thanks On 2009-11-02, at 9:05 PM, Jens Alfke wrote: On Nov 2, 2009, at 8:01 PM, PCWiz wrote: By default the clicked URL just opens in the default web browser. Is there any way to override this behaviour

Re: override behaviour of handling NSLinkAttributeName

2009-11-02 Thread Kyle Sluder
On Nov 2, 2009, at 8:26 PM, PCWiz wrote: I probably should have mentioned that I'm using an NSTextField, not an NSTextView to display the text. And based on the current limitations imposed by my app, I cannot use an NSTextView. You are, in fact, using an NSTextView: the field editor. Unles

Re: Commandline Tool Help - NSDistantObject and NSConnection

2009-11-02 Thread aaron smith
OK. I figured it out. Here's the answer just in case anyone else runs into this. There seems to be some kind of bug when passing around an NSURL through distributed objects. You need to make sure to make a new NSURL object in the "server" applications' code. like this: - (void) openWithGity:(NSU

Re: Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Stephen J. Butler
On Mon, Nov 2, 2009 at 9:47 PM, Leonardo Borsten wrote: >        NSError **saveError; >        [importContext save:saveError];  // <--- crashes here Think for a minute about what the parameter is trying to do: return an object. To do that it needs to assign to a variable the caller provides. Is t

Re: Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Bryan Henry
Here's the normal way to do it: NSError *saveError; [importContext save:&saveError]; Important nitpick: NSError *saveError = nil; [importContext save:&saveError]; Methods that follow the NSError** convention are not required to actually assign a value to the saveError pointer, so you'll w

Re: Commandline Tool Help - NSDistantObject and NSConnection

2009-11-02 Thread Jens Alfke
On Nov 2, 2009, at 9:36 PM, aaron smith wrote: There seems to be some kind of bug when passing around an NSURL through distributed objects. Oh, you've run into _that_! :-/ For some reason, NSURLs are unexpectedly not copied when sent over DO, the way other "value" objects like NSStrings

Re: Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Roland King
Important nitpick: NSError *saveError = nil; [importContext save:&saveError]; Methods that follow the NSError** convention are not required to actually assign a value to the saveError pointer, so you'll want to make sure to initialize saveError to nil since its a local variable. Wouldn'

Re: Unable to disassemble objc_assign_strongCast

2009-11-02 Thread Kyle Sluder
On Mon, Nov 2, 2009 at 10:06 PM, Roland King wrote: > Haven't there been several threads recently telling people *never* to use > the if( saveError ) check because saveError may be set even if the method > succeeds. You can use it to determine if there is an error object available. If the method

  1   2   >