Design Question: Pro & Cons of KVC/KVO

2008-08-20 Thread Oleg Krupnov
I need to make the design decision regarding how the model and the views will be kept in sync with each other. Namely: - I can use key-value coding and observing (KVC and KVO) - I can use bindings (not sure if it's really different from the KVC/KVO) - I can write the "glue code" myself The concep

Re: NSCalendarDate to be deprecated

2008-08-20 Thread Aurélien Hugelé
I too find NSCalendarDate tremendously useful. The fact that it is used (not to say necessary) in Sync Services let me believe it won't be deprecated. I hope Apple won't ask 3rd party developer dto rewrite their code using Sync Services ... Aurélien, Objective Decision Team On 18 août

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Ken Ferry
On Wed, Aug 20, 2008 at 10:33 PM, Dave Dribin <[EMAIL PROTECTED]> wrote: > And for NSActionCell, we've got these: > > Exposed bindings: ( >editable, >enabled, >font, >fontBold, >fontFamilyName, >fontItalic, >fontName, >fontSize, >value > ) > > Indeed, NSActionCel

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
I suspect that there is a language issue here. What exactly do you mean by "alignment"? On Wed, Aug 20, 2008 at 9:10 PM, mm w <[EMAIL PROTECTED]> wrote: > great alignement > > On Wed, Aug 20, 2008 at 8:32 PM, Clark Cox <[EMAIL PROTECTED]> wrote: >> On Wed, Aug 20, 2008 at 8:06 PM, Michael Ash <[EM

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Dave Dribin
On Aug 20, 2008, at 3:35 AM, Ken Ferry wrote: FYI, you should avoid using direct subclasses of NSCell in controls on Leopard and previous. Well, that settles that, then. ;) It's somewhat unfortunate, but there are many cases where messages need to flow from a cell up to a view. If your cell

Re: Model Object Validation

2008-08-20 Thread Quincey Morris
On Aug 20, 2008, at 21:37, Chris Idou wrote: I have a validation method on my object, managed by a NSObjectController. If I try and tab out of a field that is invalid I get a warning sheet - great. But if I just hit command-S to save, there is no message. I could of course tediously call

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Dave Dribin
On Aug 19, 2008, at 10:51 PM, Dave Dribin wrote: On Aug 19, 2008, at 5:47 PM, Dave Dribin wrote: Again, what's strange is if I change my cell's superclass to be NSTextFieldCell, this bind: call does not give an error and it all works. I also tried subclassing NSActionCell, and that works,

Re: Best Way to Handle Properties?

2008-08-20 Thread Shawn Erickson
On Wed, Aug 20, 2008 at 9:46 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > Anyone got any thoughts on this? Is there any valid case for doing this, and > having this written into a coding standard? Only possible pathway (ignoring memory smasher) is something like a double init ( [[[SomeClass alloc]

Re: Best Way to Handle Properties?

2008-08-20 Thread Graham Cox
On 21 Aug 2008, at 2:31 pm, Shawn Erickson wrote: On Wed, Aug 20, 2008 at 10:42 AM, Dave <[EMAIL PROTECTED]> wrote: Yes, all 56 properties are required for the object to be valid, so in the initializer I set the NSString pointers to nil, zeroize the integers and set the dataValid flag t

Re: Core Data - "Items cannot be deleted from X"

2008-08-20 Thread Quincey Morris
On Aug 20, 2008, at 20:21, Nick Zitzmann wrote: I have two Core Data entities. Entity X has a to-many relationship with entity Y. On entity X, the relationship may refer to zero or many instances of entity Y, and deleting an instance of entity X is supposed to cascade-delete instances of e

Model Object Validation

2008-08-20 Thread Chris Idou
I have a validation method on my object, managed by a NSObjectController. If I try and tab out of a field that is invalid I get a warning sheet - great. But if I just hit command-S to save, there is no message. I could of course tediously call every single validation method in my NSDocument's s

Re: Can't create pointer to custom class

2008-08-20 Thread Graham Cox
On 21 Aug 2008, at 8:37 am, Nathan wrote: I created a class, and want to make a pointer to it in another class. So I did, ESAnimation *animation; ESAnimation turns green when I write it so I know it's recognizing it, though I would expect it to turn blue. But when I try compiling, it sa

Re: Best Way to Handle Properties?

2008-08-20 Thread Shawn Erickson
On Wed, Aug 20, 2008 at 10:42 AM, Dave <[EMAIL PROTECTED]> wrote: > Yes, all 56 properties are required for the object to be valid, so in the > initializer I set the NSString pointers to nil, zeroize the integers and set > the dataValid flag to FALSE. Objective-C guarantees that all ivars will be

Re: NSWindowController, owner, "primary window"...

2008-08-20 Thread Graham Cox
On 21 Aug 2008, at 5:13 am, Gerd Knops wrote: That'd work, but I'd have to subclass NSWindowController for that so I can add that property. Seemed to me that the above would not be an uncommon pattern and there ought to be a more elegant way that I might have missed. Yep, that's the usu

Re: !foo vs foo == nil

2008-08-20 Thread mm w
great alignement On Wed, Aug 20, 2008 at 8:32 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 8:06 PM, Michael Ash <[EMAIL PROTECTED]> wrote: >> On Wed, Aug 20, 2008 at 8:34 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: >>> Well, after all, zero is zero, how much difference ca

Re: !foo vs foo == nil

2008-08-20 Thread mm w
please, don't truncate my answer... especially * On Wed, Aug 20, 2008 at 8:27 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 7:44 PM, mm w <[EMAIL PROTECTED]> wrote: >> NULL does not have to be 0, 0 could be a valid pointer value > > This is not true, the C standard guarantees

Re: NSView confusion

2008-08-20 Thread Graham Cox
On 21 Aug 2008, at 1:19 am, Charlie Dickman wrote: Sounds like a declaration issue :-) That may be what it sounds like but I've tried every which way I can to declare it differently to no avail. Except, presumably, the correct way, otherwise your problem would have been solved. So: /

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
On Wed, Aug 20, 2008 at 8:31 PM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > On 20 Aug 08, at 20:06, Michael Ash wrote: >> >> On Wed, Aug 20, 2008 at 8:34 PM, Douglas Davidson <[EMAIL PROTECTED]> >> wrote: >>> >>> Well, after all, zero is zero, how much difference can it make? Quite a >>> bit, as i

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
On Wed, Aug 20, 2008 at 8:06 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 8:34 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: >> Well, after all, zero is zero, how much difference can it make? Quite a >> bit, as it turns out, since in 64-bit one of them is four bytes of ze

Re: !foo vs foo == nil

2008-08-20 Thread Andrew Farmer
On 20 Aug 08, at 20:06, Michael Ash wrote: On Wed, Aug 20, 2008 at 8:34 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: Well, after all, zero is zero, how much difference can it make? Quite a bit, as it turns out, since in 64-bit one of them is four bytes of zero, and the other is eight byt

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
On Wed, Aug 20, 2008 at 7:44 PM, mm w <[EMAIL PROTECTED]> wrote: > NULL does not have to be 0, 0 could be a valid pointer value This is not true, the C standard guarantees that 0, converted to any pointer type is a NULL pointer constant. It is not possible to convert 0 to a non-NULL pointer. --

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
On Wed, Aug 20, 2008 at 5:32 PM, mm w <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 5:19 PM, Clark Cox <[EMAIL PROTECTED]> wrote: >> On Wed, Aug 20, 2008 at 5:07 PM, mm w <[EMAIL PROTECTED]> wrote: >>> as Mike and me pointed NULL === NULL >>> but Im yet not alright with >>> >>> (!foo) === i

Core Data - "Items cannot be deleted from X"

2008-08-20 Thread Nick Zitzmann
I tried searching via the usual engines and found nothing. I have two Core Data entities. Entity X has a to-many relationship with entity Y. On entity X, the relationship may refer to zero or many instances of entity Y, and deleting an instance of entity X is supposed to cascade-delete ins

Re: !foo vs foo == nil

2008-08-20 Thread Michael Ash
On Wed, Aug 20, 2008 at 8:34 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: > Well, after all, zero is zero, how much difference can it make? Quite a > bit, as it turns out, since in 64-bit one of them is four bytes of zero, and > the other is eight bytes of zero. If you're just comparing agains

Re: !foo vs foo == nil

2008-08-20 Thread Michael Ash
On Wed, Aug 20, 2008 at 7:56 PM, John C. Randolph <[EMAIL PROTECTED]> wrote: > > On Aug 20, 2008, at 4:15 PM, Torsten Curdt wrote: >> >> There was a common perception that NULL is not really the same as nil. But >> seems like in the end it really is (void*)0. > > They differ in type, not in value.

Accessing properties of a generic class

2008-08-20 Thread John Murphy
I have a Person class with name and image properties stored in an array. When I access its properties from within the controller class like this: Person *person = [objectArray objectAtIndex:0]; [nameField setStringValue:person.name]; [imageArea setImage:person.image]; e

Re: MacBook Wake On Lan

2008-08-20 Thread Jonathan Hendry
On Aug 20, 2008, at 17:47 PM, Ryan Stephens wrote: I believe that most MacBooks and Powerbooks are designed to run when closed if an external monitor, keyboard and mouse are attached. A dummy monitor, allowing headless operation, can be easily created using a resistor and a VGA connector,

Re: !foo vs foo == nil

2008-08-20 Thread mm w
Using NULL would make your code easier to read, setting a variable to NULL makes it obvious that a variable is a pointer, at least in C, NULL does not have to be 0, 0 could be a valid pointer value*, and NULL some other invalid value, many people got in the habit of writing if (!foo) sure the com

DEV Wanted - iTunes plugin

2008-08-20 Thread Ian H Stewart
We are looking for a developer to create an iTunes plugin. It can launch inside the app (as a visualizer) or launch along side. It needs to pull details for within iTunes during it's operation. Additional details are available. Contact me at [EMAIL PROTECTED] Sincerely, Ian PS Also postin

Re: !foo vs foo == nil

2008-08-20 Thread falcon
Yes, nil is the equivalent of NULL and 0 nil is used for objective-c objects and NULL for C pointers Regards Vlad On Aug 21, 2008, at 1:15 AM, Torsten Curdt wrote: On Aug 21, 2008, at 00:30, Filip van der Meeren wrote: On 21 Aug 2008, at 00:23, Torsten Curdt wrote: This question has come

Can't create pointer to custom class

2008-08-20 Thread Nathan
I created a class, and want to make a pointer to it in another class. So I did, ESAnimation *animation; ESAnimation turns green when I write it so I know it's recognizing it, though I would expect it to turn blue. But when I try compiling, it says syntax error before 'ESAnimation'. So I to

Re: MacBook Wake On Lan

2008-08-20 Thread Ryan Stephens
I believe that most MacBooks and Powerbooks are designed to run when closed if an external monitor, keyboard and mouse are attached. Ryan On Wed, Aug 20, 2008 at 1:49 PM, Andrew Merenbach <[EMAIL PROTECTED] > wrote: > Hi! > > If a MacBook does not go to sleep when it's closed, my guess is that i

Re: Outlet Initialization Uses Accessors

2008-08-20 Thread Jonathan Hess
Yes it does. One thing to be aware of is that this can lead you to retain your outlets. Also, if you have an action named '-(IBAction) setFoo:(id)sender' and an outlet named foo, setting the outlet at runtime will be defeated by the existence of the action with the matching KVC name. It's

Re: Parse form values from HTTP POST

2008-08-20 Thread Jesse Grosjean
That link is close, but it looks like soap just puts XML in the body... wish that was the way that FORM POSTs did it to, but it doesn't seem to work that way. Instead it looks like FORMS send their data in x-www-form-urlencoded. So now at least I have a more specific question. Is there any

Re: !foo vs foo == nil

2008-08-20 Thread Quincey Morris
On Aug 20, 2008, at 18:15, mm w wrote: as a previous oppenant said yeh dude it's normal it's undefined/ nothin nada :) int main(void) {g char *p1; char *p2 = NULL; if(!p1) puts("hello p1"); if(!p2) puts("hello p2"); return 0;

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Matthew Mashyna
On Aug 20, 2008, at 6:09 PM, Jean-Daniel Dupas wrote: Le 21 août 08 à 00:02, Matthew Mashyna a écrit : I have an NSTableView subclass whose only override method is rightMouseDown. I override it so I can have it select the table row before validating and presenting the context menu (by the

Re: Question about respondsToSelector

2008-08-20 Thread Marcel Weiher
On Aug 19, 2008, at 6:33 AM, Carmen Cerino Jr. wrote: if ([_delegate respondsToSelector: @selector(SGDecompDataProc:)]){ [_delegate SGDecompDataProc:pixelBuffer trackingFlags:decompressionTrackingFlags disp

Re: !foo vs foo == nil

2008-08-20 Thread Marcel Weiher
On Aug 20, 2008, at 6:14 PM, John C. Randolph wrote: On Aug 20, 2008, at 5:04 PM, j o a r wrote: On Aug 20, 2008, at 4:56 PM, John C. Randolph wrote: Personally, I prefer "if (!foo)" over "if (foo == nil)", because the latter has the hazard of a typo that compiles. You can lose a fair bit

Re: !foo vs foo == nil

2008-08-20 Thread mm w
anyway I m going to add a hint as a previous oppenant said yeh dude it's normal it's undefined/ nothin nada :) int main(void) {g char *p1; char *p2 = NULL; if(!p1) puts("hello p1"); if(!p2) puts("hello p2"); return 0; } out

Re: !foo vs foo == nil

2008-08-20 Thread John C. Randolph
On Aug 20, 2008, at 5:04 PM, j o a r wrote: On Aug 20, 2008, at 4:56 PM, John C. Randolph wrote: Personally, I prefer "if (!foo)" over "if (foo == nil)", because the latter has the hazard of a typo that compiles. You can lose a fair bit of time staring at "if (foo = nil)" before you spot

Re: !foo vs foo == nil

2008-08-20 Thread mm w
ok Im like a puppy I like to play, I will stop to play the evil advogate for 98% of cases here my late Initialization: we can say (!toto) is the same of toto == NULL but the Douglas pointed something really interesting... let see ahead On Wed, Aug 20, 2008 at 5:39 PM, Andrew Merenbach <[EMAIL

Re: !foo vs foo == nil

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 7:43 PM, Torsten Curdt wrote: On Aug 21, 2008, at 01:50, Ken Thomases wrote: On Aug 20, 2008, at 6:15 PM, Torsten Curdt wrote: I guess my questions wasn't phrased correctly. The point was more: is 'nil' really the equivalent of 0 or NULL. Let's put it this way: freshly

Re: !foo vs foo == nil

2008-08-20 Thread Torsten Curdt
On Aug 21, 2008, at 01:50, Ken Thomases wrote: On Aug 20, 2008, at 6:15 PM, Torsten Curdt wrote: I guess my questions wasn't phrased correctly. The point was more: is 'nil' really the equivalent of 0 or NULL. Let's put it this way: freshly allocated objects have their memory zeroed out,

Re: creating instance using Class variable

2008-08-20 Thread Eliza Block
No error! I just assumed the thing I made it up out of thin air wasn't going to work. Sorry about that, and thanks for setting me straight. -Eliza On Aug 20, 2008, at 8:36 PM, Charles Steinman wrote: --- On Wed, 8/20/08, Eliza Block <[EMAIL PROTECTED]> wrote: In short, I want to do somethi

Re: !foo vs foo == nil

2008-08-20 Thread Andrew Merenbach
With all due respect, this seems a little more confusing than enlightening. Alignment has little to do with the question, as far as I can see. Would you be so kind as to explain what bearing your answer has on the original poster's question? -- Andrew On Aug 20, 2008, at 3:29 PM, mm w wr

Re: creating instance using Class variable

2008-08-20 Thread Charles Steinman
--- On Wed, 8/20/08, Eliza Block <[EMAIL PROTECTED]> wrote: > In short, I want to do something like this: > Class stringClass = [NSString class]; > id myNewString = [[stringClass alloc] init]; > > But that doesn't work. Yes it does. I mean, it creates a static empty string and thus isn't all tha

Re: !foo vs foo == nil

2008-08-20 Thread Douglas Davidson
On Aug 20, 2008, at 4:57 PM, Michael Ash wrote: (Now, they don't have to be. As I recall, NULL can just be a plain integer 0 as well. But they do have to be equivalent, and it just so happens that they are identical even though they don't need to be.) Let me share a cautionary tale. At one p

Re: creating instance using Class variable

2008-08-20 Thread Eliza Block
Doesn't work how? I believe that's exactly how it's supposed to work. Hmm, you're right, it does work! I think I thought it didn't work because I just made it up without being able to find documentation. Glad the obvious thing was right. Sorry for the non-question! -Eliza

Re: !foo vs foo == nil

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 7:28 PM, mm w wrote: foo = -1 And? -Ken ___ 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

Re: !foo vs foo == nil

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 7:07 PM, mm w wrote: as Mike and me pointed NULL === NULL but Im yet not alright with (!foo) === if(foo == nil) as I sent previously #include #include int main(void) { char *p1; char *p2 = NULL; free(p1); free(p2); return 0; } You kee

Re: creating instance using Class variable

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 7:02 PM, Eliza Block wrote: Does anyone know how to use a variable of type Class to create an instance of an object? I'm writing a method that needs to create an instance of one of two classes, to be determined at run-time. I want to pass in a Class variable, and have

Re: !foo vs foo == nil

2008-08-20 Thread mm w
foo = -1 On Wed, Aug 20, 2008 at 5:19 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 5:07 PM, mm w <[EMAIL PROTECTED]> wrote: >> as Mike and me pointed NULL === NULL >> but Im yet not alright with >> >> (!foo) === if(foo == nil) > > if(!foo) and if(foo == nil) are 100% identic

Re: !foo vs foo == nil

2008-08-20 Thread Clark Cox
On Wed, Aug 20, 2008 at 5:07 PM, mm w <[EMAIL PROTECTED]> wrote: > as Mike and me pointed NULL === NULL > but Im yet not alright with > > (!foo) === if(foo == nil) if(!foo) and if(foo == nil) are 100% identical as far as the language is concerned. Trust me. > > as I sent previously How is this

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Corbin Dunn
On Aug 20, 2008, at 4:25 PM, Sean McBride wrote: On 8/20/08 6:02 PM, Matthew Mashyna said: This works nicely but I have found that it does not work for control clicks. For a another view item I overrode mouseDown to check for the control key and call [self rightMouseDown] if needed. Have yo

Re: !foo vs foo == nil

2008-08-20 Thread mm w
as Mike and me pointed NULL === NULL but Im yet not alright with (!foo) === if(foo == nil) as I sent previously #include #include int main(void) { char *p1; char *p2 = NULL; free(p1); free(p2); return 0; } On Wed, Aug 20, 2008 at 4:57 PM, Michael Ash

Re: !foo vs foo == nil

2008-08-20 Thread j o a r
On Aug 20, 2008, at 4:56 PM, John C. Randolph wrote: Personally, I prefer "if (!foo)" over "if (foo == nil)", because the latter has the hazard of a typo that compiles. You can lose a fair bit of time staring at "if (foo = nil)" before you spot the mistake. There is a GCC warning to help

creating instance using Class variable

2008-08-20 Thread Eliza Block
Hello, Does anyone know how to use a variable of type Class to create an instance of an object? I'm writing a method that needs to create an instance of one of two classes, to be determined at run-time. I want to pass in a Class variable, and have the method use it to create the instance.

Re: Outlet Initialization Uses Accessors

2008-08-20 Thread John C. Randolph
On Aug 20, 2008, at 8:09 AM, Gordon Apple wrote: I just had a revelation I though I would share -- thanks to some sample code David Duncan sent me. When IB makes a connection, it calls the outlet's accessor, if one is available. That fact can be used to initialize related items in your

Re: !foo vs foo == nil

2008-08-20 Thread Michael Ash
On Wed, Aug 20, 2008 at 7:15 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote: > I guess my questions wasn't phrased correctly. The point was more: is 'nil' > really the equivalent of 0 or NULL. > > There was a common perception that NULL is not really the same as nil. But > seems like in the end it rea

Re: !foo vs foo == nil

2008-08-20 Thread John C. Randolph
On Aug 20, 2008, at 4:15 PM, Torsten Curdt wrote: There was a common perception that NULL is not really the same as nil. But seems like in the end it really is (void*)0. They differ in type, not in value. "NULL" is (void *) 0. "nil" is (id) 0. "Nil" is (Class) 0. Personally, I prefer "if

Re: !foo vs foo == nil

2008-08-20 Thread mm w
#define __DARWIN_NULL ((void *)0) #define nil __DARWIN_NULL typedef struct objc_object { Class isa; } *id; typedef id (*IMP)(id, SEL, ...); id is a pointer you just demonstrated that 1 = 1 On Wed, Aug 20, 2008 at 4:42 PM, Jim Puls <[EMAIL PROTECTED]> wrote: >>> Just try

Re: !foo vs foo == nil

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 6:15 PM, Torsten Curdt wrote: I guess my questions wasn't phrased correctly. The point was more: is 'nil' really the equivalent of 0 or NULL. Let's put it this way: freshly allocated objects have their memory zeroed out, except for their isa pointer. You can also rely o

Re: !foo vs foo == nil

2008-08-20 Thread Jim Puls
Just try it out in a small project... Keep in mind that Objective-C is the same as C, and C only checks for numbers within the if() statement... 0 = false, 1 or more = true... nil = 0 so, they mean the same thing... I guess my questions wasn't phrased correctly. The point was more: is 'ni

Re: !foo vs foo == nil

2008-08-20 Thread mm w
and especially for someone who's developing in Java On Wed, Aug 20, 2008 at 4:15 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote: > > On Aug 21, 2008, at 00:30, Filip van der Meeren wrote: > >> On 21 Aug 2008, at 00:23, Torsten Curdt wrote: >> >>> This question has come up during the last CocoaHeads a

Re: !foo vs foo == nil

2008-08-20 Thread mm w
hum (void *)0 is equal to 0 interesting... type *ptr != type *ptr= NULL you should also align your knowledge you failed, you are a lazy pointer On Wed, Aug 20, 2008 at 4:15 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote: > > On Aug 21, 2008, at 00:30, Filip van der Meeren wrote: > >> On 21 Aug 20

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Sean McBride
On 8/20/08 6:02 PM, Matthew Mashyna said: >This works nicely but I have found that it does not work for control >clicks. For a another view item I overrode mouseDown to check for the >control key and call [self rightMouseDown] if needed. Have you seen:

[MEET] CocoaHeads Frankfurt, 1st Sept 8pm

2008-08-20 Thread Torsten Curdt
Soon it's the first Monday of the month again. That means it's time for CocoaHeads Frankfurt. http://upcoming.yahoo.com/event/983074 http://cocoaheads.mixxt.de/networks/events/index Please note that we meeting at a different venue this time. cheers -- Torsten http://vafer.org/blog ___

Re: !foo vs foo == nil

2008-08-20 Thread Torsten Curdt
On Aug 21, 2008, at 00:30, Filip van der Meeren wrote: On 21 Aug 2008, at 00:23, Torsten Curdt wrote: This question has come up during the last CocoaHeads and no one was really able to give a definite answer. Do both expressions really mean the same thing (as nil is not null)? if (!foo) {

Re: CALayer glitch: move one sublayer, add/remove another

2008-08-20 Thread Dave Hayden
(Just noticed that I posted this on quartz-dev, not here. [Didn't get an answer to my question there, either, natch.] For the archives, here's a very questionable workaround to the problem I was having..) On Jul 18, 2008, at 11:52 AM, Dave Hayden wrote: Just wanted to see if this is expecte

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Jean-Daniel Dupas
Le 21 août 08 à 00:02, Matthew Mashyna a écrit : I have an NSTableView subclass whose only override method is rightMouseDown. I override it so I can have it select the table row before validating and presenting the context menu (by then passing it up to [super rightMouseDown]). This work

Re: !foo vs foo == nil

2008-08-20 Thread mm w
On Wed, Aug 20, 2008 at 3:32 PM, David Duncan <[EMAIL PROTECTED]> wrote: > On Aug 20, 2008, at 3:23 PM, Torsten Curdt wrote: > >> This question has come up during the last CocoaHeads and no one was really >> able to give a definite answer. >> Do both expressions really mean the same thing (as nil i

Re: !foo vs foo == nil

2008-08-20 Thread David Duncan
On Aug 20, 2008, at 3:23 PM, Torsten Curdt wrote: This question has come up during the last CocoaHeads and no one was really able to give a definite answer. Do both expressions really mean the same thing (as nil is not null)? nil == 0. 0 is false, !0 is true. 0 == 0 is true. Therefore they

Re: !foo vs foo == nil

2008-08-20 Thread Filip van der Meeren
On 21 Aug 2008, at 00:23, Torsten Curdt wrote: This question has come up during the last CocoaHeads and no one was really able to give a definite answer. Do both expressions really mean the same thing (as nil is not null)? if (!foo) { ... } if (foo == nil) { ... } Just try it out in a sma

Re: !foo vs foo == nil

2008-08-20 Thread mm w
#include #include int main(void) { char *p1; char *p2 = NULL; free(p1); free(p2); return 0; } if (toto)... just align your answer On Wed, Aug 20, 2008 at 3:23 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote: > This question has come up during the last CocoaHea

!foo vs foo == nil

2008-08-20 Thread Torsten Curdt
This question has come up during the last CocoaHeads and no one was really able to give a definite answer. Do both expressions really mean the same thing (as nil is not null)? if (!foo) { ... } if (foo == nil) { ... } cheers -- Torsten ___ Co

Re: Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Randall Meadows
On Aug 20, 2008, at 4:02 PM, Matthew Mashyna wrote: I have an NSTableView subclass whose only override method is rightMouseDown. I override it so I can have it select the table row before validating and presenting the context menu (by then passing it up to [super rightMouseDown]). This wo

Re: Best Way to Handle Properties?

2008-08-20 Thread Charles Srstka
On Aug 20, 2008, at 12:42 PM, Dave wrote: The copy operation here, copies that data from one string to a newly allocated string, right? Only if it's mutable. If it's immutable, it's most likely that copy will just do the same thing as retain - since that object isn't going to change, ther

Re: NSToolbar within view

2008-08-20 Thread Seth Willits
On Aug 20, 2008, at 3:15 PM, Filip van der Meeren wrote: I have been searching for a way to put a NSToolbar within a Custom View. Is this possible? No. I have one button that is a default, to return to the previous view, but each view has its own collection of buttons. Or do you guys kn

NSToolbar within view

2008-08-20 Thread Filip van der Meeren
Hi, I have been searching for a way to put a NSToolbar within a Custom View. Is this possible? I have one button that is a default, to return to the previous view, but each view has its own collection of buttons. Or do you guys know an alternative? Filip __

Control-Click vs Right-Click in NSTableView

2008-08-20 Thread Matthew Mashyna
I have an NSTableView subclass whose only override method is rightMouseDown. I override it so I can have it select the table row before validating and presenting the context menu (by then passing it up to [super rightMouseDown]). This works nicely but I have found that it does not work for

Re: Core Data merging

2008-08-20 Thread Adam Swift
On Aug 15, 2008, at 5:26 AM, Vadim Lozko wrote: On Aug 15, 2008, at 6:09 AM, Tim Isted wrote: On 15 Aug 2008, at 00:19, Vadim Lozko wrote: I'm having a problem trying to upgrade an existing store of a Core Data database to a newer model that simply has 1 additional attribute property in

[Q] SFPreferenceView and authorize as admin?

2008-08-20 Thread JongAm Park
Hello, all. Does any of you know how to authorize a user as an admin user using the SFPreferenceView? I'm writing a preference pane for the System Preference. What this custom preference pane does are : - Display system wide setting, but until a user clicks the "lock" icon, a user is not all

Re: Parse form values from HTTP POST

2008-08-20 Thread mm w
http://developer.apple.com/samplecode/CocoaSOAP/listing7.html On Wed, Aug 20, 2008 at 1:54 PM, Jesse Grosjean <[EMAIL PROTECTED]> wrote: > Does anyone know what the best way to parse form values from and HTTP Post > is? > > I have a mini HTTP server in my app, and it needs to accept posts. I'm usi

Parse form values from HTTP POST

2008-08-20 Thread Jesse Grosjean
Does anyone know what the best way to parse form values from and HTTP Post is? I have a mini HTTP server in my app, and it needs to accept posts. I'm using CFHTTP to implement the server, so I have a CFHTTPMessageRef. I'm trying to figure out how to turn that into a dictionary of keys and

Re: passing an object between views

2008-08-20 Thread John Greene
I appear to have lied: the object makes it across successfully. Thanks all for your help. John John Greene wrote: > Ah, reasonably better! Now I have: > > - (void)tableView:(UITableView *)tableView > didSelectRowAtIndexPath:(NSIndexPath *)indexPath { > if(dvController == nil) >

Re: MacBook Wake On Lan

2008-08-20 Thread Andrew Merenbach
Hi! If a MacBook does not go to sleep when it's closed, my guess is that it would probably overheat. I don't think that trying to override that behavior is a good idea at all, even if it is possible (which it may or may not be). As a side note, this is likely the wrong list for such a q

Re: NSWindowController, owner, "primary window"...

2008-08-20 Thread Gerd Knops
On Aug 20, 2008, at 1:57 PM, Ken Thomases wrote: On Aug 20, 2008, at 1:39 PM, Gerd Knops wrote: I have a NSWindowController subclass managing a window and some functionality in that window. Now at some point I need to display a sheet, which is a window in a different nib. I'd like to use

Re: NSWindowController, owner, "primary window"...

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 1:39 PM, Gerd Knops wrote: I have a NSWindowController subclass managing a window and some functionality in that window. Now at some point I need to display a sheet, which is a window in a different nib. I'd like to use another NSWindowController to load that nib file,

Animation curve is always linear though specified to be S-like

2008-08-20 Thread Oleg Krupnov
The problem is that my animation always seems to perform linearly, not S-like, although I specify it to do the latter. Here's my code: @interface MyAnimation : NSAnimation { } ... @end @implementation MyAnimation - (id)init { self = [super initWithDuration:0.1F animationCurve:NSAnimationEas

Re: Tiger Compatible OpenGL Screenshot Code

2008-08-20 Thread Jean-Daniel Dupas
Le 20 août 08 à 19:54, David Duncan a écrit : On Aug 20, 2008, at 10:39 AM, Eric Hoaglin wrote: http://developer.apple.com/samplecode/OpenGLScreenSnapshot/index.html (Leopard+) The basic technique from this sample should work on 10.4 (the previous version of this sample did) but it wasn'

NSWindowController, owner, "primary window"...

2008-08-20 Thread Gerd Knops
I have a NSWindowController subclass managing a window and some functionality in that window. Now at some point I need to display a sheet, which is a window in a different nib. I'd like to use another NSWindowController to load that nib file, mainly so it will take care of (eg release) all

Re: Best Way to Handle Properties?

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 12:42 PM, Dave wrote: On Aug 20, 2008, at 6:05 AM, Dave wrote: -(void) setFirstName:(NSString*)theNewValue { if (FirstName != theNewValue) FirstName = [theNewValue copy]; } The reason I did it like this in that case is that I copied and pasted one template for

Re: Core Data Versioning - more than two versions, how to map upgrades?

2008-08-20 Thread Adam Swift
On Aug 12, 2008, at 7:38 PM, Graham Perks wrote: I have model versions 1, 2, and 3, 3 being the latest. Obviously I need a mapping file to upgrade 2 -> 3. But for upgrades of v1, should the mapping file be 1 -> 3 direct, or 1 -> 2 and Core Data will do a two-step upgrade? Creating a mappi

Re: passing an object between views

2008-08-20 Thread I. Savant
If I understand your question, it appears the concept you're missing is the Model-View-Controller (MVC) design pattern around which Cocoa is heavily designed. The controller should be where your XML (which belongs to the model layer) is generated. The controller would conceptually have an outlet

[Q] Using SFAuthorizationView in a Preference Pane project

2008-08-20 Thread JongAm Park
How are you doing? I write a sample preference pane in which there are a few text fields and check boxes. They are organized as two groups: one for system-wide setting, and the other for a user-specific setting. I use the SFAuthorizationView for restricting users to access a system-wide sett

Re: Tiger Compatible OpenGL Screenshot Code

2008-08-20 Thread David Duncan
On Aug 20, 2008, at 10:39 AM, Eric Hoaglin wrote: http://developer.apple.com/samplecode/OpenGLScreenSnapshot/index.html (Leopard+) The basic technique from this sample should work on 10.4 (the previous version of this sample did) but it wasn't qualified against 10.4 for the latest release

Re: Simple NSView Question

2008-08-20 Thread Justin Giboney
Thanks for the help. For some reason I pulled a custom view onto the screen and also pulled an object over to the file (instantiating an object). I connected the outlet to that instead of the view in the window. I don't know what I was thinking. Works well now. Thanks Justin Giboney On Au

Re: passing an object between views

2008-08-20 Thread John Greene
Ah, reasonably better! Now I have: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(dvController == nil) { theaterDetailController *aController = [[theaterDetailController alloc] initWithNibName:@"th

Re: Simple NSView Question

2008-08-20 Thread Andy Lee
On Aug 20, 2008, at 12:12 PM, Justin Giboney wrote: - (void)addLabelWithText:(NSString *)text { NSTextField *newTextField = [[NSTextField alloc] initWithFrame:NSMakeRect(5,5,17,50)]; [newTextField setStringValue:text]; [self addSubview: newTextField]; //[self setNeedsDisplay:YES];

Re: Best Way to Handle Properties?

2008-08-20 Thread Dave
On 20 Aug 2008, at 17:25, Ken Thomases wrote: On Aug 20, 2008, at 8:59 AM, Dave wrote: On 20 Aug 2008, at 13:30, Ken Thomases wrote: On Aug 20, 2008, at 6:05 AM, Dave wrote: This makes memory management awkward. This code is creating an object using alloc, so it's responsible for releas

  1   2   >