Re: Navigation Design question

2014-04-13 Thread Steve Christensen
Why not just make a common UIViewController subclass that manages the global menu button, and then subclass that class for each of the controllers that live on your navigation stack? If it contains the ivar for the UINavigationItem (marked @protected) instead of having that ivar in each of the c

Re: Navigation Design question

2014-04-13 Thread Maxthon Chan
You can add a category on UIViewController, do some detection and swizzle -[UIViewController viewWillAppear:] method. On Apr 14, 2014, at 5:55, Luther Baker wrote: > Hello all, > > I've run into an issue a few times and I'd like to see if someone has a > good design suggestion to address my pr

Navigation Design question

2014-04-13 Thread Luther Baker
Hello all, I've run into an issue a few times and I'd like to see if someone has a good design suggestion to address my problem. Consider an iPad or iPhone application based on a UINavigationController - that displays a 'menu' button in the UINavigationBar. The navbar renders UIBarButtonItems ...

Re: Design Question

2011-11-26 Thread koko
That is what I thought but just wanted too verify … thanks. -koko On Nov 26, 2011, at 12:28 PM, Dave Fernandes wrote: > You can just subclass NSWindowController and make that subclass the File's > Owner. > > Sent from my iPhone > > On 2011-11-26, at 2:14 PM, koko wrote: > >> I want to displ

Design Question

2011-11-26 Thread koko
I want to display a window as a modal dialog. Should I use just a Window Controller or also define another class that handles the window contents. -koko___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: Document-based app: design question

2011-10-21 Thread Citizen
One way of dealing with this is to make the method part of an informal protocol and check before calling it. Details are here: http://cocoadevcentral.com/articles/75.php -- David Kennedy (http://www.zenopolis.com) On 21 Oct 2011, at 08:39, Luc Van Bogaert wrote: > Hi, > > I'm using th

Document-based app: design question

2011-10-21 Thread Luc Van Bogaert
Hi, I'm using the following piece of code in several places to get a pointer to the "active" windowController in my document-based application: NSDocument *currentDocument = [[NSDocumentController sharedDocumentController] currentDocument]; if (!currentDocument) return;

Re: iOS UI Design Question / Opinions wanted

2011-07-14 Thread John Tsombakos
On Thu, Jul 14, 2011 at 9:26 AM, John Tsombakos wrote: > On Thu, Jul 14, 2011 at 8:14 AM, Thomas Davie wrote: > >> >> Along with various other people, I have a custom UISwitch that does >> exactly what you require, it's available here http://whataboutapp.co.uk/ >> >> Tom Davie > > > That looks e

Re: iOS UI Design Question / Opinions wanted

2011-07-14 Thread John Tsombakos
On Thu, Jul 14, 2011 at 8:14 AM, Thomas Davie wrote: > > Along with various other people, I have a custom UISwitch that does exactly > what you require, it's available here http://whataboutapp.co.uk/ > > Tom Davie That looks exactly what I would want! Thanks! ___

Re: iOS UI Design Question / Opinions wanted

2011-07-14 Thread Thomas Davie
On 14 Jul 2011, at 06:05, John Tsombakos wrote: > Hi, > > Just getting more into iOS development, and am deciding on what to do for an > app. One app is a "competition scoring" application, where the judges would > use the app to calculate and score a game. The scores would are derived from > a

Re: iOS UI Design Question / Opinions wanted

