On Tue, May 20, 2008 at 2:35 AM, [EMAIL PROTECTED] (!sic)
wrote:
I am not sure I understand the OP's question, but the shortest answer
seems to be to override the super class's designated initializer.
I think he wants an Objective-C equivalent to a C++ copy constructor. That
is...
On Tue, May 20, 2008 at 1:50 AM, Liviu Andron
[EMAIL PROTECTED] wrote:
setRepresentedObject: is a hint, thanks, but it doesn't resolve the problem
either: he MUST copy every property from the original NSButtonCell (font,
attributedTitle, imageDimsWhenDisabled, etc).
This is how you will have
On May 20, 2008, at 1:57 AM, stephen joseph butler wrote:
My high-level goal:
he wants an Objective-C equivalent to a C++ copy constructor
You need to go a little higher. WHY do you need a C++ copy
constructor? You talk about someone modifying your nib in IB. Why is
someone doing this w/o
On Tue, May 20, 2008 at 10:57 AM, stephen joseph butler
[EMAIL PROTECTED] wrote:
On Tue, May 20, 2008 at 1:50 AM, Liviu Andron
[EMAIL PROTECTED] wrote:
setRepresentedObject: is a hint, thanks, but it doesn't resolve the
problem
either: he MUST copy every property from the original
On Tue, May 20, 2008 at 11:38 AM, Nathan Kinsinger [EMAIL PROTECTED]
wrote:
On May 20, 2008, at 1:57 AM, stephen joseph butler wrote:
My high-level goal:
he wants an Objective-C equivalent to a C++ copy constructor
You need to go a little higher. WHY do you need a C++ copy
constructor?
1) NSCell is often used along with the Prototype design pattern. See the
-setPrototype: method of NSMatrix. When so configured, NSMatrix copies its
prototype cell as needed to create new instances.
2) Of course NSCell implements NSCoding. Otherwise it couldn't be used in
Interface
On May 20, 2008, at 6:17 AM, Liviu Andron wrote:
On Tue, May 20, 2008 at 10:57 AM, stephen joseph butler
[EMAIL PROTECTED] wrote:
On Tue, May 20, 2008 at 1:50 AM, Liviu Andron
[EMAIL PROTECTED] wrote:
setRepresentedObject: is a hint, thanks, but it doesn't resolve the
problem
either: he
On May 20, 2008, at 8:55 AM, Andy Lee wrote:
You could add a category to NSObject like this:
- (void)copyProperties:(id)otherObject
(nitpicking myself)
-copyPropertiesFrom: would be a better name. And I would add an ugly
prefix to avoid collision in case Apple adds a method of the same
Problem:
I want to extend NSButtonCell (to keep some additional data) =
MyButtonCell, but this MyButtonCell objects must be initialized with
some base classes object
@interface MyButtonCell: NSButtonCell {
@private
MyData* fData;
}
+(id)issueWithCell:(NSButtonCell*)cell;
@end
I am not sure I understand the OP's question, but the shortest answer seems to
be to override the super class's designated initializer.
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_6.html
On Mon, May 19, 2008 at 5:52 PM, Erik Buck [EMAIL PROTECTED] wrote:
I am not sure I understand the OP's question, but the shortest answer seems
to be to override the super class's designated initializer.
I think he wants an Objective-C equivalent to a C++ copy constructor. That is...
On Mon, May 19, 2008 at 6:00 PM, stephen joseph butler
[EMAIL PROTECTED] wrote:
ButtonCell *bCell = getFromSomewhere();
MyButtonCell *mCell = new MyButtonCell( bCell );
Ermm... MyButtonCell *mCell = new MyButtonCell( *bCell ); But you knew that :)
___
12 matches
Mail list logo