Re: From JavaMail to Cocoa?

2008-08-20 Thread Christophe Bismuth
Ok, thank you Scott.I'll try to reuse my Java code to get it works with a Cocoa GUI. Chris 2008/8/20 Scott Anguish [EMAIL PROTECTED] On 19-Aug-08, at 4:29 PM, Christophe Bismuth wrote: Dear community, I've developed a Java application using JavaMail library to get my Gmail messages using

Re: From JavaMail to Cocoa?

2008-08-20 Thread Scott Anguish
I should also mention that this is truly worthy of filing an enhancement bug. On 20-Aug-08, at 2:53 AM, Christophe Bismuth wrote: Ok, thank you Scott.I'll try to reuse my Java code to get it works with a Cocoa GUI. Chris 2008/8/20 Scott Anguish [EMAIL PROTECTED] On 19-Aug-08, at 4:29

NSCollectionView keyloop broken, is there a workaround?

2008-08-20 Thread Markus Spoettl
Hi List, I've asked this questions a couple of months back but never got a response. I'm bringing this up again in the hope that meanwhile someone else has figured out a workaround for the problem. Which is this: NSCollectionView (new in 10.5) is broken with respect to the window

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Ken Ferry
On Tue, Aug 19, 2008 at 8:51 PM, Dave Dribin [EMAIL PROTECTED] 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

Re: Calling an object from a C function

2008-08-20 Thread Antonio Nunes
On 20 Aug 2008, at 01:06, Charlie Dickman wrote: Now, how do I define things like 'self' and 'super' to a C program? Put like this the question doesn't make sense. But maybe this is useful: If you have a C function that _conceptually_ is part of an object and that needs to access 'self'

Re: This document's file has been changed by another application?

2008-08-20 Thread Chris Idou
Are you actually saving the contents of the document to a file inside the package? There is a complex arrangement of files inside the directory, some of which will get updated when saving. Try to get the document's fileURL and check if it is the same for the first and subsequent save

Re: Calling an object from a C function

2008-08-20 Thread Ken Thomases
On Aug 20, 2008, at 4:21 AM, Antonio Nunes wrote: I don't know how this would scale to 'super'. I don't think you can pass in a pointer to super, as that is not how the mechanism works. While self is a variable name super is a flag to the compiler telling it where to begin searching for

Re: Best Way to Handle Properties?

2008-08-20 Thread Dave
Hi All, Thanks a lot all who replied! I understand the point about using lowercase characters to start the member names, e.g. FirstName -- firstName, I am in the process of changing this now. I have a couple more questions: This makes memory management awkward. This code is creating an

Re: Calling an object from a C function

2008-08-20 Thread Antonio Nunes
On 20 Aug 2008, at 11:16, Ken Thomases wrote: Well, you can try to achieve this result with the Objective-C runtime. The better approach would be to have the C function be a very simple wrapper around an Objective-C method (as you illustrated) and then have that method invoke 'super' if

Re: This document's file has been changed by another application?

2008-08-20 Thread I. Savant
On Aug 20, 2008, at 5:31 AM, Chris Idou wrote: Are you actually saving the contents of the document to a file inside the package? There is a complex arrangement of files inside the directory, some of which will get updated when saving. One of my older applications takes a package-based

Re: best way to determine if portion of window is visible?

