Re: retaining and releasing a Window Controller.

2010-08-09 Thread Negm-Awad Amin
That one, who creates the WC is the owner (probably the App-Delegate or a document). It should retain the WC. The WC can send a message to the owner, when its window is closed. (And the owner probably wants to autorelease the WC in this case.) Problem: When the WC is released by its owner after

Re: Autorelease pool

2009-10-08 Thread Negm-Awad Amin
Am Do.,08.10.2009 um 16:36 schrieb Michael Süssner: Hi , thanks a lot for your tips. after having read the bible and some experiments I have learned how to do it correctly. Here the conclusion for the rest of the world: NSMutableArray *vPolyArray = [[NSMutableArray alloc] initWithCapaci

Re: Design pattern for "per-document" settings

2009-08-03 Thread Negm-Awad Amin
Am Mo,03.08.2009 um 02:18 schrieb Graham Cox: Hi all, I'm just thinking through a couple of problems and wondered if anyone had anything to say about it... In my app I have several things that apply on a "per document" level, for example, the mapping from Quartz co-ordinate values to s

Re: How to show Interface Builder's build warning and messages?

2008-10-31 Thread Negm-Awad Amin
In many cases this are no warnings but "notices". You can switch them off in Xcode, if you want to: http://www.cocoading.de/webspace/IBC%20Notices.tiff Cheers Am Mi,29.10.2008 um 08:39 schrieb Oleg Krupnov: Recently I was building my project and saw there were some warnings and messages rega

Re: Customizing controls: Inheritance bad?

2008-10-31 Thread Negm-Awad Amin
Am Do,30.10.2008 um 16:51 schrieb Brian Williams: Hello, I'm brand new to Cocoa/Obj-C and I'm working on converting an app. to use Cocoa... I've heard that, in general, if you are using inheritance in Cocoa, you're not following the typical standard design pattern. Is this true?

Re: [MEET] CocoaHeads Mac Developer Meetings

2008-10-30 Thread Negm-Awad Amin
Am Mi,29.10.2008 um 23:29 schrieb Stephen Zyszkiewicz: Greetings, CocoaHeads is an international Mac programmer's group. We specialize in Cocoa, but everything Mac programming related is welcome. Why Should I Attend? Meeting other Mac OS X developers in person is both fun and immensely usefu

Re: NSCoding protocol

2008-10-10 Thread Negm-Awad Amin
Am Fr,10.10.2008 um 18:17 schrieb Clark Cox: On Fri, Oct 10, 2008 at 9:09 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]: I want MyClass to conform to the NSCoding protocol. But I'm puzzled about how to implement the in

Re: NSCoding protocol

2008-10-10 Thread Negm-Awad Amin
Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]: I want MyClass to conform to the NSCoding protocol. But I'm puzzled about how to implement the initWithCoder: method. Suppose I have this in MyClass.h: NSString *S1, *S2, *S3; and this in its init function: S1 = @"a str

Re: Finder Crashes on File Open

2008-10-10 Thread Negm-Awad Amin
Am Do,09.10.2008 um 19:47 schrieb Brian Miller: Hi All, I have a Cocoa Core Data Document based application. When files created with this application are opened via the Finder (or double clicked), the Finder crashes and restarts every time. Opening files from within the application wor

Re: Newb Question about Delegtes and callbacks

2008-10-09 Thread Negm-Awad Amin
Am Do,09.10.2008 um 07:26 schrieb Ron Green: Somehow in my education I missed out on delegates and callbacks. Can someone point me to a really good explanation that even a dummy like me can understand? http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingW

Re: Just when I thought I understood bindings.