2011-07-14 Thread John Tsombakos
On Thu, Jul 14, 2011 at 1:25 AM, Roland King wrote: > Custom button with your own graphic tick/cross is probably what I'd use for > this. That's easy to do and fits pretty well with the ios look and feel. > Either have two buttons and use them as radio buttons (unselect one when > you hit the ot

Re: iOS UI Design Question / Opinions wanted

2011-07-13 Thread Roland King
Custom button with your own graphic tick/cross is probably what I'd use for this. That's easy to do and fits pretty well with the ios look and feel. Either have two buttons and use them as radio buttons (unselect one when you hit the other) or if perhaps try one button which switches states eac

iOS UI Design Question / Opinions wanted

2011-07-13 Thread John Tsombakos
Hi, Just getting more into iOS development, and am deciding on what to do for an app. One app is a "competition scoring" application, where the judges would use the app to calculate and score a game. The scores would are derived from a series of "challenges", each worth a set number of points. Ea

Re: design question

2011-03-23 Thread Ariel Feinerman
thank you very much for your answers. 2011/3/23 Graham Cox > > On 23/03/2011, at 11:58 AM, Quincey Morris wrote: > > > 1b. The property is a to-many relationship. > > > > If #1a, then the return value should be unchangeable, in the sense that > it should never change after being returned (regard

Re: design question

2011-03-22 Thread Graham Cox
On 23/03/2011, at 11:58 AM, Quincey Morris wrote: > 1b. The property is a to-many relationship. > > If #1a, then the return value should be unchangeable, in the sense that it > should never change after being returned (regardless of whether the returned > object is of a mutable class or not).

Re: design question

2011-03-22 Thread Quincey Morris
On Mar 22, 2011, at 16:53, Graham Cox wrote: > That's because a) NSMutableArray IS a NSArray, and b) your method has told > its clients it is returning an NSArray, so the client has no right to go any > further than the methods of NSArray with that object, that is, it cannot make > use of knowl

Re: design question

2011-03-22 Thread Graham Cox
On 23/03/2011, at 6:29 AM, Ariel Feinerman wrote: > Hi, > > can someone look at and say is a returning of immutable objects necessary or > no? > > @interface XMLElement : NSObject { > > > NSString *_name; > > NSMutableString *_text; > > NSMutableDictionary *_attributes; > > NSMutableArray

design question

2011-03-22 Thread Ariel Feinerman
Hi, can someone look at and say is a returning of immutable objects necessary or no? @interface XMLElement : NSObject { NSString *_name; NSMutableString *_text; NSMutableDictionary *_attributes; NSMutableArray *_children; XMLElement *_parent; } @implementation XMLElement - (NSArray *

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

2009-11-03 Thread Sean McBride
On 11/2/09 12:58 PM, Ben Trumbull said: >This doesn't really have anything to do with Core Data. However, for >NSManagedObject, Core Data already provides the change coalescing and >NSNotifications for you. You can respond within >NSManagedObjectContextObjectsDidChangeNotification instead. So I

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

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

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

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

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

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

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

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

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

2009-10-30 Thread Graham Cox
Hi Sean, I'd say you're going down the wrong path there. Set each property individually. Yes, it will trigger a notification for each one - doesn't or shouldn't matter, and unless you can show it causes a performance problem, shouldn't be a cause for worry on that score. It won't cause mul

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

2009-10-30 Thread Kiel Gillard
On 31/10/2009, at 9:01 AM, Sean McBride wrote: Hi all, What is considered best practice when it comes to mutating many properties of a managed object, specifically with regard to KVO observers getting notified before all mutations are finished? In situations like these I personally tend to av

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

2009-10-30 Thread Sean McBride
Hi all, What is considered best practice when it comes to mutating many properties of a managed object, specifically with regard to KVO observers getting notified before all mutations are finished? Let's say I have an Rectangle object. It has properties: colour, width, height. Imagine some cont

Re: Application Design Question

2009-09-04 Thread Jens Alfke
On Sep 4, 2009, at 4:55 PM, Marek Kozubal wrote: Another question related to this is what API set provides the fastest disk IO under Mac OS X? On the windows side I used FILE_FLAG_NO_BUFFERING and FILE_FLAG_WRITE_THROUGH flags with the ReadFile/WriteFile API. The fastest will be the low

Application Design Question

2009-09-04 Thread Marek Kozubal
Hello everyone. I have a DVR (digital video recorder) program I wrote in Windows that I want to re-write on the Mac. And I wanted to get some ideas about how best to use Cocoa objects to make this program work as I'm still relatively new to Cocoa programming. The application has 2 modes, o

Re: core-data app design question

2009-08-29 Thread Kyle Sluder
On Aug 29, 2009, at 5:53 PM, Ben Trumbull wrote: Encoding your data this way is pushing the boundaries of violating MVC patterns by archiving UI information (NSTextView drawing information) into your model (database). That obviously doesn't work if the platform doesn't support NSTextView.

re: core-data app design question

2009-08-29 Thread Ben Trumbull
I have a question, or rather, I'm looking for advice, on the design of an application. Essentially I'm wanting to write a labbook-type application. My plan was to use core-data for the model. In the model will be an Entry entity. Each entry will have a one-to-one relationship to a Content entity.

Re: core-data app design question

2009-08-28 Thread Michael Thon
On Aug 28, 2009, at 8:37 AM, Martin Hewitson wrote: Dear list, I have a question, or rather, I'm looking for advice, on the design of an application. Essentially I'm wanting to write a labbook-type application. My plan was to use core-data for the model. In the model will be an Entry ent

core-data app design question

2009-08-27 Thread Martin Hewitson
Dear list, I have a question, or rather, I'm looking for advice, on the design of an application. Essentially I'm wanting to write a labbook-type application. My plan was to use core-data for the model. In the model will be an Entry entity. Each entry will have a one-to-one relationship t

Re: Design Question

2009-08-07 Thread Kaelten
Fair enough. I guess what I'm wondering then is how do I handle the following case. I have several loosely coupled properties which can read somewhat like this. (ProjectInstall *)projectInstall { return [ProjectInstallController projectInstallWithProjectId:projectId]; } And in some cases it

Re: Design Question

2009-08-06 Thread Ken Thomases
On Aug 6, 2009, at 12:29 PM, Quincey Morris wrote: Finally, the question of whether 'projectInstall' sometimes returns nil is irrelevant. That has nothing to do with the compliance of the Project object. Except, check out "Bug Fix in KVO's Dependency Mechanism" in the Leopard Foundation R

Re: Design Question

2009-08-06 Thread Quincey Morris
On Aug 6, 2009, at 07:46, Kaelten wrote: I guess what I'm wondering then is how do I handle the following case. I have several loosely coupled properties which can read somewhat like this. (ProjectInstall *)projectInstall { return [ProjectInstallController projectInstallWithProjectId:proj

Re: Design Question

2009-08-05 Thread Quincey Morris
On Aug 4, 2009, at 11:35, Kaelten wrote: I have an application I'm working on where I'm using mainly Bindings for communicating with the UI, but I find myself in situations where I'm not getting all the data updates to the UI. These lack of updates seem to stem either from dependent keys, loose

Design Question

2009-08-05 Thread Kaelten
I have an application I'm working on where I'm using mainly Bindings for communicating with the UI, but I find myself in situations where I'm not getting all the data updates to the UI. These lack of updates seem to stem either from dependent keys, loose coupling between objects, to-many relations

Re: BOOL takeStupidRoad = NO (search app design question)

2009-03-23 Thread David Yamartino
Yes, thank you. So that's how I'll proceed. David -- On Tue, Mar 24, 2009 at 3:18 AM, Scott Ribe wrote: > > Then again, I guess I could use Spotlight to locate the proper files, and > > then focus on them for fin

Re: BOOL takeStupidRoad = NO (search app design question)

2009-03-23 Thread Scott Ribe
> Then again, I guess I could use Spotlight to locate the proper files, and > then focus on them for finding the position of the words and then getting > the words around them for the snippets, etc. Exactly. However, for the amount of data you're talking about, just loading it up & searching it is

Re: BOOL takeStupidRoad = NO (search app design question)

2009-03-23 Thread David Yamartino
tely from > search. > > > izidor > > > > On 21.3.2009, at 11:24, David Yamartino wrote: > > Hi All, >> >> I have a general design question. I'm going through the latest Hillegass >> and >> Kochan programming books for the purpose of writing a

Re: BOOL takeStupidRoad = NO (search app design question)

2009-03-23 Thread Izidor Jerebic
m yourself, separately from search. izidor On 21.3.2009, at 11:24, David Yamartino wrote: Hi All, I have a general design question. I'm going through the latest Hillegass and Kochan programming books for the purpose of writing a simple search app. I think I've figured out a

BOOL takeStupidRoad = NO (search app design question)

2009-03-21 Thread David Yamartino
Hi All, I have a general design question. I'm going through the latest Hillegass and Kochan programming books for the purpose of writing a simple search app. I think I've figured out a way to do this, but having no experience in programming, I have no idea if my approach is good o

Re: Design question: View with hell lot of drawing

2009-03-10 Thread Steve Christensen
On Mar 10, 2009, at 1:39 AM, rajesh wrote: I need to display huge number of "elements" in NSView (1000-2000). These elements are generally made of high resolution image files with some fancy drawing around them. These elements may vary from size 300 X 270 to 4280 X 3500. First I made use

Re: Design question: View with hell lot of drawing

2009-03-10 Thread Graham Cox
On 10/03/2009, at 7:39 PM, rajesh wrote: Is there any other way of approach, or should I be making use of one of the ways I mentioned ? Of course - just define a custom object that contains or manages each piece of content and draw them in one view. This is the "classic" approach and is

Design question: View with hell lot of drawing

2009-03-10 Thread rajesh
Hi All, I need to display huge number of "elements" in NSView (1000-2000). These elements are generally made of high resolution image files with some fancy drawing around them. These elements may vary from size 300 X 270 to 4280 X 3500. First I made use of NSView's for "elements", I abando

Re: Design Question

2009-02-12 Thread David Blanton
So besides hiding a layer I should also removeAnimationForKey: Thanks! On Feb 12, 2009, at 11:16 AM, David Duncan wrote: On Feb 12, 2009, at 9:50 AM, David Blanton wrote: Do I understand correctly that if a layer with explicit animations is hidden the animation is still running? Yes, ani

Re: Design Question

2009-02-12 Thread David Duncan
On Feb 12, 2009, at 9:50 AM, David Blanton wrote: Do I understand correctly that if a layer with explicit animations is hidden the animation is still running? Yes, animations always run, regardless of the hidden state of a layer (hidden is just another render attribute). -- David Duncan A

Re: Design Question

2009-02-12 Thread David Blanton
Do I understand correctly that if a layer with explicit animations is hidden the animation is still running? On Feb 12, 2009, at 10:45 AM, David Duncan wrote: On Feb 12, 2009, at 9:37 AM, David Blanton wrote: Side question ... in doing so will the animations begin when the hidden property

Re: Design Question

2009-02-12 Thread David Duncan
On Feb 12, 2009, at 9:37 AM, David Blanton wrote: Side question ... in doing so will the animations begin when the hidden property is set NO. Animations run independently of each other, so hiding a layer does not pause animations at all. -- David Duncan Apple DTS Animation and Printing _

Design Question

2009-02-12 Thread David Blanton
Having been chastised on this for 'horrific' design I thought I would ask for some pointers before embarking on my next project. (Picture of me with tail between legs.) The app in question has four states. Associated with each state are four CALayers some of which have explicit animations.

Re: First responder design question. Are controllers in the chain?

2008-09-11 Thread Seth Willits
On Sep 11, 2008, at 7:59 AM, David wrote: I've been conceptually thinking of the document as part of the model. The first responder chain in the document architecture goes through the view hierarchy and checks the document. View -> Window -> Window Delegate -> Window Controller -> Document N

First responder design question. Are controllers in the chain?

2008-09-11 Thread David
I'm just starting to delve into the first responder chain to handle menu actions. My conceptual understanding of MVC is that the controller is the one who determines what to do with actions. When someone wants to do something the controller is told by a control in the view, it updates the model an

Re: Design Question: Bindings & Custom Views

2008-08-29 Thread Erik Buck
Sorry. When I posted about "the problem Oleg Krupnov describes", I wasn't caught up on my reading of the list. The VC MYShapeDraw application I describe is a drawing application and not related to image thumbnail caching. Of course, the pattern is general and applicable to image thumbnai

Re: Design Question: Bindings & Custom Views

2008-08-29 Thread Erik Buck
"Cocoa Design Patterns" Chapter 29, "Controllers," contains an MVC solution to exactly the problem Oleg Krupnov describes. The chapter presents a relatively simple MVC MYShapeDraw application. The chapter leads the reader through the step by step process of re-inventing NSArrayControlle

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Oleg Krupnov
Thanks, that mostly answers my question, finally. And the short answer is "No" :). There is no standard Cocoa way of doing this and it's up to me how to implement it. I just wanted to make sure I was not reinventing the wheel. You are correct in suspecting me in a kind of MVC purism (typical for a

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread graham . lee
Grahaam Cox wrote on 2008-08-28 13:11:47: > > Regarding the above though, if this is similar to your situation - > what's really wrong with model objects caching a thumbnail? Being a > slave to MVC is going to lead to suboptimal solutions just as ignoring > MVC altogether is going to be. The c

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Cathy Shive
On Aug 28, 2008, at 12:26 PM, Oleg Krupnov wrote: I think there are times when it's appropriate to have wrapper objects - that are view related - for your model objects. In an image browser, it's likely that there is a "thumbnail" object that draws "image" objects. Yeah, maybe "view-rela

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Graham Cox
On 28 Aug 2008, at 8:26 pm, Oleg Krupnov wrote: In your image browser example, this problem sounds as follows: where to store the cached thumbnail images, to avoid re-creating them anew in each drawRect call? Also, if a thumbnail is in process of dragging inside the custom view, where to save t

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Graham Cox
On 28 Aug 2008, at 6:15 pm, Oleg Krupnov wrote: I have only one problem with this approach: As I mentioned before, I need to add custom-view specific instance variables (states) to the model object's category. The Objective-C categories do not allow adding instance variables, only methods I am

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Oleg Krupnov
> I think there are times when it's appropriate to have wrapper objects - that > are view related - for your model objects. In an image browser, it's likely > that there is a "thumbnail" object that draws "image" objects. Yeah, maybe "view-related wrapper objects for model objects" is the right t

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Cathy Shive
On Aug 28, 2008, at 11:06 AM, Oleg Krupnov wrote: In other words, I need a way to associate additional custom-view-specific properties with model object, without adding them as transitive properties to the model. What is the best way to do this? Or maybe your point is that this is a bad idea at

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Negm-Awad Amin
Okay, I – hopefully – understand you now: You have a view with some (model) objects displayed. There is another view (potentially or really?) that can display these objects, too The additional attributes are specific for each displayed object and each view? Correct? (There is a german phrase

Re: Design Question: Bindings & Custom Views

2008-08-28 Thread Oleg Krupnov
Yes, you are correct. I am looking not to break MVC and also get the correct implementation of binding in a custom view > Just an example: I had a graphic application that drawed some inserted > shapes. The shape itself is a part of the model, the color of the shape, > too. But when the user selec

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: Design Question: Bindings & Custom Views

2008-08-28 Thread 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 * and maintain the category > implementation in

Re: Design Question: Bindings & Custom Views

2008-08-27 Thread Paul Bruneau
On Aug 27, 2008, at 8:10 AM, Oleg Krupnov wrote: I am building a custom view that can display and edit some polymorphic objects. Furthermore, the objects can be composite, i.e. contain child objects hierarchically. Now I want to bind this custom view to the model through a controller (NSTreeCon

Design Question: Bindings & Custom Views

2008-08-27 Thread Oleg Krupnov
I am building a custom view that can display and edit some polymorphic objects. Furthermore, the objects can be composite, i.e. contain child objects hierarchically. Now I want to bind this custom view to the model through a controller (NSTreeController in my case). In the examples I have seen (G

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

2008-08-21 Thread Graham Cox
On 22 Aug 2008, at 2:22 pm, Phil wrote: Why use NSNotifications when there's already perfectly good notification mechanism? Indeed, but notifications have been around a lot longer than KVO, so there are still plenty of places in Cocoa that notifications are used for legacy reasons. Als

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

2008-08-21 Thread Phil
On Fri, Aug 22, 2008 at 3:59 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > @implementation ToolBar > { >-(id) init >{ >[[[NSNotificationCenter] defaultCenter] addObserver:self > selector:@selector(splitViewResized:) object:mySplitView]; >} -(void)dealloc { [[NSNotificationCe

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

2008-08-21 Thread Kyle Sluder
On Thu, Aug 21, 2008 at 10:27 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > But one thing that has been overlooked - common or garden notifications. If > all you want is to pick up a change in an object a notification is a simple > way to do it without writing your own messaging system. It's less pow

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

2008-08-21 Thread Ben Trumbull
So, does everybody really always use KVC/KVO for implementing MVC, in all projects? Is this the recommended best practice? From code written after 10.2, yeah, pretty much. Coupled with the tools support in Interface Builder and the AppKit support with Cocoa Bindings, it's really not worth t

Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread Bill Mutch
Ken, Thanks for your explanation of the development of KVC, KVO, and Bindings. As a geezer who spent most of his career coding in assembler on IBM mainframes beginning in the late 60's, it is still sometimes difficult not having total control over my code. KVC, KVO, and Bindings is one of th

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

2008-08-21 Thread Graham Cox
On 22 Aug 2008, at 1:03 am, Oleg Krupnov wrote: 4) Anything else I may have overlooked? I've read through this thread and it's very interesting. But one thing that has been overlooked - common or garden notifications. If all you want is to pick up a change in an object a notification is

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

2008-08-21 Thread Ken Thomases
On Aug 21, 2008, at 7:09 PM, Erik Buck wrote: On Aug 21, 2008, at 7:12 PM, Ken Thomases wrote: On Aug 21, 2008, at 12:54 PM, Erik Buck wrote: KVC also provides support (hooks) for change management so that any change to a property can have application defined side effects like registering

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

2008-08-21 Thread Erik Buck
On Aug 21, 2008, at 7:12 PM, Ken Thomases wrote: I have some quibbles... On Aug 21, 2008, at 12:54 PM, Erik Buck wrote: So, in summary, the whole point of KVC is to standardize the way an object’s properties are accessed regardless of how they are stored. Well, the real point, to my mind,

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

2008-08-21 Thread Ken Thomases
Remember that NeXT and Apple didn't just invent KVC, KVO, and Bindings out of thin air for no better reason than they were enamored of the idea. There was a substantial history of NeXTStep/OpenStep/Cocoa programs written. The developers at NeXT and then Apple recognized that there was a

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

2008-08-21 Thread Ken Thomases
I have some quibbles... On Aug 21, 2008, at 12:54 PM, Erik Buck wrote: So, in summary, the whole point of KVC is to standardize the way an object’s properties are accessed regardless of how they are stored. Well, the real point, to my mind, is to increase the dynamism of property access.

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

2008-08-21 Thread Erik Buck
I love answering questions that require an essay. So – here is my essay. I think my forthcoming “Cocoa Design Patterns” book does a good job of explaining the patterns used to implement Cocoa and reused to implement Cocoa applications. In particular, the book explains how techniques like Key

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 Kai
Oleg, by all means, go ahead with what you started and spend more time learning about KVC/KVO. Yes, this is used in many many projects and I personally would really miss it if it wouldn’t be there. Actually, as you described yourself, if it wouldn’t be there, you’d had to brew something s

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

2008-08-21 Thread 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 explain me, in just two words, what are the relations

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: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread 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 for implementing MVC, in all projects? Is this the rec

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: Design Question: Pro & Cons of KVC/KVO

2008-08-21 Thread 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:change:context: Then how is it better tha

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/

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: Design question, which controller class to use

2008-07-21 Thread Ken Thomases
On Jul 20, 2008, at 10:24 PM, Jens Alfke wrote: On 20 Jul '08, at 8:05 PM, James W. Walker wrote: Since there is a window (which has a title that depends on the data) I thought I should use a subclass of NSWindowController. On the other hand, there is an array being displayed in a table, a

Re: Design question, which controller class to use

2008-07-21 Thread Hamish Allan
On Mon, Jul 21, 2008 at 4:05 AM, James W. Walker <[EMAIL PROTECTED]> wrote: > I have these windows, each of which has a table displaying data from an > array of dictionaries. The data is never stored on disk, so I don't think > of these windows as "documents". In addition to what Jens said: If t

Re: Design question, which controller class to use

2008-07-20 Thread Jens Alfke
On 20 Jul '08, at 8:05 PM, James W. Walker wrote: Since there is a window (which has a title that depends on the data) I thought I should use a subclass of NSWindowController. On the other hand, there is an array being displayed in a table, and I gather that's easier to set up using bindi

Design question, which controller class to use

2008-07-20 Thread James W. Walker
I have these windows, each of which has a table displaying data from an array of dictionaries. The data is never stored on disk, so I don't think of these windows as "documents". Since there is a window (which has a title that depends on the data) I thought I should use a subclass of NSWi

Re: Design question

2008-07-14 Thread Michael Fey
I'd agree with what I.S. said, make sure you read up on and run through some tutorials for coding a table and its data source by hand. Aaron Hillegass does a great job of this in Cocoa Programming for Mac OS X. As a Cocoa newbie this is a great book to hit the ground running. It assumes

Re: Design question

2008-07-14 Thread I. Savant
Does anyone have any comments on my design so far? Overcomplicated. :-) If I were writing a quick utility to do as you're looking to do, I'd probably implement it all in a single application controller. There's no real design advantage in something with so few requirements and simple is

Design question

2008-07-14 Thread Phillip Hall
Hi all, As a developer entering the cocoa world for the first time one of the things I am finding difficult is how to start structuring an application, I mean what classes should I create to make an OK application design. I have a simple application I am working on at the moment, and am hoping

Re: Design Question: Where to observe using KVO?

2008-07-13 Thread Ken Thomases
On Jul 11, 2008, at 2:45 AM, Patrick Mau wrote: Do you think that observing lots of objects with lots of keypaths is a good idea anyway? Honestly, I've forgotten the original design issues you're considering. If you need to observe lots of objects and key paths to achieve your purposes, the

Re: Design Question: Where to observe using KVO?

2008-07-13 Thread Patrick Mau
Ken Thomases wrote: > How about a dictionary whose keys are NSValues representing the > objects? For each object, the value from the dictionary would be an > NSMutableArray whose elements are the key paths being observed on that > object. > > // ... > NSValue* objectKey = [NSValue valueW

Re: Design Question: Where to observe using KVO?

2008-07-10 Thread Ken Thomases
On Jul 10, 2008, at 4:55 PM, Patrick Mau wrote: I'd like to show you one ugly detail. I put all observed objects, including their keyPath in a local NSDictionary, because I have to remove the observers on deletion of a table row. The 'observeObject' looks like that: - (void)observeObject:(id)o

Re: Design Question: Where to observe using KVO?

2008-07-10 Thread Patrick Mau
I. Savant wrote: >> Check out this page: >> >> http://homepage.mac.com/mmalc/CocoaExamples/controllers.html >> > > I should also mention that you should approach these examples like this: > > 1 - Read the Cocoa Bindings documentation (including all the Key Value > Coding / Key Value Observing r

Re: Design Question: Where to observe using KVO?

2008-07-10 Thread I. Savant
> Check out this page: > > http://homepage.mac.com/mmalc/CocoaExamples/controllers.html > I should also mention that you should approach these examples like this: 1 - Read the Cocoa Bindings documentation (including all the Key Value Coding / Key Value Observing related documentation). 2 - Exam

Re: Design Question: Where to observe using KVO?

2008-07-10 Thread I. Savant
> Where would you observe changes to data? I think you should worry about one thing at a time (ie, leave the animation part for another day and concentrate on your bindings machinery first). Check out this page: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html Great examples of B

  1   2   >