Setting NSWindow to be transparent
I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen). Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before disappearing and then fading into view. Sure, it's a fast flick - but it's ugly, and not the effect that I'm looking for. Does anyone have any idea how to set opacity to 0 before displaying the window? Before we have the discussion about splash screens by the way, I'd just like to say 'I agree - I hate them too'. To justify my actions, this is because the app loads into the menu bar, not the dock, and so (in testing) I discovered that users thought it hadn't loaded at all. So, on first load only (unless specifically requested otherwise in preferences) a splash is displayed informing the user that the app has loaded - and to look up to the menu bar, not down to the dock. - (id)initSplash { if (self = [super initWithWindowNibName:@SplashScreen]) { (void) [splashWindow window]; [splashWindow setAlphaValue:0.0]; return self; } return nil; } ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Setting NSWindow to be transparent
I'm using the same effect in my application. The problem is, if you use this method, the window might not be there yet. Did you inspect if the window iVar is actually not nil? The way I did it is using the windowDidLoad method and call -(void)windowDidLoad { [super windowDidLoad] [splashWindow setAlphaValue:0.0]; } Works find for me. Code is here: https://github.com/mstarke/MacPass/blob/master/MacPass/MPOverlayWindowController.m -Michael On 16.06.2013, at 10:22, Pax 45rpmli...@googlemail.com wrote: I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen). Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before disappearing and then fading into view. Sure, it's a fast flick - but it's ugly, and not the effect that I'm looking for. Does anyone have any idea how to set opacity to 0 before displaying the window? Before we have the discussion about splash screens by the way, I'd just like to say 'I agree - I hate them too'. To justify my actions, this is because the app loads into the menu bar, not the dock, and so (in testing) I discovered that users thought it hadn't loaded at all. So, on first load only (unless specifically requested otherwise in preferences) a splash is displayed informing the user that the app has loaded - and to look up to the menu bar, not down to the dock. - (id)initSplash { if (self = [super initWithWindowNibName:@SplashScreen]) { (void) [splashWindow window]; [splashWindow setAlphaValue:0.0]; return self; } return nil; } ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com This email sent to michael.sta...@hicknhack-software.com ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Setting NSWindow to be transparent
Forget what I said. If the value takes effect, window isn't nil. The trick is to uncheck show window on launch. If I chekc that box, my window is visible at first too. - Michael On 16.06.2013, at 10:33, Michael Starke michael.sta...@hicknhack-software.com wrote: I'm using the same effect in my application. The problem is, if you use this method, the window might not be there yet. Did you inspect if the window iVar is actually not nil? The way I did it is using the windowDidLoad method and call -(void)windowDidLoad { [super windowDidLoad] [splashWindow setAlphaValue:0.0]; } Works find for me. Code is here: https://github.com/mstarke/MacPass/blob/master/MacPass/MPOverlayWindowController.m -Michael On 16.06.2013, at 10:22, Pax 45rpmli...@googlemail.com wrote: I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen). Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before disappearing and then fading into view. Sure, it's a fast flick - but it's ugly, and not the effect that I'm looking for. Does anyone have any idea how to set opacity to 0 before displaying the window? Before we have the discussion about splash screens by the way, I'd just like to say 'I agree - I hate them too'. To justify my actions, this is because the app loads into the menu bar, not the dock, and so (in testing) I discovered that users thought it hadn't loaded at all. So, on first load only (unless specifically requested otherwise in preferences) a splash is displayed informing the user that the app has loaded - and to look up to the menu bar, not down to the dock. - (id)initSplash { if (self = [super initWithWindowNibName:@SplashScreen]) { (void) [splashWindow window]; [splashWindow setAlphaValue:0.0]; return self; } return nil; } ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com This email sent to michael.sta...@hicknhack-software.com ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Accelerate Framework?
Hi Rick, Where to go for questions about the Accelerate Framework? I have a fairly good knowledge of the Accelerate framework and its opensource counterpart, Atlas. If I might be of any help, don’t hesitate. Vincent ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Setting NSWindow to be transparent
I've done those things already in my experimentation. Trouble is, my window is for a different window controller - not Application Delegate - and the window loads when the class does. Show Window On Launch doesn't seem to make any difference. On 16 Jun 2013, at 09:33, Michael Starke michael.sta...@hicknhack-software.com wrote: I'm using the same effect in my application. The problem is, if you use this method, the window might not be there yet. Did you inspect if the window iVar is actually not nil? The way I did it is using the windowDidLoad method and call -(void)windowDidLoad { [super windowDidLoad] [splashWindow setAlphaValue:0.0]; } Works find for me. Code is here: https://github.com/mstarke/MacPass/blob/master/MacPass/MPOverlayWindowController.m -Michael On 16.06.2013, at 10:22, Pax 45rpmli...@googlemail.com wrote: I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen). Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before disappearing and then fading into view. Sure, it's a fast flick - but it's ugly, and not the effect that I'm looking for. Does anyone have any idea how to set opacity to 0 before displaying the window? Before we have the discussion about splash screens by the way, I'd just like to say 'I agree - I hate them too'. To justify my actions, this is because the app loads into the menu bar, not the dock, and so (in testing) I discovered that users thought it hadn't loaded at all. So, on first load only (unless specifically requested otherwise in preferences) a splash is displayed informing the user that the app has loaded - and to look up to the menu bar, not down to the dock. - (id)initSplash { if (self = [super initWithWindowNibName:@SplashScreen]) { (void) [splashWindow window]; [splashWindow setAlphaValue:0.0]; return self; } return nil; } ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com This email sent to michael.sta...@hicknhack-software.com ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/45rpmlists%40googlemail.com This email sent to 45rpmli...@googlemail.com ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Accelerate Framework?
On Sat, 15 Jun 2013 13:33:20 -0700, Rick Mann said: Where to go for questions about the Accelerate Framework? https://lists.apple.com/mailman/listinfo/perfoptimization-dev Sean ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: popup menus and toolbar buttons
On 15 Jun 2013, at 19:33, Eric Smith eric_h_sm...@mac.com wrote: Anyone know how to attach a popup menu to a toolbar button, as with the 'run' button in Xcode? I want to give users a choice of action via a popup menu if they hold down one of my toobar buttons. I have code for doing this here: https://bitbucket.org/mikeabdullah/bwtoolkit/src/c03ecd984756c2f27d6fe3f8d5e938f840178e9b/BWIWorkPopUpButton.h?at=default https://bitbucket.org/mikeabdullah/bwtoolkit/src/c03ecd984756c2f27d6fe3f8d5e938f840178e9b/BWIWorkPopUpButton.m?at=default Which you're welcome to use in your app with proper attribution. ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: popup menus and toolbar buttons
If you have an NSSegmentedControl with only one segment and a menu, the menu only pops up if you press and hold the button, otherwise it acts like a normal button. That sounds like what you want. - Original Message - From: Eric Smith eric_h_sm...@mac.com To: cocoa-dev@lists.apple.com Sent: Saturday, June 15, 2013 11:33:05 AM Subject: popup menus and toolbar buttons Anyone know how to attach a popup menu to a toolbar button, as with the 'run' button in Xcode? I want to give users a choice of action via a popup menu if they hold down one of my toobar buttons. Thanks in advance, Eric ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: popup menus and toolbar buttons
On 16 Jun 2013, at 18:39, Lee Ann Rucker lruc...@vmware.com wrote: If you have an NSSegmentedControl with only one segment and a menu, the menu only pops up if you press and hold the button, otherwise it acts like a normal button. That sounds like what you want. Ooh, that's a good one to know, thanks! ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multiple Observations
You have a valid point. However, awakeFromNib is a traditional place to setup observers, etc. Plus, the docs even recommend this: ³Important: It is possible that your datasource methods for populating the outline view may be called before awakeFromNib is called if the datasource is specified in Interface Builder. You should defend against this by having the datasource¹s outlineView:numberOfChildrenOfItem: method return 0 for the number of children when the datasource has not yet been configured. In awakeFromNib, when the datasource is initialized you should always call reloadData (inherited from the superclass NSTableView) on the resulting outline view.² This indicates that they expect you to use awakeFromNib. Of course, this does not mean you cannot do something smarter. As Kyle has so adeptly pointed out, the behavior is actually consistent with the docs for view-based outline views. However, it may not technically be a bug, but is is certainly a potential problem, requiring a work-around (i.e., the blocking flag) to prevent unwanted behavior, or, as you point out, avoiding the use of awakeFromNib. At the very least, IMHO, the docs should have a caveat, such as the above, to forewarn users of this issue. Ideally, they should fix the problem. As such, I have filed this as a bug report, referring to this discussion: 14168920. On 6/16/13 7:23 AM, sli...@araelium.com wrote: On Jun 15, 2013, at 1:32 PM, Gordon Apple wrote: I still think the compiler should be smart enough to block this without having to put a on-shot blocking flag in awakeFromNib, which I have now done. My question would be, why are you using awakeFromNib specifically in the first place? I really do find that it's not the right place to do things. IMO an instance should not expect to be loaded from a nib (which means it shouldn't use awakeFromNib), and any File's Owner which is loading a nib can perform its duties after loading the nib rather than in its own awakeFromNib. When both of those things are true, there are better places to do setup work and avoids the whole mess of trying to manage flags for which awakeFromNib call is mapped to which nib load. ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Full-height toolbar items
I'm working on a library for doing full-height toolbar items, like the center status display in Instruments, Xcode, and iTunes. I'm not completely finished yet, but I have reached a point where I'd like to share it. Feedback is welcome. https://github.com/Uncommon/UUFullHeightToolbar ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Confused by memory issue with UIDatePicker
Dear List, I am using manual retain count memory management (started long before ARC was available) for an iOS app. I have a UIDatePicker in an .xib file with its File's Owner set to a custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from UIViewController, and has an IBOutlet attached to the UIDatePicker. The MyTimeDateVC instance is created in code, in response to a button tap: MyTimeDatePickerVC *myTimeDatePickerVC = [[[MyTimeDatePickerVC alloc] initWithVoucherType:VoucherTimeTypeSurgery andInitialTimes:myInitialTimesDict] autorelease]; [self.navigationController pushViewController:myTimeDatePickerVC animated:YES]; The entire view is dismissed in response to a button tap in its view: [self.navigationController popViewControllerAnimated:YES]; However, if I don't specifically release the UIDatePicker object in the view controller's dealloc, it leaks. If I include [myTimeDatePickerUIOutlet release] in dealloc, it doesn't leak and it works fine. My question is: why should I be releasing this object at all? Or, should I explicitly be creating it somewhere, but I'm not, so the runtime is creating it for me as a courtesy (seems unlikely)? There's a UITableView in the same view (with a corresponding IBOutlet in the same ViewController header), but I don't create or release that explicitly. What have I missed? Do these pickers get treated differently for some reason? (Should I also be releasing the UITableView? The UIButtons?) Thanks for any insight. Best Regards, Dan ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Confused by memory issue with UIDatePicker
Sorry, I should have been more precise: The problem is progressive memory growth each time the ViewController is displayed. If I add the [release], the memory footprint reverts to its pre-viewcontroller display level each time the VC is dismissed. -Dan ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Jun 16, 2013, at 15:30 , Daniel Wambold wambo...@gmail.com wrote: I have a UIDatePicker in an .xib file with its File's Owner set to a custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from UIViewController, and has an IBOutlet attached to the UIDatePicker. What does the IBOutlet declaration for the UIDatePicker look like? ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
Quincey Morris wrote: I have a UIDatePicker in an .xib file with its File's Owner set to a custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from UIViewController, and has an IBOutlet attached to the UIDatePicker. What does the IBOutlet declaration for the UIDatePicker look like? @interface MyTimeDatePickerVC : UIViewController UITableViewDelegate, UITableViewDataSource { IBOutlet UIDatePicker *myTimeDatePickerUI; The connection is shown in the margin as the circle with a central dot, as expected, and on inspection, it shows it's connected to the MyDateTimePickerVC~iphone's Picker. -W ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Sun, Jun 16, 2013, at 05:00 PM, Daniel Wambold wrote: Quincey Morris wrote: I have a UIDatePicker in an .xib file with its File's Owner set to a custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from UIViewController, and has an IBOutlet attached to the UIDatePicker. What does the IBOutlet declaration for the UIDatePicker look like? @interface MyTimeDatePickerVC : UIViewController UITableViewDelegate, UITableViewDataSource { IBOutlet UIDatePicker *myTimeDatePickerUI; The connection is shown in the margin as the circle with a central dot, as expected, and on inspection, it shows it's connected to the MyDateTimePickerVC~iphone's Picker. From Managing Nib Objects in iOS, in the Legacy Patterns section of the Nib Files chapter of the Resource Programming Guide http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW19: As it rebuilds the object hierarchy, UIKit reestablishes connections between the objects using setValue:forKey:, which uses the available setter method or retains the object by default if no setter method is available. This means that (assuming you follow the pattern shown above) any object for which you have an outlet remains valid. For this reason, that document recommends you use a weak declared property for outlets to non-top-level objects. You should probably follow that recommendation. --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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
Kyle Sluder k...@ksluder.com wrote: On Sun, Jun 16, 2013, at 05:00 PM, Daniel Wambold wrote: Quincey Morris wrote: I have a UIDatePicker in an .xib file with its File's Owner set to a custom class, MyTimeDatePickerVC. The MyTimeDatePickerVC inherits from UIViewController, and has an IBOutlet attached to the UIDatePicker. What does the IBOutlet declaration for the UIDatePicker look like? @interface MyTimeDatePickerVC : UIViewController UITableViewDelegate, UITableViewDataSource { IBOutlet UIDatePicker *myTimeDatePickerUI; The connection is shown in the margin as the circle with a central dot, as expected, and on inspection, it shows it's connected to the MyDateTimePickerVC~iphone's Picker. From Managing Nib Objects in iOS, in the Legacy Patterns section of the Nib Files chapter of the Resource Programming Guide http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW19: As it rebuilds the object hierarchy, UIKit reestablishes connections between the objects using setValue:forKey:, which uses the available setter method or retains the object by default if no setter method is available. This means that (assuming you follow the pattern shown above) any object for which you have an outlet remains valid. For this reason, that document recommends you use a weak declared property for outlets to non-top-level objects. You should probably follow that recommendation. --Kyle Sluder Indeed, I should. Thank you for pointing me to this document, Kyle. Best regards, -Dan ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Jun 16, 2013, at 17:29 , Kyle Sluder k...@ksluder.com wrote: For this reason, that document recommends you use a weak declared property for outlets to non-top-level objects. You should probably follow that recommendation. Under the circumstances, since this is a manual RR app, just releasing the UIDatePicker [ivar] in dealloc might be a superior approach. If the UIDatePicker is a *top-level* object in the nib, the IBOutlet needs to be a strong reference -- unless there is some other guarantee that it will outlive the nib itself. If it's not a top-level object, then the lifetime of whatever is keeping it alive needs to be considered instead. In either case, using a strong reference seems more robust, since it doesn't involve reasoning about the lifetime dependences, at the slight cost of an explicit release. ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Jun 16, 2013, at 6:08 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 16, 2013, at 17:29 , Kyle Sluder k...@ksluder.com wrote: For this reason, that document recommends you use a weak declared property for outlets to non-top-level objects. You should probably follow that recommendation. Under the circumstances, since this is a manual RR app, just releasing the UIDatePicker [ivar] in dealloc might be a superior approach. Meh. As a Mac programmer, your approach would indeed be my instinct, but I'm trying to train myself to be more modern. Then there's the question of whether -dealloc is appropriate, or if the view should be released sooner (to avoid a retain cycle). What's the story with memory warnings nowadays? UIViewController never jettisons your views anymore, right? Is doing it yourself no longer recommended? --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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: IB keeps changing my constraints when I resize the cell
On Jun 15, 2013, at 20:00 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 15, 2013, at 19:31 , Rick Mann rm...@latencyzero.com wrote: There's a setting for Automatic…where does it get it from then? AFAIK, it means the row height is set automatically based on the control size (small/medium/large). Ah, I see. They should say standard height, then, perhaps. Also, is there no way, using bindings, and no delegate, to choose among multiple NSTableViewCell implementations? I thought the 2011 WWDC video said it was possible, but I didn't quite understand what it was referring to. Unfortunately, there's no straightforward pure-bindings example to look at. There's no way within the design-time table view itself. If the table uses bindings and there's no delegate, the column identifier is used to choose the cell view to instantiate, which can be the design-time cell view or a view in its own registered nib, but can't be varied by row. It seems that a property on the object could provide the identifier to use. If you want to choose between cell views by row, you need to put each cell view in its own nib, register each nib with the table view under a unique identifier, then implement the 'tableView/outlineView:viewFor…' delegate method to decide which identifier to use. It's very easy to do -- all it needs is to invoke 'makeViewWithIdentifier…' with a suitable identifier. I can just put these in the table view, and instantiate them by identifier, right? They don't have to actually be in separate nibs, do they? That's not what I gleaned from the WWDC video. BTW, it can be much harder to vary the row height based on the cell view. You'd either need to cache all possible cell view heights in advance, or have a mechanism to calculate the cell view heights before view instantiation, or some combination of the two approaches. Yeah. Typically on iOS I just get the cell for the row in the delegate and return its height. I had hoped there was a better mechanism in the context of bindings and autolayout. In the philosophy of autolayout, the cells should know their own height. Anyway, I'll just implement the delegate method. Thanks! -- Rick ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Jun 16, 2013, at 18:16 , Kyle Sluder k...@ksluder.com wrote: Meh. As a Mac programmer, your approach would indeed be my instinct, but I'm trying to train myself to be more modern. Better still, it occurred to me after posting, would be to use Refactor… to convert the app to ARC. That would be even more modern. I suspect it's easier to do this with an iOS app than with a Mac app, since iOS has fewer classes that have some ARC-related restriction. ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confused by memory issue with UIDatePicker
On Jun 16, 2013, at 9:08 PM, Quincey Morris wrote: On Jun 16, 2013, at 17:29 , Kyle Sluder k...@ksluder.com wrote: For this reason, that document recommends you use a weak declared property for outlets to non-top-level objects. You should probably follow that recommendation. Under the circumstances, since this is a manual RR app, just releasing the UIDatePicker [ivar] in dealloc might be a superior approach. If the UIDatePicker is a *top-level* object in the nib, the IBOutlet needs to be a strong reference -- unless there is some other guarantee that it will outlive the nib itself. If it's not a top-level object, then the lifetime of whatever is keeping it alive needs to be considered instead. In either case, using a strong reference seems more robust, since it doesn't involve reasoning about the lifetime dependences, at the slight cost of an explicit release. For what it's worth, the Apple doc went on to say, for legacy memory management (I feel so old!): For iOS, you should use: @property (nonatomic, retain) IBOutlet UserInterfaceElementClass *anOutlet; Then: You should then either synthesize the corresponding accessor methods, or implement them according to the declaration, and (in iOS) release the corresponding variable in dealloc. I did this, with a @synthesize up front and an explicit release in the dealloc. Instruments shows the favorable return of memory when the UI is popped. Thanks again for the assistance! -Dan ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Causes of Cannot update object that was never inserted
About once a month, I get a report from a user indicating that my app raised an exception, Cannot update object that was never inserted. Last week I got two of these, so I'm looking harder to try and find the cause. I presume this object is a Core Data managed object. From reading on this topic, I've gleaned two possible causes of this exception… 1. Managed object was created with -init instead of +[NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:]. 2. Managed object's context was accessed from multiple threads. Maybe an updating thread got ahead of the inserting thread somehow? That would be weird. Are there any other causes of Cannot update object that was never inserted that I should be looking for? Thank you, Jerry Krinock ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Causes of Cannot update object that was never inserted
I believe that ALAssetLibrary uses Core Data, so the problem could be a user's messed up image library. Having just been through hell due to a corrupted iTunes library on my device, I can say that such problems can lead to very inconsistent behavior. Julian -- Julian Richardson, PhD www.ternary.ws On Jun 16, 2013, at 10:13 PM, Jerry Krinock je...@ieee.org wrote: About once a month, I get a report from a user indicating that my app raised an exception, Cannot update object that was never inserted. Last week I got two of these, so I'm looking harder to try and find the cause. I presume this object is a Core Data managed object. From reading on this topic, I've gleaned two possible causes of this exception… 1. Managed object was created with -init instead of +[NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:]. 2. Managed object's context was accessed from multiple threads. Maybe an updating thread got ahead of the inserting thread somehow? That would be weird. Are there any other causes of Cannot update object that was never inserted that I should be looking for? Thank you, Jerry Krinock ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/julian.richardson%40gmail.com This email sent to julian.richard...@gmail.com ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Causes of Cannot update object that was never inserted
On 2013 Jun 16, at 22:22, Julian Richardson julian.richard...@gmail.com wrote: I believe that ALAssetLibrary uses Core Data, so the problem could be a user's messed up image library. Thank you, Julian. I don't think that's the problem here. The error logged indicates that the object's entity is one of my entities. All but one of its attributes are nil/default. The non-nil attribute is its name = untitled, which gets assigned within a few code-lines after insertion. You may have kicked me in an interesting direction. Also, I should have said that this app is OS X. ___ 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com