Re: Subclassing NSCollectionViewFlowLayout

2019-10-24 Thread Arved von Brasch via Cocoa-dev
nstraints basically tell the auto layout engine what the frame size will > be). > >> >> Cheers, >> Arved >> >> >>> On 2019-10-20, at 21:54, Arved von Brasch wrote: >>> >>> Hello Cocoa List, >>> >>> I’m in the process of po

Re: Subclassing NSCollectionViewFlowLayout

2019-10-21 Thread David Duncan via Cocoa-dev
rved von Brasch wrote: >> >> Hello Cocoa List, >> >> I’m in the process of porting a hobby project to up-to-date Swift so it can >> be used on Catalina (and I can upgrade my work machine - still looking for a >> QuickTime 7 Pro replacement, though). I’ve encounte

Re: Subclassing NSCollectionViewFlowLayout

2019-10-21 Thread Arved von Brasch via Cocoa-dev
e used on Catalina (and I can upgrade my work machine - still looking for a > QuickTime 7 Pro replacement, though). I’ve encountered a phenomenon > subclassing NSCollectionViewFlowLayout that I haven’t been able to resolve. > > I have a Core Data backed NSArrayController feeding

Subclassing NSCollectionViewFlowLayout

2019-10-20 Thread Arved von Brasch via Cocoa-dev
Hello Cocoa List, I’m in the process of porting a hobby project to up-to-date Swift so it can be used on Catalina (and I can upgrade my work machine - still looking for a QuickTime 7 Pro replacement, though). I’ve encountered a phenomenon subclassing NSCollectionViewFlowLayout that I haven’t

Re: Subclassing and Archiving/Unarchiving