2008-08-20 Thread Negm-Awad Amin
Am Di,19.08.2008 um 18:13 schrieb Jason Bobier: Hi Amin, Unless I am misunderstanding, this would tell me if it was onscreen, but not if the window was exposed (not hidden by other windows). Ah, probably I misunderstood you. Cheers, Amin Jason On Aug 15, 2008, at 5:03 PM, [EMAIL

Re: How to reference a NSDocument from a NSView?

2008-08-20 Thread Negm-Awad Amin
Am Di,19.08.2008 um 20:46 schrieb Scott Anguish: On 19-Aug-08, at 12:52 PM, Jeff Mesnil wrote: On Tue, Aug 19, 2008 at 1:37 PM, Jeff Mesnil [EMAIL PROTECTED] wrote: The application is behaving as expected, the model (the ovals) are kept in MyDocument and the DrawView just draws them. But

Re: Best Way to Handle Properties?

2008-08-20 Thread Ken Thomases
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 releasing it. However, you're not keeping a pointer to the new string you've created. You're just passing it to the PersonDetails object

How do I register a cocoa bundle identifier?

2008-08-20 Thread Jules Colding
Hi, I have this cocoa bundle which contains an executable (a shell tool) in the Contents/MacOS directory. I would like to register to bundle so that I can execute the contained program with open -b com. 42tools.julia.backend from the terminal. I've tried using LSRegisterFSRef() with

Re: Right place to unobserve notifications in a document

2008-08-20 Thread Joan Lluch (casa)
Am Mo,18.08.2008 um 20:14 schrieb Andy Lee: Since the observed object (maybe notification center) will still hold a reference to the observing object, there is a problem. The *observer* will not be freed, if the observed is still living. Obviously you have a problem using GC, for

Re: Best Way to Handle Properties?

2008-08-20 Thread Dave
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 releasing it. However, you're not keeping a pointer to the new string you've created.

Re: Right place to unobserve notifications in a document

2008-08-20 Thread Negm-Awad Amin
Am Mi,20.08.2008 um 15:37 schrieb Joan Lluch (casa): Am Mo,18.08.2008 um 20:14 schrieb Andy Lee: Since the observed object (maybe notification center) will still hold a reference to the observing object, there is a problem. The *observer* will not be freed, if the observed is still

Re: Best Way to Handle Properties?

2008-08-20 Thread Negm-Awad Amin
Am Mi,20.08.2008 um 15:59 schrieb Dave: On 20 Aug 2008, at 13:30, Ken Thomases wrote: On Aug 20, 2008, at 6:05 AM, Dave wrote: […] Firstly in the real code there is a PersonDataValid flag so I can tell if it's a good Person or not, secondly, unless I put a whole load of logic in

NSView confusion

2008-08-20 Thread Charlie Dickman
Nobody has anything to offer other than a nebulous try changing the declarations? I have tried everything I can think of and have tried the documentation I can find and I still can not figure out what is going on or what to do about it. I have an app that contains multiple NSView's which

Re: Right place to unobserve notifications in a document

2008-08-20 Thread Joan Lluch (casa)
Joan Lluch El 20/08/2008, a las 16:05, Negm-Awad Amin escribió: Am Mi,20.08.2008 um 15:37 schrieb Joan Lluch (casa): I've been reading this thread and I don't understand it in the case of GC. Why don't you still have to remove the observer from the notification center when you are

Re: NSView confusion

2008-08-20 Thread Joseph Kelly
On Aug 20, 2008, at 7:25 AM, Charlie Dickman wrote: I have an app that contains multiple NSView's which are all visible at the same time. They are all sub-classes of NSView but not of any of the others. Each has its initialize, initWithRect and drawRect methods invoked as it should.

Outlet Initialization Uses Accessors

2008-08-20 Thread Gordon Apple
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 code. Ok, maybe everybody but me already knew that,

Re: best way to determine if portion of window is visible?

2008-08-20 Thread Shawn Erickson
On Tue, Aug 19, 2008 at 9:13 AM, Jason Bobier [EMAIL PROTECTED] wrote: Hi Amin, Unless I am misunderstanding, this would tell me if it was onscreen, but not if the window was exposed (not hidden by other windows). What he suggested is basically what you need with the modification of asking

Re: Right place to unobserve notifications in a document

2008-08-20 Thread Negm-Awad Amin
Am Mi,20.08.2008 um 16:58 schrieb Joan Lluch (casa): Joan Lluch El 20/08/2008, a las 16:05, Negm-Awad Amin escribió: Am Mi,20.08.2008 um 15:37 schrieb Joan Lluch (casa): I've been reading this thread and I don't understand it in the case of GC. Why don't you still have to remove the

Re: Right place to unobserve notifications in a document

2008-08-20 Thread Michael Ash
On Wed, Aug 20, 2008 at 9:37 AM, Joan Lluch (casa) [EMAIL PROTECTED] wrote: Am Mo,18.08.2008 um 20:14 schrieb Andy Lee: Since the observed object (maybe notification center) will still hold a reference to the observing object, there is a problem. The *observer* will not be freed, if the

Re: NSView confusion

2008-08-20 Thread Andy Lee
On Aug 20, 2008, at 10:25 AM, Charlie Dickman wrote: Nobody has anything to offer other than a nebulous try changing the declarations? What's nebulous about that? It sounds like you are getting compiler warnings that you can get rid of by using more specific declarations for your view

Re: NSView confusion

2008-08-20 Thread Charlie Dickman
On Aug 20, 2008, at 11:08 AM, Joseph Kelly wrote: On Aug 20, 2008, at 7:25 AM, Charlie Dickman wrote: I have an app that contains multiple NSView's which are all visible at the same time. They are all sub-classes of NSView but not of any of the others. Each has its initialize,

Re: NSView confusion

2008-08-20 Thread Randall Meadows
On Aug 20, 2008, at 8:25 AM, Charlie Dickman wrote: Nobody has anything to offer other than a nebulous try changing the declarations? [snip] Thanks for any help you can provide. Perhaps you need to post some code so we can see what you're really doing.

Re: NSView confusion

2008-08-20 Thread Negm-Awad Amin
Am Mi,20.08.2008 um 16:25 schrieb Charlie Dickman: Nobody has anything to offer other than a nebulous try changing the declarations? I have tried everything I can think of and have tried the documentation I can find and I still can not figure out what is going on or what to do about it.

Re: NSView confusion

2008-08-20 Thread Joseph Kelly
On Aug 20, 2008, at 8:19 AM, Charlie Dickman wrote: view is an NSView and method is not spelled wrong. As I said, I can call it just fine with [view performSelector at run-time. And the method you are calling is declared in NSView.h? If the method is your own method declared in a subclass,

Embed some NSControl in the NSTableView field?

2008-08-20 Thread Leopard x86
Hi everyone. Maybe this idea is rather crazy, I do want to know whether it is practicable or not. The NSTableView is essentially a table to the end user. For example, your application may seem like the following: Tableheader1Tableheader2 MyVolumeValue =

Simple NSView Question

2008-08-20 Thread Justin Giboney
I think that I am really close to this... but I can't find the next step. I am trying to build a view programatically after the application has launched. So I have a custom view that has one method: - (void)addLabelWithText:(NSString *)text { NSTextField *newTextField = [[NSTextField

Modifying TextEdit.app

2008-08-20 Thread R.L. Grigg
Im more or less a Cocoa newb and building and modifying the TextEdit example has been very helpful. I ve modified it so it can do some simple things like having adjustable margins instead of the fixed 1 margins, etc. So far so good. Now I want to modify TextEdit so I can display the

Re: Best Way to Handle Properties?

2008-08-20 Thread Ken Thomases
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 releasing it. However, you're not keeping a pointer

Re: Modifying TextEdit.app

2008-08-20 Thread Andy Lee
Sounds like TextEdit is an NSDocument-based app. I'm not familiar with those, but I see NSDocument has a -displayName method whose documentation says: If the document has been saved, the display name is the last component of the directory location of the saved file (for example,

Re: passing an object between views

2008-08-20 Thread John Greene
Graham Cox wrote: On 20 Aug 2008, at 10:31 am, John Greene wrote: I had originally thought that I could just write a method, setTableData in the secondary controller, that takes an object as an argument, and then use that object to build the secondary table. This is apparently forbidden by

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Corbin Dunn
Yup, Ken hits the target dead on; it sounds like it is simply due to the cell not having the binding. But please do log a bug requesting this for bindings. Also, thank you for logging the other bug -- I routed it to IB. corbin On Aug 20, 2008, at 1:35 AM, Ken Ferry wrote: On Tue, Aug 19,

Re: Embed some NSControl in the NSTableView field?

2008-08-20 Thread Corbin Dunn
On Aug 20, 2008, at 3:33 PM, Leopard x86 wrote: Hi everyone. Maybe this idea is rather crazy, I do want to know whether it is practicable or not. The NSTableView is essentially a table to the end user. For example, your application may seem like the following: Tableheader1

mouseMoved events and unfocused views

2008-08-20 Thread Ruotger Skupin
Hi, is there a way to get mouseMoved events in a view without it being the focused view (and without getting the focus, of course)? Thanks Ruotger ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Simple NSView Question

2008-08-20 Thread Justin Giboney
I just noticed something. If I put NSLog(@%@, [self subviews]); into the drawRect: method, I get the following out put right after the app loads 2008-08-20 11:04:21.059 ViewApp[35666:10b] ( NSTextField: 0x13b770 ) 2008-08-20 11:04:21.076

Re: mouseMoved events and unfocused views

2008-08-20 Thread Quincey Morris
On Aug 20, 2008, at 10:01, Ruotger Skupin wrote: is there a way to get mouseMoved events in a view without it being the focused view (and without getting the focus, of course)? If you're using Leopard, you can use a NSTrackingArea with the NSTrackingActiveAlways option.

Re: Simple NSView Question

2008-08-20 Thread Andy Lee
On Aug 20, 2008, at 12:12 PM, Justin Giboney wrote: I think that I am really close to this... but I can't find the next step. I am trying to build a view programatically after the application has launched. So I have a custom view that has one method: - (void)addLabelWithText:(NSString

Re: mouseMoved events and unfocused views

2008-08-20 Thread Markus Spoettl
On Aug 20, 2008, at 10:01 AM, Ruotger Skupin wrote: is there a way to get mouseMoved events in a view without it being the focused view (and without getting the focus, of course)? Yes, have a look at the tracking area options (tracking areas are new in 10.5)

Re: passing an object between views

2008-08-20 Thread Michael Ash
On Wed, Aug 20, 2008 at 12:47 PM, John Greene [EMAIL PROTECTED] wrote: I've tried a couple of things to make the object available to theaterDetailController with no success: * Creating a method: -(void)setTableData:(NSDictionary)myTheater {

Re: Modifying TextEdit.app

2008-08-20 Thread Sherm Pendley
On Wed, Aug 20, 2008 at 12:13 PM, R.L. Grigg [EMAIL PROTECTED] wrote: Now I want to modify TextEdit so I can display the filenames full path in the title bar of the document window instead of just the filename.ext (because sometimes I have more than 1 version of a file up and its easy to

Re: Simple NSView Question

2008-08-20 Thread Justin Giboney
Here are my comments: If I add the code above into the drawRect: method, it works just fine. Technical questions would be so much clearer if we could remove works and doesn't work from the English language. :) By works do you mean it compiles? It runs without crashing? By works I

MacBook Wake On Lan

2008-08-20 Thread sheen mac
Hi All, I tried to wake Mac Book ( Its lid closed ) by sending Magic Packets. Its wake up after a few seconds . But it again again went to sleep after that. I tried to load Insomnia.kext after the wake ( lid closed at this time ) . The kext loaded successfully. But it has no effect.I tried to

Tiger Compatible OpenGL Screenshot Code

2008-08-20 Thread Eric Hoaglin
Hello All, I was testing an app I've been working on a for a while and found that it doesn't work with OpenGL and taking a screenshot. Some details of the app are, it loads a specific website and loads a java applet that uses OpenGL to render stuff, but my screenshot feature doesn't work (the

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

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

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]

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

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

[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

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

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 mapping

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

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

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

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,

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

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

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)

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

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 using

[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

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

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

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

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

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,

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

!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 ___

Re: !foo vs foo == nil

2008-08-20 Thread mm w
#include stdio.h #include stdlib.h 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

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

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 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 is not

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

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

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) {

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

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 2008, at

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 and no one

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

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

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 it

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 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 really is

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

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 you

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 stdio.h #include stdlib.h int main(void) { char *p1; char *p2 = NULL; free(p1); free(p2); return 0; } On Wed, Aug 20, 2008 at 4:57

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

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 related

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% identical as far as

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 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 stdio.h #include stdlib.h int main(void) { char *p1; char *p2 = NULL; free(p1); free(p2);

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

  1   2   >