Re: Handling "Smart Zoom" gesture?
On 28/06/2012, at 4:30 PM, Richard Altenburg (Brainchild) wrote: > You should watch "Session 231 - What's New with Gestures" from the WWDC 2012 > video sessions... I did, but I have to target 10.6.x and later. Sorry I forget to mention that. BTW, features that are part of M Li.. are still under NDA. --Graham ___ 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: Handling "Smart Zoom" gesture?
The NDA is why I only gave you the title of the video, all developers in this list can access the WWDC videos and see for themselves what is new. I guess for 10.6 and 10.7 you could roll your own "Smart Zoom" functionality, but that is probably not what you wanted to hear. [[[Brainchild alloc] initWithName:@"Richard Altenburg"] saysBestRegards]; Op 28 jun. 2012, om 08:59 heeft Graham Cox het volgende geschreven: > I did, but I have to target 10.6.x and later. Sorry I forget to mention that. > BTW, features that are part of M Li.. are still under NDA. > ___ 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: Handling "Smart Zoom" gesture?
On 28/06/2012, at 5:06 PM, Richard Altenburg (Brainchild) wrote: > I guess for 10.6 and 10.7 you could roll your own "Smart Zoom" functionality, > but that is probably not what you wanted to hear. > > Yes, it is what I wanted to hear, or more precisely, some sort of pointer or "how to" about how I can do that. Specifically, the problem is that the -clickCount property of an NSEvent is only applicable to mouse events, not touch events. So what's the right way to trap this specific gesture? I have read the various touch-input documentation but nothing became obvious. --Graham ___ 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: Handling "Smart Zoom" gesture?
On Jun 28, 2012, at 00:14 , Graham Cox wrote: > Specifically, the problem is that the -clickCount property of an NSEvent is > only applicable to mouse events, not touch events. So what's the right way to > trap this specific gesture? I have read the various touch-input documentation > but nothing became obvious. The 10.6 document seems to imply that tapping isn't a gesture, so I'd assume you'd have to implement the NSResponder methods 'touches…WithEvent:' and use the event times to decide (a) if precisely 2 touches begin/end more or less simultaneously and (b) if a second 2-touch tap begins within a time interval after the 1st one [iOS defaults to 0.5 sec for this interval. Perhaps on the Mac you'd use something conditioned by the double-click time instead. I dunno.] and (c) if both 2-touch taps last less than some time interval [otherwise they'd represent a long press]. Something like that? ___ 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
nstableview remove/insert rows question
Hi, Got a view-based table view and instead of using reloadData I'm removing the existing rows and inserting the new rows so that I can have animation. I'm also resizing the window in-between these 2 steps because my window resizes to fit how many rows are in my table view. This works great when my window doesn't resize (due to same amount of rows) or resizes very little. However let's say I have only 2 rows then remove those 2 rows and resize the window (using setFrame:display:animate:) and finally insert a much larger amount of rows like 15 what happens is the top 5 or 6 rows animate as expected but the rows further down just appear as if I was calling reloadData. I have checked this and reloadData is not being called, but I can't figure out why all rows don't animate. Any ideas? Thanks, rc ___ 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: 10.6 SDk and 10.5 Deployment
Point well taken. As it turns out all issues were related to Xcode. -koko On Jun 27, 2012, at 2:03 PM, Kyle Sluder wrote: > On Jun 27, 2012, at 12:53 PM, koko wrote: > >> Ok, so what is the real truth regarding using a base SDK of 10.6 and a >> deployment target of 10.5? >> >> The blogosphere says this cannot be done and Apple says it is OK. >> >> We have issues running a 10.6 SDK build on a 10.5.8 system. >> >> We have a certain percentage of customers who are on 10.5.8. >> >> Who should I believe? Apple or the blogosphere? > > Rather than continue to ask in generalities, how about giving us some > specifics? > > What problems are you experiencing, exactly? What claims have you seen others > make asserting that your problems are insurmountable? What assurances from > Apple are you questioning? > > --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: 10.6 SDk and 10.5 Deployment
On Jun 27, 2012, at 2:53 PM, koko wrote: > Ok, so what is the real truth regarding using a base SDK of 10.6 and a > deployment target of 10.5? > > The blogosphere says this cannot be done and Apple says it is OK. > > We have issues running a 10.6 SDK build on a 10.5.8 system. > > We have a certain percentage of customers who are on 10.5.8. > > Who should I believe? Apple or the blogosphere? It can definitely be done in theory. In practice you have to test the heck out of it, because without the 10.5 SDK, there’s nothing keeping you from accidentally using 10.6+ APIs, whose effects will only show up by throwing runtime exceptions on 10.5. Charles ___ 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
Transparent NSTextField
Hi everybody, I’m trying to add a transparent editable NSTextField to a view. As long as the field is not editable (e.g. a label), everything is fine; but with an editable field, I get a background fill. I imagine this is under the window NSTextView responsibility. Has someone already succeeded in programming a totally transparent NSTextField, or shall I recourse to a CATextLayer instead? Thanks, 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: 10.6 SDk and 10.5 Deployment
Whenever you support an earlier OS, you should always have that earliest and all intermediate SDKs available, and you should make it a standard practice to build your products against those SDKs at least before releasing to customers just as you do an analyzer build. This will help you identify many of the cases where you need to safeguard against the use of unavailable APIs, methods, and classes. Oh, and you really should be turning on and listening to practically every warning possible. Then, after you do all that, testing definitely should be done. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Jun 28, 2012, at 8:13 AM, Charles Srstka wrote: > On Jun 27, 2012, at 2:53 PM, koko wrote: > >> Ok, so what is the real truth regarding using a base SDK of 10.6 and a >> deployment target of 10.5? >> >> The blogosphere says this cannot be done and Apple says it is OK. >> >> We have issues running a 10.6 SDK build on a 10.5.8 system. >> >> We have a certain percentage of customers who are on 10.5.8. >> >> Who should I believe? Apple or the blogosphere? > > It can definitely be done in theory. > > In practice you have to test the heck out of it, because without the 10.5 > SDK, there’s nothing keeping you from accidentally using 10.6+ APIs, whose > effects will only show up by throwing runtime exceptions on 10.5. > > Charles ___ 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
Sorting an NSTableView bound to an NSArrayController.
Hello, I'm writing an application that handles results for a running club. I have an NSTableView that has columns bound to a CoreData Entity such as Entries.arrangedObjects.position, position is an NSString that contains numbers such as @"1" and @"2" or @"" but the position can also be @"DNF" (Did not finish). I have a method in the WindowController that sorts the 'Entry' objects and handles these cases correctly returning an NSArray using: [array sortUsingComparator:^(id obj1, id obj2) { NSComparisonResult r; r = return (r); }]; How can I get my table view to work so that when the user clicks in the Pos. column I can do my custom sort? at present it is doing an ASCII sort so I get 1, 10, 100, then 2, 20, 200 etc... I now I need to put a key and sort descriptor in IB but don't know what code I have to add to the Entity ot WindowController to handle it. Thanks, regards, Rob. ___ 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: Transparent NSTextField
On 28 Jun 2012, at 10:22 AM, Vincent Habchi wrote: > I’m trying to add a transparent editable NSTextField to a view. As long as > the field is not editable (e.g. a label), everything is fine; but with an > editable field, I get a background fill. I imagine this is under the window > NSTextView responsibility. Has someone already succeeded in programming a > totally transparent NSTextField, or shall I recourse to a CATextLayer instead? My next step (which is my way of saying I haven't tried it) would be to investigate -[ windowWillReturnFieldEditor:toObject:], and set the field editor's backgroundColor (it's in NSText) to the transparent color. — F ___ 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: Transparent NSTextField
> My next step (which is my way of saying I haven't tried it) would be to > investigate -[ windowWillReturnFieldEditor:toObject:], and > set the field editor's backgroundColor (it's in NSText) to the transparent > color. I'll do that, yes. Besides, I need to override the cursor to make it look like an underscore _ (the whole point is to make the input field look like a vintage console editing field). I guess I'll not escape writing a custom NSTextView to serve as the window field editor. Thanks for the hint! 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: Transparent NSTextField
In IB you can set the "Draws Background" property to no (uncheck the box) or send the NSTextField a SetDrawsBackground: NO message. On Jun 28, 2012, at 11:22 AM, Vincent Habchi wrote: > Hi everybody, > > I’m trying to add a transparent editable NSTextField to a view. As long as > the field is not editable (e.g. a label), everything is fine; but with an > editable field, I get a background fill. I imagine this is under the window > NSTextView responsibility. Has someone already succeeded in programming a > totally transparent NSTextField, or shall I recourse to a CATextLayer instead? > > Thanks, > 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/3tothe4th%40comcast.net > > This email sent to 3tothe...@comcast.net Charlie Dickman 3tothe...@comcast.net ___ 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: Transparent NSTextField
Le 28 juin 2012 à 18:30, Charlie Dickman <3tothe...@comcast.net> a écrit : > In IB you can set the "Draws Background" property to no (uncheck the box) or > send the NSTextField a SetDrawsBackground: NO message. Yep, but that’s working only for non-editable fields. In an editable field, I get a background – but I suspect this is caused by highlighting. So I will try to override the standard highlighting behavior to get just some text coloring while letting the background clear. 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: Bidirectional, Manual Binding in custom control
On 2012 Jun 27, at 22:42, Quincey Morris wrote: > the setter should only contain the second part ("Set ivar, needsDisplay"). > > It seems to me this should prevent selection changes from rebounding onto the > data model. Yes. > Using mouseDown kinda feels wrong to me. Wouldn't it make more sense to do > the first part of the existing code ("Stuff to make reverse binding work") in > an action method? > >> - (IBAction) changeRating: (sender) { … > > That way you're not dependent on *how* the control gets a new value. OK, but effectively this means that I simply factor this -changeRating: action method out of my -mouseDown: method. Only -mouseDown: will invoke -changeRating: at this time. I don't think I've ever seen a control class implementing an action method, but I suppose that factoring as you suggest is a good practice to avoid bugs being introduced during future changes. ___ 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: Bidirectional, Manual Binding in custom control
On Jun 28, 2012, at 10:49 , Jerry Krinock wrote: > OK, but effectively this means that I simply factor this -changeRating: > action method out of my -mouseDown: method. Only -mouseDown: will invoke > -changeRating: at this time. > > I don't think I've ever seen a control class implementing an action method, > but I suppose that factoring as you suggest is a good practice to avoid bugs > being introduced during future changes. You're right, it makes no sense to use an action method. I was mistakenly eliding the distinction between the control and the view/controller containing/managing the control. I'd keep the factoring, though, for the reason you state. OTOH, I'm not sure now why your control needs a 'rating' ivar. Doesn't this just duplicate the value of the control's objectValue, and create extra housekeeping? ___ 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: Transparent NSTextField
Hi Vincent, Have you tried setDrawsBackground:NO on your NSTextField? Below was what I used. I don't know if any of the other instance variables I set are important for your case but they might be. HTH, Joel - (void) initTextField; { [self setBordered:NO]; [self setFocusRingType:NSFocusRingTypeNone]; [self setBezelStyle:NSTextFieldSquareBezel]; [self setBezeled:NO]; [self setEnabled:YES]; [self setSelectable:YES]; [self setEditable:YES]; [self setAlignment:NSNaturalTextAlignment]; [self setBackgroundColor:[NSColor whiteColor]]; [self setDrawsBackground:NO]; } This was the original message: Hi everybody, I’m trying to add a transparent editable NSTextField to a view. As long as the field is not editable (e.g. a label), everything is fine; but with an editable field, I get a background fill. I imagine this is under the window NSTextView responsibility. Has someone already succeeded in programming a totally transparent NSTextField, or shall I recourse to a CATextLayer instead? Thanks, 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
The Drag/Drop Pasteboard Nightmare
I have an application which I am trying to update to use the new pasteboard protocols, NSDragSession, etc. The new version requires Lion. Drag/drop has been an absolute nightmare. The main windows have to handle a large number of drop types, plus there is a separate library with its own coredata database which must also be able to store and provide a large number of types. The pasteboard handlers are monsters, which I have tried to parse out into more manageable chunks. My first level approach it to try to identify pasteboard objects which conform to the new protocols or have been placed into an NSPasteboardItem. The latter is being successfully used for private data types. (Can¹t use the read/write object protocols because these are managed objects and require a custom unarchiver. Yes, I¹ve filed an enhancement request about this.) Text handling has been especially difficult. I try to drag in text from MSWord (2008) or TextEdit, and have all kinds of issues. Apparently MS not only posts an RTF, but an image or a PDF of the text. ³canReadObjectForClasses² determines it has an NSImage class and I end up with a text image, not the text, which I would like to get or convert to an NSAttributedString. Somehow, it gets recognized as an NSImage object and attempts to use it as such. Although the application is for Lion, obviously, I still want it to work with pre-Lion apps. That means the application has to handle everything, old and new, and somehow come up with the best handler for whatever is on the pasteboard. It ain¹t easy. It might help if there were a pasteboard guide somewhere with suggestions and examples for how to handle complex pasteboards using both new and old techniques. If anyone has some words of wisdom on how to better attack this, they would be greatly appreciated. ___ 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: nstableview remove/insert rows question
On Jun 28, 2012, at 4:30 AM, Rick C. wrote: > Hi, > > Got a view-based table view and instead of using reloadData I'm removing the > existing rows and inserting the new rows so that I can have animation. I'm > also resizing the window in-between these 2 steps because my window resizes > to fit how many rows are in my table view. This works great when my window > doesn't resize (due to same amount of rows) or resizes very little. However > let's say I have only 2 rows then remove those 2 rows and resize the window > (using setFrame:display:animate:) and finally insert a much larger amount of > rows like 15 what happens is the top 5 or 6 rows animate as expected but the > rows further down just appear as if I was calling reloadData. I have checked > this and reloadData is not being called, but I can't figure out why all rows > don't animate. Any ideas? Yes -- I have ideas; actually, even better, I know what is happening! The table is very efficient at bringing in only the views you need. What's happening here is your animation insert or delete is happening, and no other views are visible (or need to be). Then, the table is resized via the window animation, exposing more rows that didn't participate in the animation. You can trick them to participate in the animation by pulling them in before doing the animation; if you are going to have X rows be revealed, call rowViewAtRow:makeIfNecessary:YES for the X rows past the last visible one first. corbin > > Thanks, > > rc > ___ > > 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/corbind%40apple.com > > This email sent to corb...@apple.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: 10.6 SDk and 10.5 Deployment
On 6/28/12, Gary L. Wade wrote: > Whenever you support an earlier OS, you should always have that earliest and > all intermediate SDKs available, and you should make it a standard practice > to build your products against those SDKs at least before releasing to > customers just as you do an analyzer build. This will help you identify many > of the cases where you need to safeguard against the use of unavailable > APIs, methods, and classes. Oh, and you really should be turning on and > listening to practically every warning possible. Then, after you do all > that, testing definitely should be done. >> It can definitely be done in theory. >> >> In practice you have to test the heck out of it, because without the 10.5 >> SDK, there’s nothing keeping you from accidentally using 10.6+ APIs, whose >> effects will only show up by throwing runtime exceptions on 10.5. >> One additional gotcha that I have hit multiple times is that if your application links to system .dylibs (not .frameworks), Xcode links to the explicit filename versioned .dylib file on your system that the generic one is symlinked to. This is a problem if say 10.6 has a newer version of libcrypto.dylib or libreadline.dylib which doesn't exist on 10.5. Your app will crash on launch on 10.5 because it can't find the dependent library. For this, I have resorted to using install_name_tool to rewrite the dependencies to link to the generic symlinked version because Xcode has fought all my attempts to control what it actually links to. -Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ ___ 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: 10.6 SDk and 10.5 Deployment
On Jun 28, 2012, at 1:58 PM, Eric Wing wrote: > > One additional gotcha that I have hit multiple times is that if your > application links to system .dylibs (not .frameworks), Xcode links to > the explicit filename versioned .dylib file on your system that the > generic one is symlinked to. This is a problem if say 10.6 has a newer > version of libcrypto.dylib or libreadline.dylib which doesn't exist on > 10.5. Your app will crash on launch on 10.5 because it can't find the > dependent library. For this, I have resorted to using > install_name_tool to rewrite the dependencies to link to the generic > symlinked version because Xcode has fought all my attempts to control > what it actually links to. Be careful! There could be binary incompatibilities between the two versions of the dylib—sometimes even between point revisions! We got bit by this in the 10.5->10.6 transition. --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: 10.6 SDk and 10.5 Deployment
On 6/28/12, Kyle Sluder wrote: > On Jun 28, 2012, at 1:58 PM, Eric Wing wrote: > >> >> One additional gotcha that I have hit multiple times is that if your >> application links to system .dylibs (not .frameworks), Xcode links to >> the explicit filename versioned .dylib file on your system that the >> generic one is symlinked to. This is a problem if say 10.6 has a newer >> version of libcrypto.dylib or libreadline.dylib which doesn't exist on >> 10.5. Your app will crash on launch on 10.5 because it can't find the >> dependent library. For this, I have resorted to using >> install_name_tool to rewrite the dependencies to link to the generic >> symlinked version because Xcode has fought all my attempts to control >> what it actually links to. > > Be careful! There could be binary incompatibilities between the two versions > of the dylib—sometimes even between point revisions! We got bit by this in > the 10.5->10.6 transition. > Yes, absolutely! -Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ ___ 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: Sorting an NSTableView bound to an NSArrayController.
On Jun 28, 2012, at 1:16 PM, Robert Tillyard wrote: > Hello, Keary, > > Thank you for your reply. > > Would the selector in the model be in the class for the CoreData Entity or os > it in the WindowController sub-class that controls the window that the > TableView is in? > > Would you know what the method for the selector would look like? I'm guessing > it must return an NSComparisionResult but if the entries in the ListView are > Entry classes would it be: > > - (NSComparisonResult)positionCompare:(Entry *)obj1 somethingElse:(Entry > *)obj2; I forgot about that piece--yes, you will need to implement an NSEntityDescription subclass for the sort method. If that proves to be problematic, you can fall back to binding/delegate that you can implement in your window controller. > On 28 Jun 2012, at 19:38, Keary Suska wrote: > >> On Jun 28, 2012, at 9:44 AM, Robert Tillyard wrote: >> >>> Hello, >>> >>> I'm writing an application that handles results for a running club. >>> >>> I have an NSTableView that has columns bound to a CoreData Entity such as >>> Entries.arrangedObjects.position, position is an NSString that contains >>> numbers such as @"1" and @"2" or @"" but the position can also be @"DNF" >>> (Did not finish). >>> >>> I have a method in the WindowController that sorts the 'Entry' objects and >>> handles these cases correctly returning an NSArray using: >>> >>> [array sortUsingComparator:^(id obj1, id obj2) >>>{ >>>NSComparisonResult r; >>> >>>r = >>> >>>return (r); >>>}]; >>> >>> How can I get my table view to work so that when the user clicks in the >>> Pos. column I can do my custom sort? at present it is doing an ASCII sort >>> so I get 1, 10, 100, then 2, 20, 200 etc... >>> >>> I now I need to put a key and sort descriptor in IB but don't know what >>> code I have to add to the Entity ot WindowController to handle it. >> >> >> Although there may be better ways, the easiest way is to specify the >> per-column sort in IB, and use the "selector" method for the position >> column. You would need to implement a sort method in your model, of course. >> Alternatively you could use the NSTableView delegate method >> tableView:sortDescriptorsDidChange:. You could use the latter in conjunction >> with the sortDescriptors binding in the array controller. 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
Re: Bidirectional, Manual Binding in custom control
On 2012 Jun 28, at 11:04, Quincey Morris wrote: > I'm not sure now why your control needs a 'rating' ivar. Doesn't this just > duplicate the value of the control's objectValue, and create extra > housekeeping? In this situation, probably yes, but it is quite normal for Cocoa controls to have an instance variable for their control value. NSControl has properties objectValue, stringValue, doubleValue, etc. Controls should be useable without bindings. ___ 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: nstableview remove/insert rows question
Great I will check this out thanks Corbin! rc On Jun 29, 2012, at 4:26 AM, Corbin Dunn wrote: > > On Jun 28, 2012, at 4:30 AM, Rick C. wrote: > >> Hi, >> >> Got a view-based table view and instead of using reloadData I'm removing the >> existing rows and inserting the new rows so that I can have animation. I'm >> also resizing the window in-between these 2 steps because my window resizes >> to fit how many rows are in my table view. This works great when my window >> doesn't resize (due to same amount of rows) or resizes very little. However >> let's say I have only 2 rows then remove those 2 rows and resize the window >> (using setFrame:display:animate:) and finally insert a much larger amount of >> rows like 15 what happens is the top 5 or 6 rows animate as expected but the >> rows further down just appear as if I was calling reloadData. I have >> checked this and reloadData is not being called, but I can't figure out why >> all rows don't animate. Any ideas? > > Yes -- I have ideas; actually, even better, I know what is happening! The > table is very efficient at bringing in only the views you need. What's > happening here is your animation insert or delete is happening, and no other > views are visible (or need to be). Then, the table is resized via the window > animation, exposing more rows that didn't participate in the animation. You > can trick them to participate in the animation by pulling them in before > doing the animation; if you are going to have X rows be revealed, call > rowViewAtRow:makeIfNecessary:YES for the X rows past the last visible one > first. > > corbin > >> >> Thanks, >> >> rc >> ___ >> >> 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/corbind%40apple.com >> >> This email sent to corb...@apple.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: Handling "Smart Zoom" gesture?
On 28/06/2012, at 5:31 PM, Quincey Morris wrote: > On Jun 28, 2012, at 00:14 , Graham Cox wrote: > >> Specifically, the problem is that the -clickCount property of an NSEvent is >> only applicable to mouse events, not touch events. So what's the right way >> to trap this specific gesture? I have read the various touch-input >> documentation but nothing became obvious. > > The 10.6 document seems to imply that tapping isn't a gesture, so I'd assume > you'd have to implement the NSResponder methods 'touches…WithEvent:' and use > the event times to decide (a) if precisely 2 touches begin/end more or less > simultaneously and (b) if a second 2-touch tap begins within a time interval > after the 1st one [iOS defaults to 0.5 sec for this interval. Perhaps on the > Mac you'd use something conditioned by the double-click time instead. I > dunno.] and (c) if both 2-touch taps last less than some time interval > [otherwise they'd represent a long press]. > > Something like that? > > OK, that's pretty much what I'm doing, but it doesn't work all that well yet. The gesture is recognised, but only sometimes, so the effect for the user is that the gesture response is flaky. I'm not sure what I need to do to improve this. I've written a system somewhat similar (but simpler) than the iOS gesture recognizer system, where each gesture is recognized by an object, and as soon as it recognizes the gesture, it informs its delegate and tells the other recognizers in the set to fugeddaboudit. But in fact, I only have the one recognizer in there. Here's the code, which happens to be in my recognizer object, but this can be thought of as being implemented by a view: - (void)touchesBeganWithEvent:(NSEvent*) event { NSSet* touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:self.view]; if([touches count] == 2 ) { if( self.state == DKWaitingForTap ) { mFirstTapTime = [NSDate timeIntervalSinceReferenceDate]; [NSTimer scheduledTimerWithTimeInterval:[NSEvent doubleClickInterval] + 0.1 target:self selector:@selector(timeOut:) userInfo:nil repeats:NO]; self.state = DKGotFirstTap; } else if( self.state == DKGotFirstTap ) { NSTimeInterval dt = [NSDate timeIntervalSinceReferenceDate] - mFirstTapTime; if( dt <= [NSEvent doubleClickInterval]) { self.state = DKGotSecondTap; [self notifyDelegate]; // will eventually call -reset which puts the state back if timer or ended event doesn't do it first } } } } - (void)touchesEndedWithEvent:(NSEvent *)event { if( self.state != DKWaitingForTap ) { NSTimeInterval dt = [NSDate timeIntervalSinceReferenceDate] - mFirstTapTime; if( dt > [NSEvent doubleClickInterval]) [self reset]; } } - (void)touchesMovedWithEvent:(NSEvent*) event { [self reset]; } - (void)touchesCancelledWithEvent:(NSEvent*) event { [self reset]; } - (void)reset { self.state = DKWaitingForTap; } - (void)timeOut:(NSTimer*) timer; { [self reset]; } As you can see, I don't bother to track the touches - I only determine that there are two, and use a simple state machine to detect a double-tap. On the second tap the touches will be new objects anyway, so there isn't any mileage in trying to match them up with the touches of the first event. There's also a timer that resets the state if the second tap is never received. It works, but since the results are flaky, this is obviously not good enough. Has anyone actually implemented something like this, and can see where I have gone wrong? --Graham ___ 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: Handling "Smart Zoom" gesture?
On Jun 28, 2012, at 19:57 , Graham Cox wrote: > - (void) touchesBeganWithEvent:(NSEvent*) event > { > NSSet* touches = [event touchesMatchingPhase:NSTouchPhaseBegan > inView:self.view]; > > if([touches count] == 2 ) Well, this looks wrong to me. In general, each of the 2 touches is going to begin at a different time, which means this method will be called twice, and there's only be one touch in the set at each call. (The touch that began earlier is in a different phase at this event.) I would expect this code to work only if both fingers hit the trackpad simultaneously. That's probably not very hard to do, which is why it works sometimes but only flakily. I think what you need to to is add up *all* the touches in all phases [well, at least in "began" and "moved" phases, not sure about the others] at *any* of the touch responder methods, to work out how many touches are present simultaneously. Even that won't ensure that the touches begin close together in time, though, which you may or may not care about. ___ 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: Handling "Smart Zoom" gesture?
On 29/06/2012, at 1:17 PM, Quincey Morris wrote: > Well, this looks wrong to me. In general, each of the 2 touches is going to > begin at a different time, which means this method will be called twice, and > there's only be one touch in the set at each call. (The touch that began > earlier is in a different phase at this event.) > Hmm, ok, I can investigate that. I imagined that touches that went down very close in time were coalesced by the driver into a single event. That assumption, possibly faulty, was strongly reinforced by the example code listed in the documentation, which specifically does exactly this - [touches count] == 2. --Graham ___ 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: Handling "Smart Zoom" gesture?
On 29/06/2012, at 1:17 PM, Quincey Morris wrote: >> NSSet* touches = [event touchesMatchingPhase:NSTouchPhaseBegan >> inView:self.view]; Ah, noticed a silly mistake. If I use NSTouchPhaseTouches here, I get a count of 2 far more often. That suggests that in fact events are coalesced, or at least sent several times with the touches set building up. --Graham ___ 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: nstableview remove/insert rows question
Unfortunately Corbin I'm not sure I'm following here. So I remove my old rows sliding left and then resize my window and at that point I currently have no rows (my datasource has been updated though). So if I try to call rowViewAtRow: I get an exception since I have no rows. I can go ahead and insert my new rows (sliding in from the right) and it works, except for what I explained before that if the jump is very big in number of rows not all of them will slide in from the right some will just appear. There must be something I'm misunderstanding? rc On Jun 29, 2012, at 4:26 AM, Corbin Dunn wrote: > > On Jun 28, 2012, at 4:30 AM, Rick C. wrote: > >> Hi, >> >> Got a view-based table view and instead of using reloadData I'm removing the >> existing rows and inserting the new rows so that I can have animation. I'm >> also resizing the window in-between these 2 steps because my window resizes >> to fit how many rows are in my table view. This works great when my window >> doesn't resize (due to same amount of rows) or resizes very little. However >> let's say I have only 2 rows then remove those 2 rows and resize the window >> (using setFrame:display:animate:) and finally insert a much larger amount of >> rows like 15 what happens is the top 5 or 6 rows animate as expected but the >> rows further down just appear as if I was calling reloadData. I have >> checked this and reloadData is not being called, but I can't figure out why >> all rows don't animate. Any ideas? > > Yes -- I have ideas; actually, even better, I know what is happening! The > table is very efficient at bringing in only the views you need. What's > happening here is your animation insert or delete is happening, and no other > views are visible (or need to be). Then, the table is resized via the window > animation, exposing more rows that didn't participate in the animation. You > can trick them to participate in the animation by pulling them in before > doing the animation; if you are going to have X rows be revealed, call > rowViewAtRow:makeIfNecessary:YES for the X rows past the last visible one > first. > > corbin > >> >> Thanks, >> >> rc >> ___ >> >> 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/corbind%40apple.com >> >> This email sent to corb...@apple.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: 10.6 SDk and 10.5 Deployment
On Jun 28, 2012, at 4:19 PM, Kyle Sluder wrote: > On Jun 28, 2012, at 1:58 PM, Eric Wing wrote: > >> >> One additional gotcha that I have hit multiple times is that if your >> application links to system .dylibs (not .frameworks), Xcode links to >> the explicit filename versioned .dylib file on your system that the >> generic one is symlinked to. This is a problem if say 10.6 has a newer >> version of libcrypto.dylib or libreadline.dylib which doesn't exist on >> 10.5. Your app will crash on launch on 10.5 because it can't find the >> dependent library. For this, I have resorted to using >> install_name_tool to rewrite the dependencies to link to the generic >> symlinked version because Xcode has fought all my attempts to control >> what it actually links to. > > Be careful! There could be binary incompatibilities between the two versions > of the dylib—sometimes even between point revisions! We got bit by this in > the 10.5->10.6 transition. My current solution to this is to stash a copy of the dylibs that I need for whatever OS in a folder somewhere, and then adding "-L/path/to/custom/dylibs/folder -lwhatever” to Other Linker Flags in the build settings, and leaving the dylib out of Xcode’s link phase. Charles ___ 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