2016-09-25 Thread Graham Cox
> On 25 Sep 2016, at 8:12 PM, Dave wrote: > > Is there any way that I can get the archiver to just select the Base Class > and ignore the extra properties in the Subclass? Or is there a better way of > doing this? You mean the dearchiver. It can have a delegate (NSKeyedUnarchiverDelegate,

Subclassing and Archiving/Unarchiving

2016-09-25 Thread Dave
a subclasses in the writer App for each Class I need the “extra” information, but of course this won’t work because the App that loads the files won’t know about the subclasses. I was thinking of putting a wrapper around these classes but it is quite ugly compared to subclassing. The other thing

Re: Subclassing/Override question

2016-01-11 Thread Dave
Thanks Jens and Peter, got it now. All the Best Dave ___ 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/Unsubs

Re: Subclassing/Override question

2016-01-04 Thread Jens Alfke
> On Jan 4, 2016, at 8:24 AM, Dave wrote: > > myClassB = myClassA.propA;//Warning on this line saying > return type is not ClassB You have to declare the override in the subclass’s @interface, with the modified return type. Otherwise callers have no idea that your override

Re: Subclassing/Override question

2016-01-04 Thread Peter Tomaselli
Method return types are covariant though, yes? So you should always be able to return a more-derived type from a method that is declared to return a less-derived type. If I read your example right, ClassA is "Animal" and ClassB is "Cat" (in covariance-blog-post lingo). So that is legal, unless I'm

Re: Subclassing/Override question

2016-01-04 Thread Jeff Kelley
Hi Dave, For myClassA, you will always have to cast the return value to myClassB if you know that’s what will be returned. For a great blog post on the subject, I give you Mike Ash: https://mikeash.com/pyblog/friday-qa-2015-11-20-covariance-and-contravariance.html Jeff Kelley slaunch

Subclassing/Override question

2016-01-04 Thread Dave
Hi, In Objective-C, is it possible to override a property and have it return a different type to the base class? I have a base class with the following property defined: @property (nonatomic,retain)ClassA* propA; and the following getter: -(ClassA*) propA

Re: Subclassing a Subclass of SBApplication

2015-09-03 Thread Conrad Shultz
Note that this is a category, not a class extension. -Conrad > On Jun 30, 2015, at 6:19 AM, Jean-Daniel Dupas wrote: > > Using class extension is probably a safe way to extends such classes. > > @interface SXPhotoshopApplication (MyExtension) > > - (void)myWrapper; > > @end > > >> Le 29 j

Re: Subclassing a Subclass of SBApplication

2015-06-30 Thread Dave
Hi and Thanks, yes a much better option. All the Best Dave > On 30 Jun 2015, at 14:19, Jean-Daniel Dupas wrote: > > Using class extension is probably a safe way to extends such classes. > > @interface SXPhotoshopApplication (MyExtension) > > - (void)myWrapper; > > @end > > >> Le 29 juin 201

Re: Subclassing a Subclass of SBApplication

2015-06-30 Thread Jean-Daniel Dupas
Using class extension is probably a safe way to extends such classes. @interface SXPhotoshopApplication (MyExtension) - (void)myWrapper; @end > Le 29 juin 2015 à 13:54, Dave a écrit : > > Hi, > > I’m using the Scripting Bridge, and I was wondering if it ok to subclass > SBXXX classes. Basi

Subclassing a Subclass of SBApplication

2015-06-29 Thread Dave
Hi, I’m using the Scripting Bridge, and I was wondering if it ok to subclass SBXXX classes. Basically, I have a header file generated by the “sdp” tool with definitions as below: And I’d like to subclass this to add some extra wrapping to hide some of the nastiness from the rest of the app and

Re: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 12:41 PM, Raglan T. Tiger wrote: > > On May 8, 2015, at 10:55 AM, Kyle Sluder wrote: > > > > In that case, the menu is running the runloop in event-tracking mode and > > pulling events for its own purpose. > > > I create an NSMenu and populate it with NSMenuItem s and

Re: Subclassing NSPopUpButton

2015-05-08 Thread Raglan T. Tiger
> On May 8, 2015, at 10:55 AM, Kyle Sluder wrote: > > In that case, the menu is running the runloop in event-tracking mode and > pulling events for its own purpose. I create an NSMenu and populate it with NSMenuItem s and then set this menu to the NSPopUpButton. Would it make sense to use a

Re: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 11:42 AM, Raglan T. Tiger wrote: > I have subclassed NSPopUpButton. In the subclass drawRect:dirtyRect is > called ... I did this just to check that the subclass is properly > implemented. > > In the subclass keyDown:theEvent is not being called. How does one > override

Subclassing NSPopUpButton

2015-05-08 Thread Raglan T. Tiger
I have subclassed NSPopUpButton. In the subclass drawRect:dirtyRect is called ... I did this just to check that the subclass is properly implemented. In the subclass keyDown:theEvent is not being called. How does one override this method for an NSPopUPButton subclass? The purpose for overrid

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 30, 2015, at 12:49 AM, Quincey Morris wrote: > On Jan 29, 2015, at 22:21 , Ken Thomases wrote: >> >> Huh? It has to be an autorelease and not a release because the object needs >> to survive to the caller's scope. > > "Release" meant “eventual relinquishment of ownership”. Sorry if

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 22:21 , Ken Thomases wrote: > > Huh? It has to be an autorelease and not a release because the object needs > to survive to the caller's scope. "Release" meant “eventual relinquishment of ownership”. Since we’re talking about ARC, I wasn’t assuming that it would be an actu

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 11:53 PM, Quincey Morris wrote: > On Jan 29, 2015, at 21:16 , Ken Thomases wrote: >> >> the getter has to do the equivalent of retain+autorelease atomically > > I was thinking that the same would have to be true of local variable > accesses, too, but I see (if I see) the

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 21:16 , Ken Thomases wrote: > > the getter has to do the equivalent of retain+autorelease atomically I was thinking that the same would have to be true of local variable accesses, too, but I see (if I see) the difference is that references from local variables are already r

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Ken Thomases
On Jan 29, 2015, at 10:54 PM, Quincey Morris wrote: > On Jan 29, 2015, at 19:47 , Greg Parker wrote: >> >> `atomic` makes a big difference for a strong or weak property of object type >> because objects have retain counts. > > Er, I feel stupid but I don’t understand. How do the retain count

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 19:47 , Greg Parker wrote: > > `atomic` makes a big difference for a strong or weak property of object type > because objects have retain counts. Er, I feel stupid but I don’t understand. How do the retain counts affect this? On the one hand, properties are not the only pla

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Greg Parker
> On Jan 29, 2015, at 5:29 PM, Quincey Morris > wrote: > > On Jan 29, 2015, at 17:18 , Roland King wrote: >> >> I can find this >> http://lists.apple.com/archives/objc-language/2013/Apr/msg00119.html >> , is >> that what

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 17:18 , Roland King wrote: > > I can find this > http://lists.apple.com/archives/objc-language/2013/Apr/msg00119.html > , is > that what you were remembering or is there something stronger my google-fu >

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 17:03 , Graham Cox wrote: > > Regarding 'nonatomic', in previous times, I've had a different warning when I > used @synthesize with an assigned ivar and the property was not 'nonatomic'. > Maybe that's changed but as a result of it I got conditioned to always > including no

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 08:38, Quincey Morris > wrote: > > On Jan 29, 2015, at 16:26 , Graham Cox > wrote: >> >> 'atomic' attribute on property 'action' does not match the property >> inherited from 'NSControl' > > The 10.10 SDK uses real @property declarations,

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
> On 30 Jan 2015, at 11:40 am, Roland King wrote: > > I can get that warning too, but only if I explicitly declare the property > 'nonatomic', like this > > @property (readwrite, nonatomic ) SEL action; // 'atomic' attribute on > property 'action' does not match the property inherited from 'N

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> > The only difference I see is that I'm declaring my ivars as part of the > @interface, not the @implementation - is that a new thing? I didn't know you > could do that (though it makes sense). > oh and that was Xcode 4.2 + 64-bit runtime. It was one of the changes I appreciated in ObjC 2.

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 08:26, Graham Cox wrote: > > >> On 30 Jan 2015, at 11:12 am, Roland King wrote: >> >> I don't see this in a quick test I just typed into Xcode. I did this in the >> .h file >> >> @interface RKControl : NSControl >> @property SELaction; >> @property (weak) id ta

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Quincey Morris
On Jan 29, 2015, at 16:26 , Graham Cox wrote: > > 'atomic' attribute on property 'action' does not match the property inherited > from 'NSControl' The 10.10 SDK uses real @property declarations, but doesn’t specify atomicity, which means the property defaults to atomic. You said before that "t

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
> On 30 Jan 2015, at 11:12 am, Roland King wrote: > > I don't see this in a quick test I just typed into Xcode. I did this in the > .h file > > @interface RKControl : NSControl > @property SEL action; > @property (weak) id target; > @end > > > and .m > > #import "RKControl.h" > @implement

Re: Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Roland King
> On 30 Jan 2015, at 07:44, Graham Cox wrote: > > NSControl has properties target, action. > > > If I redeclare the storage, to use my own storage ivars via @synthesize, the > properties have to be nonatomic, but the original properties don't define > this, so the compiler complains that the

Subclassing NSControl and inheritance of target, action properties

2015-01-29 Thread Graham Cox
NSControl has properties target, action. I want to subclass NSControl but my custom control doesn't use a cell internally. I want to inherit the target, action properties so that I can hook these up for my custom subclass in IB (If I don't inherit NSControl, IB is unaware that I have target, ac

Re: Subclassing NSView in Yosemite?

2014-11-06 Thread Kyle Sluder
On Nov 6, 2014, at 6:29 AM, Alex Hall wrote: > > Hello list, > I've subclassed NSView before, doing all my setup in init withFrame, and it > works fine. Now, though, I'm using Swift in Xcode 6.1 to build a project > against 10.10, and I'm getting an error that I need to implement > initWithCod

Re: Subclassing NSView in Yosemite?

2014-11-06 Thread David Duncan
> On Nov 6, 2014, at 6:29 AM, Alex Hall wrote: > > Hello list, > I've subclassed NSView before, doing all my setup in init withFrame, and it > works fine. Now, though, I'm using Swift in Xcode 6.1 to build a project > against 10.10, and I'm getting an error that I need to implement > initWith

Subclassing NSView in Yosemite?

2014-11-06 Thread Alex Hall
Hello list, I've subclassed NSView before, doing all my setup in init withFrame, and it works fine. Now, though, I'm using Swift in Xcode 6.1 to build a project against 10.10, and I'm getting an error that I need to implement initWithCoder:NSCoder. The problem is that the documentation says not

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Rick Mann
> On Oct 19, 2014, at 02:14 , Quincey Morris > wrote: > > Ugh! Now you made me create a project to try it. Heh. Let's try this: Swift sucks; it can't make a million dollars appear on my doorstep. > Or maybe someone else has a better solution. Yeah. Load my nib in -loadWindow ;-) -- Rick

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Quincey Morris
On Oct 19, 2014, at 01:28 , Rick Mann wrote: > >> you will need to declare it “convenience”. > > Tried that, too. Ugh! Now you made me create a project to try it. It looks like the problem is that ‘init’ is already a designated initializer, though not of NSWindowController. That means it’s ne

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Rick Mann
> On Oct 19, 2014, at 01:27 , Quincey Morris > wrote: > >> On Oct 19, 2014, at 01:20 , Rick Mann wrote: >> >> I don't remember now, but I think it complained that I was overriding an >> inherited method. > > Well, double-checking the syntax earlier in the chapter, you will need to > declar

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Quincey Morris
> On Oct 19, 2014, at 01:20 , Rick Mann wrote: > > I don't remember now, but I think it complained that I was overriding an > inherited method. Well, double-checking the syntax earlier in the chapter, you will need to declare it “convenience”. ___

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Rick Mann
> On Oct 19, 2014, at 01:19 , Quincey Morris > wrote: > > In short, take the “override” keyword off your declaration, and it should > work exactly as you expected. (!) I don't remember now, but I think it complained that I was overriding an inherited method. -- Rick Mann rm...@latencyzero

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Quincey Morris
On Oct 19, 2014, at 00:56 , Rick Mann wrote: > > The subclass initializer still has to initialize itself. It knows what the > superclass initializer is doing, and it knows what it still needs to do. > That's true even with the rules Swift currently imposes. I don’t actually know what “initiali

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Roland King
>> >> (It’s all about the “yes, but”s.) >> >> … calling *up* from a subclass convenience initializer bypasses all of the >> subclass designated initializers (except in the case that the subclass >> overrides some or all of the superclass's, which introduces its own semantic >> ambiguities). Th

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Rick Mann
> On Oct 19, 2014, at 00:54 , Quincey Morris > wrote: > > If, hypothetically, a subclass was allowed to call any initializer in the > superclass, then the result would be an object that was fully (“correctly”) > initialized in terms of the superclass, but that doesn’t mean it’s fully > initi

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Quincey Morris
On Oct 19, 2014, at 00:24 , Rick Mann wrote: > > Well, I'm not sure I agree with that. Every initializer in a class should > work correctly. If, hypothetically, a subclass was allowed to call any initializer in the superclass, then the result would be an object that was fully (“correctly”) in

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Rick Mann
> On Oct 19, 2014, at 00:19 , Quincey Morris > wrote: > > On Oct 18, 2014, at 23:46 , Rick Mann wrote: >> >> The rules on initializers don't make sense to me, in all honesty. > > Yes, but that tells us more about you than about Swift — specifically, it > tells us that you’re more focused on

Re: Subclassing NSWindowController in Swift

2014-10-19 Thread Quincey Morris
On Oct 18, 2014, at 23:46 , Rick Mann wrote: > > The rules on initializers don't make sense to me, in all honesty. Yes, but that tells us more about you than about Swift — specifically, it tells us that you’re more focused on what would ease your coding task in this one case than on embracing

Re: Subclassing NSWindowController in Swift

2014-10-18 Thread Rick Mann
> On Oct 18, 2014, at 23:38 , Roland King wrote: > > > The very first of those errors looks like you had the code in the wrong > place, ie not within your class. > > Initialization is one of those Swift things which is uber-safe and thus very > structured and hence in practice annoying. >

Re: Subclassing NSWindowController in Swift

2014-10-18 Thread Roland King
> On 19 Oct 2014, at 11:42 am, Rick Mann wrote: > > >> On Oct 18, 2014, at 20:33 , Graham Cox wrote: >> >> According to the latest documentation pack that arrived on Thursday, Swift >> has: >> >> convenience init(windowNibName windowNibName: String, >> owner owner: AnyObject) >> >

Re: Subclassing NSWindowController in Swift

2014-10-18 Thread Rick Mann
> On Oct 18, 2014, at 20:33 , Graham Cox wrote: > > According to the latest documentation pack that arrived on Thursday, Swift > has: > > convenience init(windowNibName windowNibName: String, > owner owner: AnyObject) > > So just use this. Like C++, Swift has overloaded method names

Re: Subclassing NSWindowController in Swift

2014-10-18 Thread Graham Cox
Hi Rick, According to the latest documentation pack that arrived on Thursday, Swift has: convenience init(windowNibName windowNibName: String, owner owner: AnyObject) So just use this. Like C++, Swift has overloaded method names, so 'init' can take various parameter combinations.

Subclassing NSWindowController in Swift

2014-10-18 Thread Rick Mann
In Obj-C, I typically subclass NSWindowController and override -init to call -initWithNibName:. I do this so the caller doesn't have to worry about how to make one of these window controllers: @implementation MyWindowController - (id) init { self = [super initWithWindowNibName: "MyWindow" o

Re: Subclassing and private methods

2014-05-14 Thread Michelangelo Chasseur
to. It appears that > > > I can get the desired behaviors by subclassing it (creating a category is > > > also a possibility, although doing so has the same problems as > > > subclassing). > > > > > > Obviously, I would like to create as minimal a s

Re: Subclassing and private methods

2014-05-07 Thread Rick Aurbach
On May 7, 2014, at 2:33 PM, Charles Srstka wrote: > On May 7, 2014, at 2:24 PM, Rick Aurbach wrote: > >> I am using a CocoaPod that ALMOST does what I want it to. It appears that I >> can get the desired behaviors by subclassing it (creating a category is also >>

Re: Subclassing and private methods

2014-05-07 Thread Charles Srstka
On May 7, 2014, at 2:24 PM, Rick Aurbach wrote: > I am using a CocoaPod that ALMOST does what I want it to. It appears that I > can get the desired behaviors by subclassing it (creating a category is also > a possibility, although doing so has the same problems as subclassing). >

Subclassing and private methods

2014-05-07 Thread Rick Aurbach
I am using a CocoaPod that ALMOST does what I want it to. It appears that I can get the desired behaviors by subclassing it (creating a category is also a possibility, although doing so has the same problems as subclassing). Obviously, I would like to create as minimal a subclass as possible

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Dave
> You could do that, but OP is using storyboards. In that case, the proper way > to pass that info is in -prepareForSegue:. I took a look at prepareForSegue, but I'm not sure how it would help here? In the Storyboard I have a VC with a name of "LTWMusicViewController", there is NOT a "LTWRockMu

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Dave
, and your done. No > need for subclassing at all. > This code is in a method that takes the VC Class Name as a parameter, so, in order to do what you suggest I would beed code something like: Normally the code reads: myVC = [self.storyboard instantiateViewController: theViewControlle

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread David Duncan
LTWMusicViewController created with the Rock category, that you ensure it is set as such. So in -prepareForSegue, you get the instance of LTWMusicViewController that is about to be transitioned to, set its category to Rock, and your done. No need for subclassing at all. On Sep 4, 2013, at 1:08 PM, Dave wrote

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Dave
On 4 Sep 2013, at 15:02, Matt Neuburg wrote: > > On Sep 4, 2013, at 4:13 AM, cocoa-dev-requ...@lists.apple.com wrote: > >> Date: Wed, 04 Sep 2013 10:23:04 +0100 >> From: Dave >> Subject: Subclassing a View Controller in a Storyboard >> >> Hi All,

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Kyle Sluder
On Sep 4, 2013, at 7:02 AM, Matt Neuburg wrote: > > On Sep 4, 2013, at 4:13 AM, cocoa-dev-requ...@lists.apple.com wrote: > > What you're doing has a lot of bad smells: > > * If I'm only going to call instantiateViewController, why am I using a > storyboard here at all? If I use a .xib file in

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Kyle Sluder
On Wed, Sep 4, 2013, at 08:08 AM, Matt Neuburg wrote: > Maybe I just don't understand what the OP is trying to do. It seemed very > strange to me. m. Yes, more context would indeed help. It's not necessarily strange to want to use the same interface with multiple view controllers, but it does go

Re: Subclassing a View Controller in a Storyboard

2013-09-04 Thread Matt Neuburg
On Sep 4, 2013, at 4:13 AM, cocoa-dev-requ...@lists.apple.com wrote: > Date: Wed, 04 Sep 2013 10:23:04 +0100 > From: Dave > Subject: Subclassing a View Controller in a Storyboard > > Hi All, > > If I am using a Storyboard that contains a view controller, > LTWMusi

Subclassing a View Controller in a Storyboard

2013-09-04 Thread Dave
Hi All, If I am using a Storyboard that contains a view controller, LTWMusicViewController that I'd like to sub-class like so: LTWRockMusicViewController : LTWMusicViewController Then in the viewDidLoad method, do: -(void) viewDidLoad { [super viewDidLoad]; self.pMusicCategory = kRockMusicCat

Re: Subclassing IKImageView

2012-01-30 Thread Jan E. Schotsman
On Jan 29, 2012, at 6:27 PM, Fritz Anderson wrote: my next experiment would be to override the methods Indeed, that way I can easily do what I need (limit image drags to files and register dropped files): - (BOOL)performDragOperation:(id )sender { BOOLaccepted;

Re: Subclassing IKImageView

2012-01-29 Thread Jan E. Schotsman
w. How do I go about that? Can I make it accept image files but not images in general? I'd experiment with subclassing, then overriding the setImageWithURL: and setImage:imageProperties: methods. Possibly those aren't on the pipeline for drag-and-drop. In that case, my next

Re: Subclassing IKImageView

2012-01-29 Thread Fritz Anderson
o I go about that? > Can I make it accept image files but not images in general? I'd experiment with subclassing, then overriding the setImageWithURL: and setImage:imageProperties: methods. Possibly those aren't on the pipeline for drag-and-drop. In that case, my next experiment w

Subclassing IKImageView

2012-01-29 Thread Jan E. Schotsman
Hello, I want to modify IKImageView so that it erases with the window background color. By default it erases with medium gray which looks awful. I tried implementing -drawRect but this is only called when the window opens. It isn't even called when the image is set to nil. Can one set th

Re: Subclassing UIWebview a show-stopper?

2011-08-09 Thread David Duncan
were two ways to do something, and one involved subclassing UIWebView and the other did not, I would nearly always choose the method that didn't involved subclassing. So the question to you becomes what problem are you trying to solve that you believe you need to overr

Re: Subclassing UIWebview a show-stopper?

2011-08-08 Thread Dave DeLong
Hi Arri, Subclassing UIWebView is probably not going to get your app rejected (though I have no insight in to the approval process). However from a architecture point-of-view, it "smells" bad. UIWebView is one of those views that's not intended to be subclassed. Sure you can

Subclassing UIWebview a show-stopper?

2011-08-08 Thread arri
how i've always understood the word "should" and i could read the docs as such: "…there shouldn't be a need to subclass…". In other words: subclassing UIWebview will not result in a rejection. thanks, arri ___ Cocoa-dev

Re: Subclassing UItextview

2011-06-04 Thread Philip Vallone
Thank you Conrad for your feedback. > Finally, depending on how many webviews you use, you might massacre the > performance of UITableView scrolling. Luckily, I am not using UITableView. I have implement the UIWebView and it works well. I am not sure if the issues you mentioned are still issue

Re: Subclassing UItextview

2011-06-04 Thread Conrad Shultz
On Jun 4, 2011, at 7:22, Fritz Anderson wrote: > > UITextView does not render multiple styles, nor offer link-like behavior. To > subclass, you'd have to rip out most of the implementation. If you want those > things, use UIWebView, which is what the other apps (at least the ones > written by

Re: Subclassing UItextview

2011-06-04 Thread Philip Vallone
Thanks Fritz. This is a great suggestion. On Jun 4, 2011, at 10:22 AM, Fritz Anderson wrote: > On 4 Jun 2011, at 8:32 AM, Philip Vallone wrote: > >> I am taking a shot at creating a Twitter App. I was wondering if its >> possible to Subclass UItextview to detect hashes and respond to them. F

Re: Subclassing UItextview

2011-06-04 Thread Fritz Anderson
On 4 Jun 2011, at 8:32 AM, Philip Vallone wrote: > I am taking a shot at creating a Twitter App. I was wondering if its possible > to Subclass UItextview to detect hashes and respond to them. For example: > > "This is a tweet #iamtrending" > > I've seen this done in other Apps, but not sure whe

Subclassing UItextview

2011-06-04 Thread Philip Vallone
Hi, I am taking a shot at creating a Twitter App. I was wondering if its possible to Subclass UItextview to detect hashes and respond to them. For example: "This is a tweet #iamtrending" I've seen this done in other Apps, but not sure where to start. Thanks for the help. Phil _

Re: Notifications and Subclassing

2011-03-08 Thread Gordon Apple
t;> Notification sent from elsewhere. Console: >> >> -[NSCFString foo:]: unrecognized selector sent to instance 0x69807c0 >> >> >> Is this due to confusion of of which class received the notification? Or is >> this a compiler/linker bug? I even

Re: Notifications and Subclassing

2011-03-08 Thread glenn andreas
ole: > > -[NSCFString foo:]: unrecognized selector sent to instance 0x69807c0 > > > Is this due to confusion of of which class received the notification? Or is > this a compiler/linker bug? I even tried declaring foo in A’s headers, to > no avail. This same overall procedure

Notifications and Subclassing

2011-03-08 Thread Gordon Apple
notification? Or is this a compiler/linker bug? I even tried declaring foo in A¹s headers, to no avail. This same overall procedure is used elsewhere (without subclassing), with no problems. What am I missing? ___ Cocoa-dev mailing list (Cocoa-dev

Re: Dynamically subclassing an observed object

2010-10-13 Thread Dave DeLong
m > liable to crash. This is what necessitated the auto-cleanup subclassing in > the first place. Would a CFMutableDictionaryRef allow me to get around this > issue? > > Dave > > On Oct 13, 2010, at 3:47 PM, Kyle Sluder wrote: > >> Alternatively, you could go back to

Re: Dynamically subclassing an observed object

2010-10-13 Thread Dave DeLong
hat necessitated the auto-cleanup subclassing in the first place. Would a CFMutableDictionaryRef allow me to get around this issue? Dave On Oct 13, 2010, at 3:47 PM, Kyle Sluder wrote: > On Wed, Oct 13, 2010 at 2:02 PM, Dave DeLong wrote: >> As for the rationale behind why I need to d

Re: Dynamically subclassing an observed object

2010-10-13 Thread Kyle Sluder
On Wed, Oct 13, 2010 at 2:02 PM, Dave DeLong wrote: > As for the rationale behind why I need to do this, I'll just refer to my blog > post on the matter:   > http://davedelong.com/blog/2010/10/07/fun-objective-c-dynamic-subclassing Funny enough, it sounds like the blog post I link

Re: Dynamically subclassing an observed object

2010-10-13 Thread Dave DeLong
As for the rationale behind why I need to do this, I'll just refer to my blog post on the matter: http://davedelong.com/blog/2010/10/07/fun-objective-c-dynamic-subclassing Cheers, Dave On Oct 13, 2010, at 2:54 PM, Ken Thomases wrote: > On Oct 13, 2010, at 2:44 PM, Dave DeLong wrote: >

Re: Dynamically subclassing an observed object

2010-10-13 Thread Ken Thomases
On Oct 13, 2010, at 2:44 PM, Dave DeLong wrote: > I maintain some code that does dynamic subclassing to override an object's > -dealloc method to do some extra cleanup prior to deallocation. (And for the > curious, this cleanup is not necessary when using Garbage Collection)

Re: Dynamically subclassing an observed object

2010-10-13 Thread Kyle Sluder
On Wed, Oct 13, 2010 at 12:44 PM, Dave DeLong wrote: > What's involved with safely subclassing an object that's already been > dynamically subclassed with KVO? You can't. See the comments here: http://www.mikeash.com/pyblog/friday-qa-2010-07-16-zeroing-weak-reference

Dynamically subclassing an observed object

2010-10-13 Thread Dave DeLong
Hi everyone, I maintain some code that does dynamic subclassing to override an object's -dealloc method to do some extra cleanup prior to deallocation. (And for the curious, this cleanup is not necessary when using Garbage Collection) However, I observed a problem this morning, and t

Re: NSThread Subclassing problem for Singleton instance

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 12:33 PM, Abhinav Tyagi wrote: > Thanks for giving your valuable time to this post. > I have been working on Mac platform since last 5 months prior to which I have > worked on Windows platform. > I have used threads using  NSThread's > detachNewThreadSelector:@selector() ea

NSThread Subclassing problem for Singleton instance

2010-07-12 Thread Abhinav Tyagi
Hi, Thanks for giving your valuable time to this post. I have been working on Mac platform since last 5 months prior to which I have worked on Windows platform. I have used threads using NSThread's detachNewThreadSelector:@selector() earlier and they worked fine. However this time my thread is no

Subclassing and Relationships - different xcdatamodels

2010-03-22 Thread Alexander Spohr
model B by subclassing entity ASuperclass in model A? 2) create a relationship from entity BSub to entity AOther? 3) create a relationship from entity AOther to entity BSub in code? I could not find anything working for this in XCode. Did I look in the wrong place or is it just not possible

Re: iPhone: subclassing UIView for blendmode

2010-01-22 Thread David Duncan
On Jan 22, 2010, at 6:49 AM, Eric E. Dolecki wrote: > Sorry this is a noob question, but I am try to get blendmode to work for > images. What I have done so far that seems to do nothing: > > I create a new class called ImageView which subclasses UIView. I have done > nothing in the initWithFrame,

iPhone: subclassing UIView for blendmode

2010-01-22 Thread Eric E. Dolecki
Sorry this is a noob question, but I am try to get blendmode to work for images. What I have done so far that seems to do nothing: I create a new class called ImageView which subclasses UIView. I have done nothing in the initWithFrame, only in drawRect: - (void)drawRect:(CGRect)rect { CGContextR

Re: Subclassing a view class from an external framework

2009-10-17 Thread Kyle Sluder
Wow, reading comprehension failure on my part. Apologies for the noise. --Kyle Sluder ___ 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-admin

Re: Subclassing a view class from an external framework

2009-10-17 Thread Jeff Johnson
On Oct 17, 2009, at 1:32 PM, Kyle Sluder wrote: On Sat, Oct 17, 2009 at 11:30 AM, Jeff Johnson wrote: After further experimentation, I've found the problem. Interface Builder doesn't find private header files in a framework. When I changed the header file from private to public, Interface

Re: Subclassing a view class from an external framework

2009-10-17 Thread Kyle Sluder
On Sat, Oct 17, 2009 at 11:30 AM, Jeff Johnson wrote: > After further experimentation, I've found the problem. Interface Builder > doesn't find private header files in a framework. When I changed the header > file from private to public, Interface Builder found it. If it's a private header, how a

Re: Subclassing a view class from an external framework

2009-10-17 Thread Jeff Johnson
After further experimentation, I've found the problem. Interface Builder doesn't find private header files in a framework. When I changed the header file from private to public, Interface Builder found it. Interface Builder doesn't find private headers in framework -Jeff On Oct 17, 2

Re: Subclassing a view class from an external framework

2009-10-17 Thread Jeff Johnson
Hi Kevin. This occurs with both IB 3.2.1 on 10.6 and IB 3.1.2 on 10.5. In the IB info window I get these warnings: 1) The 'delegate' outlet of 'AHTSessionWindow' is connected to 'File's Owner' but 'delegate' is no longer defined on AHTWindow. 2) The 'window' outlet of 'File's Owner' is conn

Re: Subclassing a view class from an external framework

2009-10-15 Thread Mark Gallegly
Turns out the issue I was having was caused by the fact that I did not have the headers in the framework bundle, once I figured out how to add the header files to the framework - which was not easy to figure out - and did the 'reload all class files' menu item in IB for each xib the problem went aw

  1   2   3   >