2008-10-09 Thread Negm-Awad Amin
Am Do,09.10.2008 um 02:46 schrieb Tim Isted: Did you setup the bindings using Interface Builder or programatically? If programatically, they work in only one direction so you need to call [object1 bind:@"value" toObject:object2 withKeyPath:@"whateverPathForKeyIs" options:nil]; and [obj

Re: In dealloc(): ref @property, Can I use " = nil; " vs "[ release]; " ?

2008-10-08 Thread Negm-Awad Amin
Am Mi,08.10.2008 um 18:09 schrieb Lee, Frederick: I've been setting my property thusly: @property (nonatomic, retain) myVar; ...what about: @property (nonatomic, copy) myVar; ? In this case (deallocation) it doesn't matter, because you set nil. [nil copy] is nil. Cheers Ric.

Re: In dealloc(): ref @property, Can I use " = nil; " vs "[ release]; " ?

2008-10-08 Thread Negm-Awad Amin
Am Mi,08.10.2008 um 17:49 schrieb Lee, Frederick: Assuming the following: @property(retain) myVar; ... @synthesize myVar; ... -(void) dealloc { // Can I use: self.myVar = nil; // versus: [myVar release]; // ? } I've seen examples of using [myVar release]. But doesn'

Re: Conditional mouseDownCanMoveWindow for NSView?

2008-10-08 Thread Negm-Awad Amin
Am Do,02.10.2008 um 20:15 schrieb Daniel Weber: I have a single nsview that draws the main content area for my application and a bottom statusbar. This was done instead of using two different views so the user can move objects from the statusbar to the main content area, all with core anim

Re: CoreData: Fetching object with maximum of property

2008-10-08 Thread Negm-Awad Amin
Am Mi,08.10.2008 um 05:42 schrieb Bill Dudney: Hi Frank, Sorry for not getting back sooner; http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pBNF.html#/ /apple_ref/doc/uid/TP40001796-217785 documents the BNF which is very cryptic but tells you everything that

Re: CoreData: Fetching object with maximum of property

2008-10-07 Thread Negm-Awad Amin
On Oct 7, 2008, at 2:59 PM, Negm-Awad Amin wrote: In contrast to Bill I think, that this is not possible with predicates. Why? You want to get the maximum value of an attribute. Obviously this task includes the knowledge of all values stored in that attribute. So if Core Data should do

Re: CoreData: Fetching object with maximum of property

2008-10-07 Thread Negm-Awad Amin
Am Di,07.10.2008 um 14:04 schrieb Frank Illenberger: Hi Bill, I tried using predicates for this but did not succeed. What would a predicate look like which finds the object of an entity with the maximum value for a property? In contrast to Bill I think, that this is not possible with predi

Re: comparing Strings.

2008-10-07 Thread Negm-Awad Amin
A littlebit tricky (probably ugly), but shorter: NSArray* components = [source componentsSeperatedByCharactersInSet: [NSCharacterSet …]]; NSString* result = [components componentsJoinedByString:@""]; ;-) Cheers Am Di,07.10.2008 um 11:55 schrieb Graham Cox: On 7 Oct 2008, at 7:46 pm, Ger

Re: NSWindowController retain counts, chapter 2

2008-10-07 Thread Negm-Awad Amin
Am Di,07.10.2008 um 04:56 schrieb James Walker: […] How do you know the window isn't being deallocated? Examining retain counts is not going to tell you whether it is or not. The only way would be to subclass it and log the -dealloc method. That's exactly what I did. The dealloc method w

Re: Collections can be simple Attributes in Core Data

2008-10-07 Thread Negm-Awad Amin
Am Do,02.10.2008 um 00:16 schrieb Jerry Krinock: On 2008 Sep, 30, at 10:58, I. Savant wrote: The 'correct' approach depends entirely on the model. Yes, I appreciated Amin's thoughts but didn't have much to add. An important step in modelling is to draw a potato around the part of the

Re: Collections can be simple Attributes in Core Data

2008-10-07 Thread Negm-Awad Amin
Am Di,30.09.2008 um 19:58 schrieb I. Savant: On Mon, Sep 29, 2008 at 3:03 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: But now I find there is an even more natural way, which is to just leave them as a set or array, and store in an attribute of type Transformable. The d

Re: expanding core data model sheet

2008-10-06 Thread Negm-Awad Amin
Am Mo,06.10.2008 um 16:48 schrieb Daniel Child: Hi All, This strikes me as something that should be absurdly easy to do, but I can't seem to find any examples with more than two or three entities, and so no one mentions it, and I don't see it in the documentation. How do you expand the

Re: Crash with toolbars

2008-10-06 Thread Negm-Awad Amin
Am Mo,06.10.2008 um 12:24 schrieb Felipe Monteiro de Carvalho: BOOLs are signed char. Thanks, the toolbar is working now. Does anyone know where BOOL is declared? objc.h It's a very common word, so it's hard to find ... Command double click on "BOOL". -- Felipe Monteiro de Carvalho

Re: window controllers and managed object contexts

2008-10-06 Thread Negm-Awad Amin
Am Sa,27.09.2008 um 19:01 schrieb Daniel Child: Hmm, well that seems to be the catch. I can't get the bindings to work for the MOC. First off, to set up the table displayed in the window loaded with a separate nib file, I simply dragged in an "entity" object from the Librarian. That doesn'

Re: showing window causes EXC_BAD_ACCESS

2008-09-29 Thread Negm-Awad Amin
Am Sa,27.09.2008 um 22:44 schrieb Uli Kusterer: On 27.09.2008, at 22:13, Michael Ash wrote: But suddenly you're back to having to think about the global picture of who owns objects, which is what Cocoa's memory management system is supposed to avoid. Retains and releases should be balan

Re: Collections can be simple Attributes in Core Data

2008-09-29 Thread Negm-Awad Amin
Am Fr,26.09.2008 um 03:08 schrieb Jerry Krinock: When I first looked at Core Data, I saw that there was no such attribute type as "Array" or "Set", and concluded that collections must be modelled as relationships. This would be overkill in many cases, for example, in a Person type of appl

Re: binding to static text

2008-09-24 Thread Negm-Awad Amin
Am Do,11.09.2008 um 02:38 schrieb James Walker: I have a static text item whose value is bound to an NSUserDefaultsController. It correctly shows the value stored as a default. However, if I programmatically change the text (with - [NSControl setStringValue:]), the new value does not get

Re: Problems with Key Observing Registration Performance

2008-09-10 Thread Negm-Awad Amin
Am Mi,10.09.2008 um 03:48 schrieb Markus Spoettl: On Sep 9, 2008, at 5:28 PM, Markus Spoettl wrote: These numbers come from a test case with 140 objects, when I double the object number, the test never finishes (at least not within 10 minutes). OK, I did some more testing and timing and

Re: Do I Need Multiple NSArrayControllers For This?

2008-09-10 Thread Negm-Awad Amin
Am Di,09.09.2008 um 16:11 schrieb Jamie Phelps: I have a Core Data entity that has a date and relationship. I want to create a label like. "25 Foos (12 New)" A Foo is active if it its relationship is null and it is new if its date is within the startDate and endDate specified by the user.

Re: Best 'native' formats for NSImage and NSSound?

2008-09-09 Thread Negm-Awad Amin
Hi, do you load the image with -imageNamed: and add the suffix? IIRC, this forces NSImage to reload the image file. Did you try to refer to the image without suffx? In this case NSImage looks for a appropiate image in iits image heap and takes this one instead of the file. If it does not

Re: understanding conversions between CF and NS datatypes

2008-09-05 Thread Negm-Awad Amin
Am Do,04.09.2008 um 20:20 schrieb Michael Ash: On Thu, Sep 4, 2008 at 1:40 PM, Negm-Awad Amin [EMAIL PROTECTED]> wrote: Am Do,04.09.2008 um 18:27 schrieb Michael Ash: On Thu, Sep 4, 2008 at 10:41 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Sa,30.08.2008 um 05:22 schrieb Mi

Re: understanding conversions between CF and NS datatypes

2008-09-04 Thread Negm-Awad Amin
Am Do,04.09.2008 um 18:27 schrieb Michael Ash: On Thu, Sep 4, 2008 at 10:41 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Sa,30.08.2008 um 05:22 schrieb Michael Ash: Ultimately the most important thing to understand about toll-free bridging (the link between CF and NS data typ

Re: understanding conversions between CF and NS datatypes

2008-09-04 Thread Negm-Awad Amin
Am Do,04.09.2008 um 16:41 schrieb Negm-Awad Amin: Am Sa,30.08.2008 um 05:22 schrieb Michael Ash: On Fri, Aug 29, 2008 at 1:38 PM, Allen Curtis <[EMAIL PROTECTED]> wrote: 1. Where can I get a better understanding of the data conversion between these different frameworks? 2. Ulti

Re: understanding conversions between CF and NS datatypes

2008-09-04 Thread Negm-Awad Amin
Am Sa,30.08.2008 um 05:22 schrieb Michael Ash: On Fri, Aug 29, 2008 at 1:38 PM, Allen Curtis <[EMAIL PROTECTED]> wrote: 1. Where can I get a better understanding of the data conversion between these different frameworks? 2. Ultimately the device path names will appear in a ComboBox. Was it

Re: Reflexive Many-to-Many in Core Data?

2008-09-03 Thread Negm-Awad Amin
Am Mo,01.09.2008 um 23:16 schrieb Sam Krishna: Is a reflexive many-to-many relationship possible in Core Data? Why not? To try it, simply do: Create an entity Verse. Add two to-many relationships to Verse, say, relatedToVerses and relatedFromVerses. Make them the inverse relationship of ea

Re: How do I use Sort Descriptor binding in IB on my array controller?

2008-09-03 Thread Negm-Awad Amin
Am Sa,30.08.2008 um 16:58 schrieb <[EMAIL PROTECTED]> <[EMAIL PROTECTED] >: I'm struggling with this very problem, can anyone point me in the right direction? Many Thanks Amy You can do it the way Quincey described, but I think that you do not need bindings, because your problem sounds

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Negm-Awad Amin
the custom NSView) and binds it to the model object programmatically. When the model object is changed or removed, its subview counterpart responds correspondingly. In this manner I could hold all the view-specific states and cache data in the subview object. What do you think? On Thu, Aug 28, 2008 at

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Negm-Awad Amin
Am Do,28.08.2008 um 10:15 schrieb Oleg Krupnov: Parts of your first question remind me of a situation that I had. Erik Buck gave me some great advice and part of it was the following: If you are worried about adding drawing code to a "Model" object, add the drawing code in a category of *

Re: Core Data - use of simple accessors vs. KVC

2008-08-27 Thread Negm-Awad Amin
Am Do,28.08.2008 um 06:43 schrieb Caleb Strockbine: On Aug 27, 2008, at 2:43 PM, Negm-Awad Amin and mmalc crawford argued: You can subclass NSManagedObject and add properties using @property and @dynamic, which means, that the accessors will be generated dynamically at run-time. (Without

Re: Core Data - use of simple accessors vs. KVC

2008-08-27 Thread Negm-Awad Amin
Am Mi,27.08.2008 um 19:57 schrieb mmalc crawford: On Aug 27, 2008, at 10:36 AM, Negm-Awad Amin wrote: Am Mi,27.08.2008 um 19:19 schrieb mmalc crawford: On Aug 27, 2008, at 9:48 AM, Negm-Awad Amin wrote: Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov: Suppose I have a Core Data model

Re: Core Data - use of simple accessors vs. KVC

2008-08-27 Thread Negm-Awad Amin
Am Mi,27.08.2008 um 19:19 schrieb mmalc crawford: On Aug 27, 2008, at 9:48 AM, Negm-Awad Amin wrote: Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov: Suppose I have a Core Data model object MyObject with property myProp defined in the model editor's schema. Can I use the simple acce

Re: Core Data - use of simple accessors vs. KVC

2008-08-27 Thread Negm-Awad Amin
Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov: A simple newbie question: Suppose I have a Core Data model object MyObject with property myProp defined in the model editor's schema. Can I use the simple accessors like this: [myObj myProp] [myObj setMyProp] or am I forced to use the rather c

Re: Core Data - use of simple accessors vs. KVC

2008-08-27 Thread Negm-Awad Amin
Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov: A simple newbie question: Suppose I have a Core Data model object MyObject with property myProp defined in the model editor's schema. Can I use the simple accessors like this: [myObj myProp] [myObj setMyProp] or am I forced to use the rather c

Re: Removing Applications from the Dock Programmatically

2008-08-27 Thread Negm-Awad Amin
Am Mi,27.08.2008 um 03:20 schrieb Graff: I forgot to mention that you'll have to force the Dock to re-load its preferences after fooling around like this. I really only know how to do this through the terminal or through AppleScript, although I'm sure there are other ways to do it IIRC, yo

Re: monitoring file system

2008-08-25 Thread Negm-Awad Amin
Am Mo,25.08.2008 um 16:21 schrieb MAnish Billore: Hi, I am developing an image browser in that user can watch photo from chosen directory. In this application I want to give functionality that whenever user add or delete any photo from storage media application should know it. Could any b

Re: How to control the order of enumerating on a NSDictionary

2008-08-25 Thread Negm-Awad Amin
Am Mo,25.08.2008 um 09:40 schrieb Scott Anguish: On 25-Aug-08, at 2:05 AM, Negm-Awad Amin wrote: What an *** … Amin Negm-Awad [EMAIL PROTECTED] while I can fully understand your reaction (and I'm guessing you meant to send this off list) language like this is inappropriate

Re: *** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50

2008-08-25 Thread Negm-Awad Amin
Am Mo,25.08.2008 um 08:45 schrieb Graham Cox: On 25 Aug 2008, at 4:24 pm, Graham Cox wrote: On 25 Aug 2008, at 4:17 pm, Negm-Awad Amin wrote: Don't care about this. IF it is a singleton, retaining is no problem. IF it is NOT, retaining is the right way to handle it. Sure, no pr

Re: *** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50

2008-08-24 Thread Negm-Awad Amin
Am Mo,25.08.2008 um 07:50 schrieb Graham Cox: On 25 Aug 2008, at 11:09 am, Kyle Sluder wrote: On Sun, Aug 24, 2008 at 6:03 PM, Cate Tony <[EMAIL PROTECTED]> wrote: If I put a retain on the panel, the error stops, but isn't it now leaking? No. You took ownership of the NSSavePanel when y

Re: How to control the order of enumerating on a NSDictionary

2008-08-24 Thread Negm-Awad Amin
What an asshole … Amin Negm-Awad [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsu

Re: Core data entity creation design

2008-08-24 Thread Negm-Awad Amin
Am So,24.08.2008 um 18:10 schrieb Quincey Morris: On Aug 24, 2008, at 03:17, Steven Hamilton wrote: I have a Core Data model which contains two entities. I have a tableview with the standard bindings arrangement and Add/Remove buttons handling one of the entities. What I need to achieve is

Re: ObjC 2.0, properties, KVC, special _ hacks etc.

2008-08-24 Thread Negm-Awad Amin
Am So,24.08.2008 um 16:09 schrieb Thomas Engelmeier: Am 24.08.2008 um 05:59 schrieb John C. Randolph: On Aug 21, 2008, at 7:59 PM, Thomas Engelmeier wrote: Am 22.08.2008 um 00:59 schrieb Dave MacLachlan: Also, are the _ in front of member variables for Apple only (so we don't stomp on

Re: ObjC 2.0, properties, KVC, special _ hacks etc.

2008-08-24 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 04:59 schrieb Thomas Engelmeier: Am 22.08.2008 um 00:59 schrieb Dave MacLachlan: Also, are the _ in front of member variables for Apple only (so we don't stomp on each other with member var names) or are they using them for the readability reason mentioned above? There

Re: Tabbed preference panels

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 18:29 schrieb Sumner Trammell: Hi, I'm working on a preferences panel. I want to build a compound panel like the kind seen in most mainstream apps today: a toolbar on top with "tabbed" view switching. The panel changes its appearance depending on which 32x32 toolbar icon you

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 16:15 schrieb Graham Cox: On 23 Aug 2008, at 12:04 am, Negm-Awad Amin wrote: This is what a analog PLL do, when it loads/unloads a ramp. Analogue PLL design (Audio to GHz RF) were my bread-and-butter for many years, so do be careful not to teach your granny to suck

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Sorry for sending the responds solely to Graham: Am Fr,22.08.2008 um 15:53 schrieb Graham Cox: On 22 Aug 2008, at 11:39 pm, Negm-Awad Amin wrote: I think, that a higher event-frequency is not neccessary. He should use an interval of close to one second (something like 0.99 seconds). In

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 16:00 schrieb Graham Cox: On 22 Aug 2008, at 11:54 pm, Negm-Awad Amin wrote: This is not ugly, but the starting point for a software PLL. Well, there's no "loop" to phase lock here. This was the reason for me, to write: "starting point".

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:52 schrieb Thomas Davie: On 22 Aug 2008, at 15:47, Negm-Awad Amin wrote: Am Fr,22.08.2008 um 15:45 schrieb Thomas Davie: Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highes

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:45 schrieb Thomas Davie: Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highest "event" frequency. You might want to go a bit faster and maybe at a slightly odd multiple of one second to make

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:28 schrieb Graham Cox: On 22 Aug 2008, at 10:55 pm, Ron Fleckner wrote: Sorry, my question was very badly put. I've already apologised to two other answerers. I should have said: Is there a better way - other than using an NSTimer - to update the clock? That is,

Re: !foo vs foo == nil

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 19:54 schrieb Michael Ash: On Thu, Aug 21, 2008 at 10:40 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Do,21.08.2008 um 16:15 schrieb Michael Ash: On Thu, Aug 21, 2008 at 6:47 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Do,21.08.2008 um 12:25 sc

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

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 19:24 schrieb j o a r: On Aug 21, 2008, at 10:12 AM, Negm-Awad Amin wrote: Probably because the GoF prefers combination over (?) subclassing. Subclassing always discloses parts of the implementation of a class. ("white-boxing") So generally it is a good ide

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

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 06:10 schrieb 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

Re: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 17:03 schrieb Oleg Krupnov: Amin, It is true that I am new to Cocoa, and although I find the documentation really great and engaging, I have sort of difficulty figuring out what technology is newer/more powerful/built on top of/ other technology. In particular, would you e

Re: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 16:41 schrieb Oleg Krupnov: Thanks Amin for responding. You are correct that there's no need to reinvent the wheel, and that's exactly what I'd like to avoid, that's why I am now re-reading about KVC/KVO and reconsidering it. So, does everybody really always use KVC/KVO fo

Re: !foo vs foo == nil

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 16:15 schrieb Michael Ash: On Thu, Aug 21, 2008 at 6:47 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Am Do,21.08.2008 um 12:25 schrieb Thomas Engelmeier: Am 21.08.2008 um 11:04 schrieb Negm-Awad Amin: Sometimes you see in source code something like th

Re: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 15:22 schrieb Oleg Krupnov: I suspect that it could be way easier, when a property's value changes, to just explicitly send a concise and clearly named message to the subscribed objects, This is, what is done. The name of the message is -observeValueForKeyPath:ofObject:cha

Re: !foo vs foo == nil

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 12:25 schrieb Thomas Engelmeier: Am 21.08.2008 um 11:04 schrieb Negm-Awad Amin: Sometimes you see in source code something like this: if( booleanVarOrExpression == YES ) (I think, Rentzsch does it that way, IIRC) and Ithink, that this is simply correct. Oh, that is

Re: !foo vs foo == nil

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 10:47 schrieb Thomas Engelmeier: Am 21.08.2008 um 05:03 schrieb Michael Ash: 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)

Re: IB displays a non-outlet (Bug or feature?)

2008-08-21 Thread Negm-Awad Amin
! Amin On Aug 21, 2008, at 12:01 AM, Negm-Awad Amin [EMAIL PROTECTED]> wrote: Hi before I report this, I want to check, whether I misunderstood something. I've a window controller subclass with three outlets. Additional the class owns to ivars, one of them typed id. These ivar

Re: !foo vs foo == nil

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 09:54 schrieb Jules Colding: On 21/08/2008, at 09.21, Thomas Davie wrote: On 21 Aug 2008, at 09:06, Jules Colding wrote: On 21/08/2008, at 01.56, John C. Randolph wrote: On Aug 20, 2008, at 4:15 PM, Torsten Curdt wrote: There was a common perception that NULL is

Re: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread Negm-Awad Amin
Am Do,21.08.2008 um 08:58 schrieb 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/

IB displays a non-outlet (Bug or feature?)

2008-08-21 Thread Negm-Awad Amin
Hi before I report this, I want to check, whether I misunderstood something. I've a window controller subclass with three outlets. Additional the class owns to ivars, one of them typed id. These ivars are not marked as outlet. @interface GroupsWC : NSWindowController { IBOutlet NSArr

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

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

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 l

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

Re: Hex representation of NSString

2008-08-19 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 19:15 schrieb Charles Srstka: On Aug 18, 2008, at 6:18 AM, Robert Černý wrote: Actually,I'm trying to debug some weird problems with clipboard. My problem is that data copied into clipboard from legacy java application doesn't match data pasted into Cocoa application.

Re: Question about respondsToSelector

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 20:17 schrieb Carmen Cerino Jr.: Does the id type have enough information for the respondsToSelector method to work. I have a class with an ivar of type id, and when I invoke the respondsToSelector method it fails when it should succeed. I am assuming it should work fin

Re: Right place to unobserve notifications in a document

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 20:14 schrieb Andy Lee: On Aug 18, 2008, at 12:49 PM, Negm-Awad Amin wrote: Am Mo,18.08.2008 um 18:18 schrieb Andy Lee: -- but in this case I think -dealloc is not only okay, but sometimes the only correct place to unregister a notification. Suppose an invariant of

Re: Right place to unobserve notifications in a document

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 18:57 schrieb Michael Ash: On Mon, Aug 18, 2008 at 11:51 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: But anyway I do not think, that doing something else then memory management in -dealloc is good design. Normally I unregister observation in delegate method

Re: Right place to unobserve notifications in a document

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 18:18 schrieb Andy Lee: On Aug 18, 2008, at 11:51 AM, Negm-Awad Amin wrote: But anyway I do not think, that doing something else then memory management in -dealloc is good design. Normally I unregister observation in delegate methods like -applicationWillTerminate:. I

Re: Right place to unobserve notifications in a document

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 17:37 schrieb Michael Ash: On Mon, Aug 18, 2008 at 5:59 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: Hi, for some teaching reasons I have a document class, which observes a notification. Of course I have to unobserve this notification, when the document is

Re: Changing NSTextFieldCells' editing appearance?

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 17:00 schrieb Tim Andersson: 18 aug 2008 kl. 10.15 skrev Negm-Awad Amin: No, I speak english badly enough to misunderstand this. :-) I'm sorry if I made it sound like a "insult" - That wasn't my intention. No, my fault. The behaviour of an NS

Re: Hex representation of NSString

2008-08-18 Thread Negm-Awad Amin
in the examples, which lets you inspect the raw data. Maybe this helps to find the problem. Cheers, Amin Robert 2008/8/18 Negm-Awad Amin <[EMAIL PROTECTED]> Am Mo,18.08.2008 um 12:40 schrieb Robert Černý: I don't like it because the string will be converted. I'm interested

Re: Hex representation of NSString

2008-08-18 Thread Negm-Awad Amin
ave to subclass it or doing some undocumentated stuff. Cheers, Amin and even allowLossyConversion:NO doesn't guarantee it. Or am I wrong? Robert 2008/8/18 Negm-Awad Amin <[EMAIL PROTECTED]> Am Mo,18.08.2008 um 12:21 schrieb Robert Černý: Hi,I'm trying to find a way how to

Re: Hex representation of NSString

2008-08-18 Thread Negm-Awad Amin
Am Mo,18.08.2008 um 12:21 schrieb Robert Černý: Hi,I'm trying to find a way how to get hex representation of NSString. I know I can convert NSString to NSData but I would like to rather not to do it. Or am I missing anything obvious? Maybe: Do it this way. Why don't you like it? Cheers,

Right place to unobserve notifications in a document

2008-08-18 Thread Negm-Awad Amin
Hi, for some teaching reasons I have a document class, which observes a notification. Of course I have to unobserve this notification, when the document is closed. Doing this in -dealloc is no good design (fuunctional overhead in -dealloc, garbage collection …). But I read in the document

Re: NSUInteger hash

2008-08-18 Thread Negm-Awad Amin
Hi Steve, Am So,17.08.2008 um 18:43 schrieb Steve Wart: Hi Aaron, That's always a good question to ask. I'm porting a Smalltalk/OpenGL maze application I wrote a few years ago to Cocoa. The maze is initialized by creating a 2D matrix of Room objects which are separated by Wall objects.

Re: Changing NSTextFieldCells' editing appearance?

2008-08-18 Thread Negm-Awad Amin
Am Fr,15.08.2008 um 19:41 schrieb [EMAIL PROTECTED]: -setBackgroundColor: didn't work? Nope, it didn't. But even if it would've, the background would have been visible at all times. I'm sorry if I didn't write clearly enough, No, I speak english badly enough to misunderstand this. :-)

Re: NSOutlineView

2008-08-18 Thread Negm-Awad Amin
Hi, do you want to display all three items (triangle, icon, text) in one column? Than you need an ImageAndTextCell. Browse your examples folder to get it. Amin Am Mo,18.08.2008 um 08:38 schrieb [EMAIL PROTECTED]: Hi all I'm new to cocoa. I want to display the outline view item by a dis

Re: Binding NSButton state to an NSMutableArray inside an NSMutableArray

2008-08-18 Thread Negm-Awad Amin
Hi you did a part of the work. Using a second array controller is correct, because you have a second array. What you need is a UI, that depends on the number and content of the items contained in the second array. There are two views, that provide this: NSTableView and – I think this is t

Re: Changing NSTextFieldCells' editing appearance?

2008-08-15 Thread Negm-Awad Amin
Am Fr,15.08.2008 um 18:02 schrieb Tim Andersson: Hi there, I have a few questions about changing the way my NSTextFieldCells look while they are being edited. First off, when editing my cell, the cell's background-color changes to black (As such: http://img170.imageshack.us/img170/4610/bil

Re: Making a bound view re-read its value

2008-08-15 Thread Negm-Awad Amin
Hi, Am Fr,15.08.2008 um 00:21 schrieb Markus Spoettl: Hi List, how can I make a view value which is bound to a property manually re-read (or update) the value it displays? The simplified setup is this: I have an object, that stores its values (say a temperature) in Celcius. I also have

Re: CoreData, Object/Array Controllers and KVO

2008-08-15 Thread Negm-Awad Amin
Am Do,14.08.2008 um 07:46 schrieb Jeff Hellman: Hi Folks- Hi as already said, KVO is not the right place to do that. If this is a real important property, you should think about a model user interface (update button, sheet) to handle it. You can use notifications or maybe "bindings throu

Re: Should I retain a variable returned from this accessor?

2008-08-13 Thread Negm-Awad Amin
Am Di,12.08.2008 um 21:36 schrieb Shawn Erickson: On Tue, Aug 12, 2008 at 2:12 AM, Negm-Awad Amin <[EMAIL PROTECTED] > wrote: BTW: You can do the same inside a getter to get rid of thread problems. Nope it does nothing to solve threading issues ([[blah retain] autorelease] is

Re: Accessing memory of another application?

2008-08-12 Thread Negm-Awad Amin
9:18, Negm-Awad Amin a écrit : Am Di,12.08.2008 um 19:01 schrieb Mike Abdullah: You can't do this. Each application runs in its own protected memory. Sometimes you can do this: http://en.wikipedia.org/wiki/Computer_virus ;-) Serious: There are techniques to get acccess to another appli

Re: Accessing memory of another application?

2008-08-12 Thread Negm-Awad Amin
Am Di,12.08.2008 um 19:01 schrieb Mike Abdullah: You can't do this. Each application runs in its own protected memory. Sometimes you can do this: http://en.wikipedia.org/wiki/Computer_virus ;-) Serious: There are techniques to get acccess to another application memory under some circumstanc

Re: Should I retain a variable returned from this accessor?

2008-08-12 Thread Negm-Awad Amin
Am Di,12.08.2008 um 14:37 schrieb Sean DeNigris: Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? [...snip...] // Get uid to return NSString* todoUid = [newTodo uid]; [...snip...] return todoUid; } you could do: NSString* t

  1   2   >