Re: Infinite Scroll View?
On 7 Oct 2013, at 19:54, Kyle Sluder k...@ksluder.com wrote: On Mon, Oct 7, 2013, at 09:21 AM, Dave wrote: Hi, I'd like to be able to Scroll Infinitely in a Scroll, e.g. when the scrolling is past the last item in the Scroll start displaying the first and when scrolling before the first item, starting displaying the last. The items in this case are UIImageViews and they have a fixed height and a variable width and no one image will be wider that the Scroll View itself. Also it needs to work with pagingEnables = NO, e.g. there will be more than one Image visible. I've playing around a bit and found a some sample code that sort of does it but it doesn't handle the wrapping the Images smoothly (is was written to have paging enabled). My plan was/is to detect when the scrolling had hit before the first/after the last and to move the first Subview to the End or the Last one to the beginning, depending on the direction of movement, but at the moment, I can't seem to see a way of detecting these conditions. It seems fairly straightforward, if a little labor intensive, to figure out the width and placement of all your image views, override -layoutSubviews to position only the ones that are potentially visible, and implement -scrollViewWillEndDragging:withVelocity:targetContentOffset: to figure out where to end scrolling, based on the current velocity. --Kyle Sluder Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track 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/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: Infinite Scroll View?
On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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
Is inout documented anywhere?
Hi, I've just come across this: - (void) scrollViewWillEndDragging:(UIScrollView*) theScrollView withVelocity:(CGPoint) theVelocity targetContentOffset:(inout CGPoint*) theTargetContentOffset I've never seen the inout keyword before! It is documented anyway? I tried searching but can't find anything that describes how it is supposed to work? Thanks a lot 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/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: Is inout documented anywhere?
Hi, On Oct 8, 2013, at 1:29 PM, Dave d...@looktowindward.com wrote: I've never seen the inout keyword before! It is documented anyway? I tried searching but can't find anything that describes how it is supposed to work? You can refer to their meanings here http://stackoverflow.com/questions/5609564/objective-c-in-out-inout-byref-byval-and-so-on-what-are-they. Apparently they are no longer explained on Apple’s documentations (which is a shame, but you can file a radar for it). Best, Igor ___ 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: Is inout documented anywhere?
On 8 Oct 2013, at 12:35, Igor Elland igor.ell...@me.com wrote: Hi, On Oct 8, 2013, at 1:29 PM, Dave d...@looktowindward.com wrote: I've never seen the inout keyword before! It is documented anyway? I tried searching but can't find anything that describes how it is supposed to work? You can refer to their meanings here http://stackoverflow.com/questions/5609564/objective-c-in-out-inout-byref-byval-and-so-on-what-are-they. Apparently they are no longer explained on Apple’s documentations (which is a shame, but you can file a radar for it). Best, Igor Cheers Igor! 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/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Responder chain query
I am building an OS X NSDocument app with a fairly complex view hierarchy and want to interpose my view controllers into the responder chain (this I can do). Some of the displayed views will feature just a button (to enable creation of a new object). This means that the first responder will be the window itself (I don't really want to change the default NSButton firstResponder refusal behaviour). My intention is track the status of my top level view controllers and insert/remove these as required in the responder chain between the window and the window controller (rather than between views in the chain). That way I figure that actions and validation methods will always hit the view controller regardless of whether an NSView based first responder exists. Is this the best approach? The responder chain used in a particular situation does vary: https://developer.apple.com/library/mac/documentation/cocoa/conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/1060i-CH3-SW2 Jonathan ___ 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
Safari on Smart Card enrollment
Hello All, Does Safari support smart card enrollment? I have tried to use safari to install certificate into the smart card but it seems to just save the cert in a file by default. Is this the default behavior? In Mozilla, I am able to install the certificate into the smart card so I am wondering if this is a limitation on safari? By the way I can do SSL authentication using smart card in Safari, I just can't do the enrollment. Thanks, Charisse ___ 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
resetCursorRects: in AVPlayerView?
Are custom cursors not supported in AVPlayerView? Unless I’m doing something wrong, it seems to be the case. I implemented resetCursorRects: in my custom AVPlayerView subclass to set the cursor to one of the NSCursor’s built-in instances, and I call invalidateCursorRectsForView: on its window. Debugging shows my resetCursorRects: method is called appropriately. However, the cursor doesn’t display; the arrow pointer is always shown. This happens both in my project, and in Apple’s sample AVKitPlayer project. The only way I could get a custom cursor to show was to overlay another NSView atop the AVPlayerView and use that to handle the mouse. Any ideas? Karl Moskowski kmoskow...@me.com http://about.me/kolpanic ___ 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: Responder chain query
On Oct 8, 2013, at 8:40 AM, jonat...@mugginsoft.com wrote: My intention is track the status of my top level view controllers and insert/remove these as required in the responder chain between the window and the window controller (rather than between views in the chain). That way I figure that actions and validation methods will always hit the view controller regardless of whether an NSView based first responder exists. Is this the best approach? Yup. Been doing it for years. There was some code written by Cathy Shive and Jonathan Dann to help with that called XSViewController. Don't know where the original source is now, but basically it managed a tree of view controllers by adding a parent-child relationship between view controllers, with the tree attached to the XSWindowController. VCs could easily be attached and removed from the tree and it would reconnect the responder chain correctly. -- Seth Willits ___ 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: Is inout documented anywhere?
On Oct 8, 2013, at 4:29 AM, Dave wrote: Hi, I've just come across this: - (void) scrollViewWillEndDragging:(UIScrollView*) theScrollView withVelocity:(CGPoint) theVelocity targetContentOffset:(inout CGPoint*) theTargetContentOffset I've never seen the inout keyword before! It is documented anyway? I tried searching but can't find anything that describes how it is supposed to work? Thanks a lot Dave It's something you need for NSDistantObject - I've used it so either it used to be in Apple docs or some Apple sample app uses it, but all I can find is this: http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSDistantObject.html Beware, if you don't use this method to set the protocol, the system might well ask the remote process for method signature information, and the remote process might get it wrong. This is because the class of the remote object needs to have been declared to conform to the protocol in order for it to know about any protocol qualifiers (the keywords bycopy, byref, in, out, inout, and oneway). If the author of the server process forgot to do this, the type information returned from that process may not be what you are expecting. ___ 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: Infinite Scroll View?
Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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: Responder chain query
On 8 Oct 2013, at 17:40, Seth Willits sli...@araelium.com wrote: On Oct 8, 2013, at 8:40 AM, jonat...@mugginsoft.com wrote: My intention is track the status of my top level view controllers and insert/remove these as required in the responder chain between the window and the window controller (rather than between views in the chain). That way I figure that actions and validation methods will always hit the view controller regardless of whether an NSView based first responder exists. Is this the best approach? Yup. Been doing it for years. There was some code written by Cathy Shive and Jonathan Dann to help with that called XSViewController. Don't know where the original source is now, but basically it managed a tree of view controllers by adding a parent-child relationship between view controllers, with the tree attached to the XSWindowController. VCs could easily be attached and removed from the tree and it would reconnect the responder chain correctly. I think this might be a version of what you are referring to: https://github.com/catshive/KTUIKit/blob/master/Framework/Controllers/KTViewController.m My implementation is simpler, using a couple of category methods on NSWindow to patch in my view controllers. However the tree implementation might be useful in future. Thanks J ___ 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: Infinite Scroll View?
Does (scrollView.contentOffset.x = 0) not work? How are you testing for it now? On Oct 8, 2013, at 12:20 PM, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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/punster%40mac.com This email sent to puns...@mac.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: Infinite Scroll View?
Well, it never goes less than -0 whatever that means so the is redundant and 0 is a valid offset, I need to detect a scroll to *before* 0, which I never get. Thanks Dave On 8 Oct 2013, at 21:26, Steve Christensen puns...@mac.com wrote: Does (scrollView.contentOffset.x = 0) not work? How are you testing for it now? On Oct 8, 2013, at 12:20 PM, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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/punster%40mac.com This email sent to puns...@mac.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: Infinite Scroll View?
Hi, Spoke too soon! I just can't seem to get my head around this. I can make it work, but I'm getting into an infinite loop because updating the scroll view is causing the delegates to fire again (AFAICT). I'm not sure what to put in layoutSubviews and what to put in the delegate methods. I'm beginning to think this just isn't possible with UIScrollView and wondering if I should burn a DTS Support Request on it. This would be so easy if I just had the source to UIScrollView! All the Best Dave On 8 Oct 2013, at 20:20, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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/dave%40looktowindward.com This email sent to d...@looktowindward.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
NSUserInterfaceItemIdentification -identifier vs -tag
The NSControl -tag property can be used to identify an action sender. Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose? It was introduced to support window restoration. The docs apply several caveats with regard to the identifier: https://developer.apple.com/library/mac/documentation/cocoa/reference/NSUserInterfaceItemIdentification_Protocol/Introduction/Introduction.html From the above: You should not change the value of a window’s identifier after adding any views to the window. For views and controls in a window, the value you specify for this string must be unique on a per-window basis. The slash (/), backslash (\), or colon (:) characters are reserved and must not be used in your custom identifiers. Similarly, Apple reserves all identifiers beginning with an underscore (_) character. Applications and frameworks should use a consistent prefix for their identifiers to avoid collisions with other frameworks. For a list of prefixes used by the system frameworks, see “OS X Frameworks” in Mac Technology Overview. Jonathan ___ 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: NSUserInterfaceItemIdentification -identifier vs -tag
On Oct 8, 2013, at 1:47 PM, jonat...@mugginsoft.com wrote: The NSControl -tag property can be used to identify an action sender. Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose? I don't know, but I'd prefer representedObject for something like that - it'll only be used by your code, so you don't have any restrictions to worry about. It was introduced to support window restoration. The docs apply several caveats with regard to the identifier: https://developer.apple.com/library/mac/documentation/cocoa/reference/NSUserInterfaceItemIdentification_Protocol/Introduction/Introduction.html From the above: You should not change the value of a window’s identifier after adding any views to the window. For views and controls in a window, the value you specify for this string must be unique on a per-window basis. The slash (/), backslash (\), or colon (:) characters are reserved and must not be used in your custom identifiers. Similarly, Apple reserves all identifiers beginning with an underscore (_) character. Applications and frameworks should use a consistent prefix for their identifiers to avoid collisions with other frameworks. For a list of prefixes used by the system frameworks, see “OS X Frameworks” in Mac Technology Overview. Jonathan ___ 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: NSUserInterfaceItemIdentification -identifier vs -tag
On 8 Oct 2013, at 21:54, Lee Ann Rucker lruc...@vmware.com wrote: On Oct 8, 2013, at 1:47 PM, jonat...@mugginsoft.com wrote: The NSControl -tag property can be used to identify an action sender. Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose? I don't know, but I'd prefer representedObject for something like that - it'll only be used by your code, so you don't have any restrictions to worry about. -tag and -identifier both have the advantage of being accessible from within IB. J ___ 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: Infinite Scroll View?
Did you check the StreetScroller sample? https://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011102 it is the same code that was demonstrated in the WWDC 2011 I told you before. -- :: marcelo.alves On 08/10/2013, at 17:30, Dave d...@looktowindward.com wrote: Hi, Spoke too soon! I just can't seem to get my head around this. I can make it work, but I'm getting into an infinite loop because updating the scroll view is causing the delegates to fire again (AFAICT). I'm not sure what to put in layoutSubviews and what to put in the delegate methods. I'm beginning to think this just isn't possible with UIScrollView and wondering if I should burn a DTS Support Request on it. This would be so easy if I just had the source to UIScrollView! All the Best Dave On 8 Oct 2013, at 20:20, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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/dave%40looktowindward.com This email sent to d...@looktowindward.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/marcelo.alves%40me.com This email sent to marcelo.al...@me.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: NSUserInterfaceItemIdentification -identifier vs -tag
On Oct 8, 2013, at 1:59 PM, jonat...@mugginsoft.com wrote: On 8 Oct 2013, at 21:54, Lee Ann Rucker lruc...@vmware.com wrote: On Oct 8, 2013, at 1:47 PM, jonat...@mugginsoft.com wrote: The NSControl -tag property can be used to identify an action sender. Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose? I don't know, but I'd prefer representedObject for something like that - it'll only be used by your code, so you don't have any restrictions to worry about. -tag and -identifier both have the advantage of being accessible from within IB. J Any simple object can be assigned to a variable in IB, just set them in User Defined Runtime Attributes in the 3rd tab. ___ 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: Infinite Scroll View?
Hi, Yes, I took a look, but it's not what I want to do. I have a number of variable width images, not fixed width and all the examples I've seen use pagingEnabled and have a fixed width. Also the Street Scroller sample, just creates a label view on demand, which, again isn't what I want. I have (say) 20 variable width images, so I want it to scroll from image 1 to 20 and then back to 1. The samples doesn't do anything like this. Thanks anyway, All the Best Dave On 8 Oct 2013, at 22:01, Marcelo Alves marcelo.al...@me.com wrote: Did you check the StreetScroller sample? https://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011102 it is the same code that was demonstrated in the WWDC 2011 I told you before. -- :: marcelo.alves On 08/10/2013, at 17:30, Dave d...@looktowindward.com wrote: Hi, Spoke too soon! I just can't seem to get my head around this. I can make it work, but I'm getting into an infinite loop because updating the scroll view is causing the delegates to fire again (AFAICT). I'm not sure what to put in layoutSubviews and what to put in the delegate methods. I'm beginning to think this just isn't possible with UIScrollView and wondering if I should burn a DTS Support Request on it. This would be so easy if I just had the source to UIScrollView! All the Best Dave On 8 Oct 2013, at 20:20, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset: {-0, 0} But that doesn't do me much good! It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left. Any idea greatly appreciated as I'm need to get this working for tomorrow morning! Thanks a lot. All the Best Dave On 8 Oct 2013, at 08:56, Kyle Sluder k...@ksluder.com wrote: On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows! This is what I got at the moment: // Scroll past last item detected (in the scrollViewDidScroll delegate method) if (theScrollView.contentSize.width - theScrollView.contentOffset.x = 1024) { myContentInfo = [self.pContentArray objectAtIndex:0]; [self.pContentArray addObject:myContentInfo]; [self.pContentArray removeObjectAtIndex:0]; [self addContentInfo:myContentInfo withEndFlag:YES]; } Which kind of works, but obviously isn't the way to do it. Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now. You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable. It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently. --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/dave%40looktowindward.com This email sent to d...@looktowindward.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/marcelo.alves%40me.com This email sent to marcelo.al...@me.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
Re: Infinite Scroll View?
Hi Dave, What about if you have some repetition of the images? Say the following is a container UIView that has all of your UIImageViews stacked horizontally and the width of the following view is far smaller than that of the UIScrollView it's contained in. The gray areas are duplicated image views, and the the white area is the true set of images. Say that in the previous image, the leftmost person is the first logical image in your set of data. In your viewDidLoad, you could set the contentOffset to the position of the first Person (ie. the leftmost white edge) with something like: - (void)viewDidLoad { CGFloat someXPos = CGRectGetWidth([pictures frame]) + CGRectGetWidth([reticle frame]); [scrollView setContentOffset:someXPos]; } Then, once the user breaches the threshold value that has duplicates (the gray areas), you call the following: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [scrollView setContentOffset:someXPos animated:NO]; } The intent is that the scroll view snaps the container UIView back to a position that contains no duplicates. The view has duplicates to account for the period of time between sampling of scroll events. Note that this suggestion is assuming that the images are fairly small, so that loading them all doesn't cause too much memory pressure (which is what I understood from earlier messages). Damian On Oct 8, 2013, at 4:53 PM, Dave d...@looktowindward.com wrote: Hi, Yes, I took a look, but it's not what I want to do. I have a number of variable width images, not fixed width and all the examples I've seen use pagingEnabled and have a fixed width. Also the Street Scroller sample, just creates a label view on demand, which, again isn't what I want. I have (say) 20 variable width images, so I want it to scroll from image 1 to 20 and then back to 1. The samples doesn't do anything like this. Thanks anyway, All the Best Dave signature.asc Description: Message signed with OpenPGP using GPGMail ___ 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: NSUserInterfaceItemIdentification -identifier vs -tag
On Oct 8, 2013, at 3:25 PM, Lee Ann Rucker wrote: On Oct 8, 2013, at 1:59 PM, jonat...@mugginsoft.com wrote: On 8 Oct 2013, at 21:54, Lee Ann Rucker lruc...@vmware.com wrote: On Oct 8, 2013, at 1:47 PM, jonat...@mugginsoft.com wrote: The NSControl -tag property can be used to identify an action sender. Can the NSUserInterfaceItemIdentification protocol property -identifier be safely used for the same purpose? I don't know, but I'd prefer representedObject for something like that - it'll only be used by your code, so you don't have any restrictions to worry about. -tag and -identifier both have the advantage of being accessible from within IB. J Any simple object can be assigned to a variable in IB, just set them in User Defined Runtime Attributes in the 3rd tab. To refute, or simply to be clear, as I understand (and I have been bitten by this accidentally) you can only assign values to defined (and possibly KVC-compliant) properties of an object in IB. If the specified key isn't defined, it will generate an exception. Also you can only assign a value of the defined types, and not just any object. So, you can assign arbitrary values but you cannot define arbitrary properties to existing objects, at least unless that has recently changed (haven't tested since 4.3). I would also add that tags and identifiers are dumb values--that is they have no intrinsic significance and can be used any way you like (IMHO). I think identifiers are better than tags as they lend themselves to be more human-manageable and have a level of uniqueness enforced Unlike tags, however, there isn't a way (yet, that I know of) to reference a view by its identifier. HTH, Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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