NSComboBoxCell subclass pointers?
Hi Everyone! This one has me stumped.. I have been working on a custom UI for my Cocoa application. By looking around the internet, I have managed to learn how to subclass a large number of UI objects on MacOSX. In many cases I could make the appearance work the way I want. The last UI element that I am working on, is NSComboBoxCell. It appears to be a NSTextFieldCell with an NSButtonCell attached. It seems fairly easy to override “drawWithFrame:inView" and draw a replacement artwork. But there are a bunch of unknowns/pitfalls.. The part that I suspect that I have to subclass is the NSButtonCell that I believe is drawing the "Arrow Button”. But how is this done, along side the NSTextField that makes up the NSComboBoxCell class? When I look at the NSComboBoxCell header files, I don’t see any obvious clues to figure out the geometry of the NSButtonCell, that is apparently being used alongside the NSTextField, itself. Are there any ways to get to the NSButtonCell stored inside the NSComboBoxCell Object? (Ideally so that I can override and install my own NSButtonCell..) Thanks in advance! bob.. ___ 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: NSComboBoxCell subclass pointers?
Hi James, Very clever way of getting the boundaries of each cell! I was wondering if this was possible. I’ll take a shot at this and how far I get. Thanks! bob. > On Nov 21, 2016, at 5:46 PM, James Walker wrote: > > On 11/20/2016 8:15 PM, Robert Monaghan wrote: >> I have been working on a custom UI for my Cocoa application. By looking >> around the internet, I have managed to learn how to subclass a large number >> of UI objects on MacOSX. In many cases I could make the appearance work the >> way I want. >> >> The last UI element that I am working on, is NSComboBoxCell. It appears to >> be a NSTextFieldCell with an NSButtonCell attached. It seems fairly easy to >> override >> “drawWithFrame:inView" and draw a replacement artwork. But there are a >> bunch of unknowns/pitfalls.. >> >> The part that I suspect that I have to subclass is the NSButtonCell that I >> believe is drawing the "Arrow Button”. >> But how is this done, along side the NSTextField that makes up the >> NSComboBoxCell class? When I look at the NSComboBoxCell header files, I >> don’t see any obvious clues to figure out the geometry of the NSButtonCell, >> that is apparently being used alongside the NSTextField, itself. >> >> Are there any ways to get to the NSButtonCell stored inside the >> NSComboBoxCell Object? (Ideally so that I can override and install my own >> NSButtonCell..) > > In my NSComboBoxCell subclass, I figured out where the "button" part ought to > be as follows: > > NSRect drawingRect = [self drawingRectForBounds: cellFrame]; > NSRect titleBounds = [self titleRectForBounds: drawingRect]; > NSRect buttonBounds = NSMakeRect( NSMaxX( titleBounds ), > NSMinY(drawingRect), > NSMaxX(drawingRect) - NSMaxX( titleBounds ), > NSHeight(drawingRect) ); > > And then I drew my own button content. > ___ > > 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/bob%40gluetools.com > > This email sent to b...@gluetools.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: disabling Apple Crash Reporter
Hi Torsten, This is of interest to me, as well. I haven't had a chance to look into it, but I will over the next few days. Bob Sent from my iPhone > On Mar 9, 2015, at 15:54, Torsten Curdt wrote: > > I could not find the prefs app > > > https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html#FIGCRASHREPORTERPREFS > > but seems like it's just a fancy way of switching the global state. > > http://cocoadev.com/HowToAvoidSendToAppleWindow > > has some further suggestions. > > Apparently Adium works around this > > https://hg.adium.im/adium/file/024e5177ce06/Source/AIAdium.m > https://hg.adium.im/adium/file/024e5177ce06/Source/AICrashController.m > > but I am not sure how this would work together with PLCR (or other in > process crash reporters). > > Just inspecting the info.plist on a crash - wouldn't that be a smart and > easy way to handle this. > > *sigh* > > cheers, > Torsten > ___ > > 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/bob%40gluetools.com > > This email sent to b...@gluetools.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
DMG Creation without using hdiutil..
Hi Everyone, Is there a framework, or some other API that will let me create a DMG file? (I've seen a couple of posts about using NSTask to launch a hdiutil command..) Or, is there a way in which to get events or notifications from hdiutil, as it is creating a DMG file from a source folder? Thanks! bob. Robert Monaghan Glue Tools LLC 1024A Quinientos St. Santa Barbara, CA, 93103 United States tel: +1 805 456 7997 fax: +1 805 456 7998 www.gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Fwd: DMG Creation without using hdiutil..
Begin forwarded message: > From: Robert Monaghan > Date: November 5, 2009 9:19:21 PM PST > To: Dave Carrigan > Subject: Re: DMG Creation without using hdiutil.. > > Ahh, > > -puppetstrings give me some useful feedback. Thanks for the tip! > I'll look at the plist flag too.. > > bob. > > > On Nov 5, 2009, at 8:14 PM, Dave Carrigan wrote: > >> >> On Nov 5, 2009, at 7:54 PM, Robert Monaghan wrote: >> >>> Is there a framework, or some other API that will let me create a DMG file? >>> (I've seen a couple of posts about using NSTask to launch a hdiutil >>> command..) >>> Or, is there a way in which to get events or notifications from hdiutil, as >>> it is creating a DMG file from a source folder? >> >> >> AFAIK, there is no API for this. You could try using one of -verbose, -debug >> or -puppetstrings in your hdiutil command to get more information back. I >> don't know how much, if any, the format of this output will change from >> version to version of Mac OS. Also consider using -plist to get the result >> of hdiutil back in a format that is easy to parse. >> >> -- >> Dave Carrigan >> d...@rudedog.org >> Seattle, WA, USA > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
What is the best way to determine what type of removable media is inserted? (ie: DMG)
Hi Everyone, Is there a way to determine if a mounted "removable" volume is a DMG or not? I need to distinguish between a USB Stick and a DMG in my app. I have played with statfs(), but I can't seem to figure out a tangible/concrete difference. How does one figure out what type of removable volume is mounted? Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSPredicate to exclude specific elements??
Hi Everyone, You would think this is simple, but I can't figure this out. Lets say I have a pile of NSString Paths in an array, where some of them have the word "GREEN" in the file name. I've been trying to build an NSPredicate which would exclude elements that contain the name.. Every attempt that I have done gives me an exception.. what am I missing?? eg: @"(SELF ALL *) NOT (SELF like[c] %@)" @"NOT (SELF like[c] %@)" @"SELF !like[c] %@" @"SELF NOT like[c] %@" for example give me an NSInvalidArgumentException How does one do this? bob ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate to exclude specific elements??
Thanks for the suggestion! All of the examples I gave work if you are trying to match the argument. CONTAINS is another way to match, but will it work with NOT? So far, everything that you would expect to work, doesn't. This is a case where you wish that Apple would document this better. (I haven't found any working examples or docs explaining the practical use of NOT or NONE, etc.. on Apple's site) Bob Sent from my iPhone On Mar 21, 2010, at 9:16, Jon Pugh wrote: At 7:54 AM -0700 3/21/10, Robert Monaghan wrote: Lets say I have a pile of NSString Paths in an array, where some of them have the word "GREEN" in the file name. I've been trying to build an NSPredicate which would exclude elements that contain the name.. Every attempt that I have done gives me an exception.. what am I missing?? eg: @"(SELF ALL *) NOT (SELF like[c] %@)" @"NOT (SELF like[c] %@)" @"SELF !like[c] %@" @"SELF NOT like[c] %@" for example give me an NSInvalidArgumentException I have used @"%K CONTAINS[cd] %@" successfully. I would expect @"%K NOT CONTAINS[cd] %@" to also work. Jon ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate to exclude specific elements??
Hi Kirk, The variable wildcardString would contain a string such as *GREEN* for a wildcard search to include files with that name, and for simplicity's sake a string like !*GREEN* for those that wish to exclude files that contain the string. Here is a sample bit of code.. BOOL foundStar = NO; BOOL notPredicate = NO; NSRange firstNotStar = [wildcardString rangeOfString:@"!*"]; if (firstNotStar.location != NSNotFound) { notPredicate = YES; } NSRange firstStar = [wildcardString rangeOfString:@"*"]; if (firstStar.location != NSNotFound) { foundStar = YES; if (notPredicate) { NSString *arg = [wildcardString substringFromIndex:1]; [self setPredicate:[NSPredicate predicateWithFormat:@"SELF NOT like[c] %@", arg]]; } else [self setPredicate:[NSPredicate predicateWithFormat:@"SELF like[c] %@", wildcardString]]; } If the "notPredicate" is true, the "!" character is trimmed from the front of the string, before it is passed to the predicate. I've replaced the "not" predicate with all sorts of combinations. I get a NSInvalidArgumentException the moment the NSPredicate is instantiated. Bob.. On Mar 21, 2010, at 11:31 AM, Kirk Kerekes wrote: > I suggest that you need to provide the actual code you are using to generate > the NSPredicate, because what you are wanting to do just isn't that hard. > > The problem may not be in the predicate format string. > > I would have used @"NOT CONTAINS[cd] %@" as my first pass, and been quite > surprised if it didn't work. NSPredicate has its quirks, but the > straightforward stuff tends to be... straightforward. > > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate to exclude specific elements??
Good Suggestion! Let me look. bob. On Mar 21, 2010, at 4:43 PM, Kyle Sluder wrote: > On Sun, Mar 21, 2010 at 12:47 PM, Robert Monaghan wrote: >> I've replaced the "not" predicate with all sorts of combinations. I get a >> NSInvalidArgumentException the moment the NSPredicate is instantiated. > > Do you have a stack trace? Perhaps it's -setPredicate:, not > +predicateWithFormat:, which is throwing the exception. > > --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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Remove/Disable NSPredicate from NSMutableSet?
Hi Everyone, How does one remove a NSPredicate from an NSMutableSet? I want to reuse the NSMutableSet for another purpose, but I have to strip out the Predicate that I assigned. Passing "filterUsingPredicate:nil" causes an exception. Is there a way to do this? Or should I generate another NSMutableSet? Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
baseURL problem with +fileURLWithPath:
Hi Everyone.. I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a 10.5 app.. btw) If I create a NSURL object with a local file path, everything looks as it should, when stepping through the code with the debugger. However, when I use "[myURL path]" in my code, I get a path to my binary instead of the path that is placed into NSURL object. After doing some reading, this looks as if my local file path is being set as the "Relative" path, and the binary application is set as the "BaseURL". Can someone (preferably from Apple) explain why this is broken with file paths? -- Yes.. it is broken, as there is no way to set the baseURL, nor is there a way to set my local file path as the baseURL. --- I used absoluteURL, but that only returns the binary path. I hope I don't have to remove these NSURL objects and replace them with NSStrings.. what a pain in the a.. bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: baseURL problem with +fileURLWithPath:
Hi Mike, This is pretty trivial.. I have a string that is coming from an FCP XML file. The string looks like this: file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov I then pass the string to an NSURL object using: (Yes, I know I can do a "fileURLWithPath:" -- I am trying to troubleshoot where the problem is.) NSURL *url = [[[NSURL alloc] initFileURLWithPath:[[pathurlArray objectAtIndex:0] stringValue]] autorelease]; Then, I try to get an NSString object by doing: [url path] This is where things go wildly wrong.. the NSString value ends up being a path to my binary. bob. On May 18, 2010, at 12:55 PM, Mike Abdullah wrote: > Show us some code. > > On 18 May 2010, at 09:49, Robert Monaghan wrote: > >> Hi Everyone.. >> >> I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a >> 10.5 app.. btw) >> >> If I create a NSURL object with a local file path, everything looks as it >> should, when stepping through the code with the debugger. >> However, when I use "[myURL path]" in my code, I get a path to my binary >> instead of the path that is placed into NSURL object. >> After doing some reading, this looks as if my local file path is being set >> as the "Relative" path, and the binary application is set as >> the "BaseURL". >> >> Can someone (preferably from Apple) explain why this is broken with file >> paths? >> -- Yes.. it is broken, as there is no way to set the baseURL, nor is there a >> way to set my local file path as the baseURL. >> --- I used absoluteURL, but that only returns the binary path. >> >> I hope I don't have to remove these NSURL objects and replace them with >> NSStrings.. >> what a pain in the a.. >> >> bob. >> >> ___ >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >> >> This email sent to cocoa...@mikeabdullah.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: baseURL problem with +fileURLWithPath:
Immediately after the NSURL object is created. (so there is no danger of being released.) bob. On May 18, 2010, at 2:03 PM, Volker in Lists wrote: > Robert, > > when/where do you call [url path]? It may be released at that moment and thus > display garbage! What happens if you omit the call to autorelease when > creating url ? > > Volker > > Am 18.05.2010 um 13:52 schrieb Robert Monaghan: > >> Hi Mike, >> >> This is pretty trivial.. I have a string that is coming from an FCP XML >> file. The string looks like this: >> file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov >> >> I then pass the string to an NSURL object using: (Yes, I know I can do a >> "fileURLWithPath:" -- I am trying to troubleshoot where the problem is.) >> NSURL *url = [[[NSURL alloc] initFileURLWithPath:[[pathurlArray >> objectAtIndex:0] stringValue]] autorelease]; >> >> Then, I try to get an NSString object by doing: >> [url path] >> >> This is where things go wildly wrong.. the NSString value ends up being a >> path to my binary. >> >> > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: baseURL problem with +fileURLWithPath:
The path from [[pathurlArray objectAtIndex:0] stringValue] is going into the NSURL properly. This doesn't appear to be a problem with retaining the source NSArray object. The base URL, however is being populated with the path to my binary. I am trying to figure out how to set the baseURL to nil. If I print a description, I get: {type = 15, string = file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov, encoding = 134217984 base = {type = 0, string = /Users/bob/Development/GT_Dig/GT_Cons/build/Debug/, encoding = 134217984, base = (null)}} bob. On May 18, 2010, at 2:12 PM, Abhinay Kartik Reddyreddy wrote: > > On May 18, 2010, at 7:52 AM, Robert Monaghan wrote: > >> Hi Mike, >> >> This is pretty trivial.. I have a string that is coming from an FCP XML >> file. The string looks like this: >> file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov >> >> I then pass the string to an NSURL object using: (Yes, I know I can do a >> "fileURLWithPath:" -- I am trying to troubleshoot where the problem is.) >> NSURL *url = [[[NSURL alloc] initFileURLWithPath:[[pathurlArray >> objectAtIndex:0] stringValue]] autorelease]; >> > > How about if you copy [[pathurlArray objectAtIndex:0] stringValue] into a > NSString, retain it and create a NSURL instead of creating from pathurlArray > directly...?? > >> Then, I try to get an NSString object by doing: >> [url path] >> > > What would be the value in [[pathurlArray objectAtIndex:0] stringValue] at > this point...?? May be the pathurlArray is Auto released before you create > the NSURL...?? Just a guess > >> This is where things go wildly wrong.. the NSString value ends up being a >> path to my binary. >> >> >> bob. >> >> >> On May 18, 2010, at 12:55 PM, Mike Abdullah wrote: >> >>> Show us some code. >>> >>> On 18 May 2010, at 09:49, Robert Monaghan wrote: >>> >>>> Hi Everyone.. >>>> >>>> I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a >>>> 10.5 app.. btw) >>>> >>>> If I create a NSURL object with a local file path, everything looks as it >>>> should, when stepping through the code with the debugger. >>>> However, when I use "[myURL path]" in my code, I get a path to my binary >>>> instead of the path that is placed into NSURL object. >>>> After doing some reading, this looks as if my local file path is being set >>>> as the "Relative" path, and the binary application is set as >>>> the "BaseURL". >>>> >>>> Can someone (preferably from Apple) explain why this is broken with file >>>> paths? >>>> -- Yes.. it is broken, as there is no way to set the baseURL, nor is there >>>> a way to set my local file path as the baseURL. >>>> --- I used absoluteURL, but that only returns the binary path. >>>> >>>> I hope I don't have to remove these NSURL objects and replace them with >>>> NSStrings.. >>>> what a pain in the a.. >>>> >>>> bob. >>>> >>>> ___ >>>> >>>> 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: >>>> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >>>> >>>> This email sent to cocoa...@mikeabdullah.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: >> http://lists.apple.com/mailman/options/cocoa-dev/karthikreddy09%40gmail.com >> >> This email sent to karthikredd...@gmail.com > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: (solved?) baseURL problem with +fileURLWithPath:
Ok, I am doing this now, which *seems* to work. NSURL *url = [NSURL URLWithString:[[pathurlArray objectAtIndex:0] stringValue] relativeToURL:nil]; bob.. On May 18, 2010, at 2:20 PM, Robert Monaghan wrote: > The path from [[pathurlArray objectAtIndex:0] stringValue] is going into the > NSURL properly. > This doesn't appear to be a problem with retaining the source NSArray object. > > The base URL, however is being populated with the path to my binary. I am > trying to figure out how to set the baseURL to nil. > If I print a description, I get: > > {type = 15, string = > file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov, > encoding = 134217984 > base = {type = 0, string = > /Users/bob/Development/GT_Dig/GT_Cons/build/Debug/, encoding = 134217984, > base = (null)}} > > bob. > > On May 18, 2010, at 2:12 PM, Abhinay Kartik Reddyreddy wrote: > >> >> On May 18, 2010, at 7:52 AM, Robert Monaghan wrote: >> >>> Hi Mike, >>> >>> This is pretty trivial.. I have a string that is coming from an FCP XML >>> file. The string looks like this: >>> file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov >>> >>> I then pass the string to an NSURL object using: (Yes, I know I can do a >>> "fileURLWithPath:" -- I am trying to troubleshoot where the problem is.) >>> NSURL *url = [[[NSURL alloc] initFileURLWithPath:[[pathurlArray >>> objectAtIndex:0] stringValue]] autorelease]; >>> >> >> How about if you copy [[pathurlArray objectAtIndex:0] stringValue] into a >> NSString, retain it and create a NSURL instead of creating from pathurlArray >> directly...?? >> >>> Then, I try to get an NSString object by doing: >>> [url path] >>> >> >> What would be the value in [[pathurlArray objectAtIndex:0] stringValue] at >> this point...?? May be the pathurlArray is Auto released before you create >> the NSURL...?? Just a guess >> >>> This is where things go wildly wrong.. the NSString value ends up being a >>> path to my binary. >>> >>> >>> bob. >>> >>> >>> On May 18, 2010, at 12:55 PM, Mike Abdullah wrote: >>> >>>> Show us some code. >>>> >>>> On 18 May 2010, at 09:49, Robert Monaghan wrote: >>>> >>>>> Hi Everyone.. >>>>> >>>>> I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a >>>>> 10.5 app.. btw) >>>>> >>>>> If I create a NSURL object with a local file path, everything looks as it >>>>> should, when stepping through the code with the debugger. >>>>> However, when I use "[myURL path]" in my code, I get a path to my binary >>>>> instead of the path that is placed into NSURL object. >>>>> After doing some reading, this looks as if my local file path is being >>>>> set as the "Relative" path, and the binary application is set as >>>>> the "BaseURL". >>>>> >>>>> Can someone (preferably from Apple) explain why this is broken with file >>>>> paths? >>>>> -- Yes.. it is broken, as there is no way to set the baseURL, nor is >>>>> there a way to set my local file path as the baseURL. >>>>> --- I used absoluteURL, but that only returns the binary path. >>>>> >>>>> I hope I don't have to remove these NSURL objects and replace them with >>>>> NSStrings.. >>>>> what a pain in the a.. >>>>> >>>>> bob. >>>>> >>>>> ___ >>>>> >>>>> 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: >>>>> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >>>>> >>>>> This email sent to cocoa...@mikeabdullah.net >>>> >>> >>> ___ >>> >>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >>> >>> Please do not post admin requests
Re: (solved?) baseURL problem with +fileURLWithPath:
Interesting.. The source of this path is from Final Cut Pro. I can't say how they come up with the path. I will ping some people and find out. bob. On May 18, 2010, at 8:01 PM, John Joyce wrote: > > On May 18, 2010, at 12:39 PM, cocoa-dev-requ...@lists.apple.com wrote: > >> Content-Type: text/plain; charset=us-ascii >> >> First, the first 2 characters need to be // and not / for it to be a valid >> resource specifier. The 10.6 Overview states it will fail to create a >> NSURL. Look at the class reference. Why the base is set to your binary >> maybe just a bug in 10.5. So you don't go nuts, just temp fix the string >> and then execute your code to see if the originating pseudo URL is your prob. >> >> -Tony > > Yes, the resource specifier should be protocol://pathtoresource > a file URL usesfile://path > a path to a file always becomes absolute here. > / is root directory of the volume in a file path in unix > thus, it should have the following appearance: (3 slashes after the colon) > file:///absolute/path/to/file > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ARC and Singletons
Submitted as an enhancement request.. :) Bug ID# 9908437 bob.. On Aug 2, 2011, at 5:29 PM, Dave Zarzycki wrote: > Karl, > > This is not on our todo list or any list that I know of. Please file a bug > report if this enhancement request is interesting to you. > > Thanks! :-) > > davez > > > On Aug 2, 2011, at 4:59 PM, Karl Goiser wrote: > >> Hi Greg, >> >> Is that wishful thinking or a hint about the future? >> :-) >> >> >> All I have to say is: yes please!! >> >> >> Regards, >> >> Karl >> >> >> On 03/08/2011, at 5:43 AM, Greg Parker wrote: >> >>> On Aug 1, 2011, at 9:02 PM, Kyle Sluder wrote: if we had class storage (which in practice would be no different from static global variables except for scope), class methods would still be appropriate for a different set of tasks. >>> >>> Not necessarily. Class variables could be defined differently from global >>> variables. If a class variable were defined in the natural way, as an >>> instance variable for the class instance described by the metaclass, then >>> class variables would be inherited in the same way that instance variables >>> are. A subclass object would have its own copy of its superclass's >>> variables, just like a subclass instance object has its own copy of its >>> superclass instance's variables. >>> >>> -- >>> Greg Parker gpar...@apple.com Runtime Wrangler >>> >>> >> >> ___ >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/zarzycki%40apple.com >> >> This email sent to zarzy...@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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Keyboard NSEvents and a NSObjectController?
Hi Everyone, It seems to me that there isn't an easy way to do this.. I have a bunch of Objects that are in an NSArrayController. My UI is bound to an NSObjectController which is then set to work with one of these objects (in the ArrayController). The user essentially selects one of the objects in the ArrayController using a TableView. This is pretty straight forward stuff. The wrinkle happens when I want to add non-standard keyboard short cuts. For example, I want the user to use a space bar to start and stop a "play" process on my object. I would want to use other keys to modify the object, too. What is the best way to pass these Keyboard events through an NSObjectController to my target object? Am I just going to have to write a boat load of spaghetti code to these events directly to the objects in question? Suggestions appreciated! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
drawRect not being called by NSCollectionView..
Hi Everyone, I can't seem to get an NSCollectionView to render an of the NSCollectionViewItems' NSViews. I have an NSCollectionView that is bound to an NSArrayController's arrangedObjects. The NSCollectionViewItem is set up as a template, and also has its Outlet attached to an NSView. For fun I added a text label as well as an image from the Media Library, as a placeholder image on the NSView. (It helps to have something to look at!) I don't have anything bound to the NSView at all. I haven't subclassed anything either. These are the standard objects within IB. My App inserts objects into an array using the NSArrayController as needed. However, as this happens, *nothing* is rendered at all. As a test, I have subclassed the NSView, and checked the drawRect method. Nothing. I enabled selectable in my NSCollectionView and checked for a hitTest method in my view. I can blindly click inside the NSCollectionView to the approximate location of the view, and see an hitTest response. Strange! So I know that my NSView is being recognized by my NSCollectionView, as hitTest is being called. But drawRect isn't happening. Can anyone hazard a guess at what I am doing wrong? Some notes.. This interface is to drive a network device. As such, the UI doesn't actually populate with anything until it is discovered over the network. As a matter of fact, the array that the NSArrayController uses doesn't even exit during the "awakeFromNib" process. The actual array is created as soon as the device comes online, and is attached using a binding. Perhaps I need to send some sort of message to the NSCollectionView after the new array is bound? Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: drawRect not being called by NSCollectionView..
Well, After some troubleshooting, it looks like the NSView that is attached to the NSCollectionViewItem object is missing its superview. Does any know how this might be possible?? I can see my Subclassed NSView being created. AwakeFromNib works, as does hitTest. The drawRect does get called, but the call to superview fails, because it is set to nil. Just for laughs, I created another NSCollectionView, with NSArrayController, etc, and manually add objects. This works, with the NSViews displaying properly. Is there a way to force NSCollectionView to reload/re-display the NSViews with a proper superview set? bob. On Oct 10, 2011, at 4:49 PM, Robert Monaghan wrote: > Hi Everyone, > > I can't seem to get an NSCollectionView to render an of the > NSCollectionViewItems' NSViews. > > I have an NSCollectionView that is bound to an NSArrayController's > arrangedObjects. > The NSCollectionViewItem is set up as a template, and also has its Outlet > attached to an NSView. > For fun I added a text label as well as an image from the Media Library, as a > placeholder image on the NSView. > (It helps to have something to look at!) > > I don't have anything bound to the NSView at all. > I haven't subclassed anything either. These are the standard objects within > IB. > > My App inserts objects into an array using the NSArrayController as needed. > However, as this happens, *nothing* is rendered at all. As a test, I have > subclassed the NSView, and checked the drawRect method. > > Nothing. > > I enabled selectable in my NSCollectionView and checked for a hitTest method > in my view. I can blindly click inside the NSCollectionView to the > approximate location of the view, and see an hitTest response. Strange! So I > know that my NSView is being recognized by my NSCollectionView, as hitTest is > being called. But drawRect isn't happening. > > Can anyone hazard a guess at what I am doing wrong? > > Some notes.. > This interface is to drive a network device. As such, the UI doesn't actually > populate with anything until it is discovered over the network. > As a matter of fact, the array that the NSArrayController uses doesn't even > exit during the "awakeFromNib" process. The actual array is created as soon > as the device comes online, and is attached using a binding. Perhaps I need > to send some sort of message to the NSCollectionView after the new array is > bound? > > Thanks! > > bob. > > ___ > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AVFoundation and kYUVSPixelFormat from AVPlayer
Hi, A quick word of warning, while QTKit is being deprecated for AVFoundation/Core Media, there is no third party codec support in the new APIs. I would consider this while you develop your app. I doubt that 3rd party codec support for Core media is going to arrive as fast (or as complete) as we would like. bob. (A quicktime codec developer that would love to write AVFoundation/Core Media Codecs, but can't.) On Oct 11, 2011, at 7:22 PM, Mr. Gecko wrote: > Hello, I am needing to have AVPlayer output the video as an CVImageBufferRef > in real time instead of AVPlayerLayer. I am able to do this with QTKit and > QTPixelBufferContextCreate, however, QTKit is said to be dead and > AVFoundation is the future as well as AVFoundation is 64bit. > > So far what I've came up with works, however it is not feasible as I cannot > skip time without also telling AVAssetReader to change it's position and it > takes up more CPU than QTKit does. > > Another thought I had with using AVFoundation is that AVFoundation should > have GPU accelerated H.264 decoding, which this does not seem to be true in > my current testing with QuickTime X as it still uses 33% CPU with a 1080P > video (not sure if that's good or bad). > > Here is what I currently have, if anyone can improve it, please tell me how. > > avMovie = [[AVPlayer alloc] initWithURL:[NSURL fileURLWithPath:[theArguments > objectAtIndex:0]]]; > AVPlayerItem *item = [avMovie currentItem]; > AVAsset *asset = [item asset]; > AVAssetTrack *videoTrack = nil; > NSArray *tracks = [asset tracksWithMediaType:AVMediaTypeVideo]; > if ([tracks count] == 1) { >videoTrack = [tracks objectAtIndex:0]; >NSError *error = nil; >assetReader = [[AVAssetReader alloc] initWithAsset:asset error:&error]; >if (error!=nil) { >NSLog(@"Unable to create asset reader %@", [error > localizedDescription]); >} else { >NSMutableDictionary *bufferOptions = [NSMutableDictionary dictionary]; >[bufferOptions setObject:[NSNumber numberWithInt:kYUVSPixelFormat] > forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey]; >[assetReader addOutput:[AVAssetReaderTrackOutput > assetReaderTrackOutputWithTrack:videoTrack outputSettings:bufferOptions]]; >[assetReader startReading]; >} > } > if (videoTrack!=nil) { >NSLog(@"%f", (Float64)1/[videoTrack nominalFrameRate]); >[avMovie addPeriodicTimeObserverForInterval:CMTimeMake(1001, [videoTrack > nominalFrameRate]*1001) queue:dispatch_queue_create("eventQueue", NULL) > usingBlock:^(CMTime time) { >dispatch_sync(dispatch_get_main_queue(), ^{ >AVAssetReaderTrackOutput *output = [[assetReader outputs] > objectAtIndex:0]; >CMSampleBufferRef sampleBuffer = [output copyNextSampleBuffer]; >if (sampleBuffer!=NULL) { >CVImageBufferRef texture = > CMSampleBufferGetImageBuffer(sampleBuffer); > >// Do code with the CoreVideo Image. > >CFRelease(texture); >} >}); >}]; > } > [avMovie setRate:1.0]; > > P.S. I know I have leaks in there somewhere, I plan to remove them after > getting the concept completed with all of this. > ___ > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AVFoundation and kYUVSPixelFormat from AVPlayer
Believe me, the appropriate people at Apple are aware of this. There is more to the problem than just Codecs. There is a lot of other functionality missing, too. (Custom Data handling, etc) But in the meantime, I would really encourage developers to file enhancement requests of their own. Currently, QTKit is really the only game in town for Media usage. Lets hope this changes sooner than later! bob On Oct 12, 2011, at 1:31 AM, Jean-Daniel Dupas wrote: > > Le 12 oct. 2011 à 04:46, Robert Monaghan a écrit : > >> Hi, >> >> A quick word of warning, while QTKit is being deprecated for >> AVFoundation/Core Media, there is no third party codec support in the new >> APIs. I would consider this while you develop your app. I doubt that 3rd >> party codec support for Core media is going to arrive as fast (or as >> complete) as we would like. > > Did you fill a feature request about it ? That the only thing we can do, but > if there is enough request, maybe it may come faster than expected. > CoreMediaIO already has a CoreMedia Unit private API (a seen in the Resources > folder of the CoreMediaIO framework), so it may not require too much works to > provide an API to third party codecs and muxer/demuxer writers. > > > -- Jean-Daniel > > > > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: drawRect not being called by NSCollectionView..
Ok, A further update: After doing some reading on this list, and some additional reading Apple's site, I learned that Core Animation is being used. Just for fun, I in my NSCollectionViewItem's NSView, I called "setWantsLayers:YES". Suddenly my items started showing up! (Well, they are showing up if you like garbage all over the NSView.) In IB, I enabled the Core Animation Layer for my NSView. Then I enabled a Core Animation layer for my NSCollectionView. Things are almost working! However: - Not all of the imagery is properly re-drawn. - Why is my first NSCollectionView working just fine, yet my second one needs all of these Animation layers enabled? Progress at least! My hunch is this: Two separate NSCollectionViews needs some Core Animation tweaking to make work. bob. On Oct 10, 2011, at 7:43 PM, Robert Monaghan wrote: > Well, > > After some troubleshooting, it looks like the NSView that is attached to the > NSCollectionViewItem object is missing its superview. > Does any know how this might be possible?? > > I can see my Subclassed NSView being created. AwakeFromNib works, as does > hitTest. > The drawRect does get called, but the call to superview fails, because it is > set to nil. > > Just for laughs, I created another NSCollectionView, with NSArrayController, > etc, and manually add objects. This works, with the NSViews displaying > properly. > Is there a way to force NSCollectionView to reload/re-display the NSViews > with a proper superview set? > > bob. > > On Oct 10, 2011, at 4:49 PM, Robert Monaghan wrote: > >> Hi Everyone, >> >> I can't seem to get an NSCollectionView to render an of the >> NSCollectionViewItems' NSViews. >> >> I have an NSCollectionView that is bound to an NSArrayController's >> arrangedObjects. >> The NSCollectionViewItem is set up as a template, and also has its Outlet >> attached to an NSView. >> For fun I added a text label as well as an image from the Media Library, as >> a placeholder image on the NSView. >> (It helps to have something to look at!) >> >> I don't have anything bound to the NSView at all. >> I haven't subclassed anything either. These are the standard objects within >> IB. >> >> My App inserts objects into an array using the NSArrayController as needed. >> However, as this happens, *nothing* is rendered at all. As a test, I have >> subclassed the NSView, and checked the drawRect method. >> >> Nothing. >> >> I enabled selectable in my NSCollectionView and checked for a hitTest method >> in my view. I can blindly click inside the NSCollectionView to the >> approximate location of the view, and see an hitTest response. Strange! So I >> know that my NSView is being recognized by my NSCollectionView, as hitTest >> is being called. But drawRect isn't happening. >> >> Can anyone hazard a guess at what I am doing wrong? >> >> Some notes.. >> This interface is to drive a network device. As such, the UI doesn't >> actually populate with anything until it is discovered over the network. >> As a matter of fact, the array that the NSArrayController uses doesn't even >> exit during the "awakeFromNib" process. The actual array is created as soon >> as the device comes online, and is attached using a binding. Perhaps I need >> to send some sort of message to the NSCollectionView after the new array is >> bound? >> >> Thanks! >> >> bob. >> >> ___ >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com >> >> This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Sheet created by NSObjectContoller??
Hi Everyone, Perhaps someone can help point me in the right direction on this: I have an NSObjectController that maintains a UI for me. I have an NSTextField which contains numerical value. You could type in a number, which populates an NSNumber object deep inside my code.. Magically, my NSObjectController does its thing and maintains the UI. Very cool stuff! I just recently updated my bindings for this NSTextField, so that a a Min and Max Value is respected. As a test, I typed a value which is outside the Min/Max value, to see what I need to implement. To my surprise, a sheet is created saying "The Value 500 is too large." It prompts the user to Discard or Keep Change. Where did this come from? And how do I override this? I can't find info in the docs. I do see a vague reference to a "sheet" in the NSObjectController Docs, with add/remove selectors, etc. But nothing concrete. Ideas? Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sheet created by NSObjectContoller??
The binding is straight forward.. You create an NSObjectController, and set the "Mode" to "Class" and the Class Name to your object with a bunch of NSNumbers. (prepared with @property/@synthesize, naturally) In my NSTextField, I bind my "value", "Min Value" and "Max Value" to the NSObjectController, specifying which NSNumbers are to be used for each. So I have have inside my object a set of NSNumbers called "maxVal" "minVal" and "currentVal", my NSTextField would reflect those values. If minVal is 10, maxValue is 20, and currentValue is 15. Everything is great. Now type in 500 in the NSTextField, and out pops a sheet! I am going to see about validation. Perhaps that is how this is happening. bob.. On Dec 17, 2011, at 11:10 AM, Peter wrote: > > Am 17.12.2011 um 19:59 schrieb Robert Monaghan: > >> Hi Everyone, >> >> Perhaps someone can help point me in the right direction on this: >> >> I have an NSObjectController that maintains a UI for me. >> I have an NSTextField which contains numerical value. You could type in a >> number, which populates an NSNumber object deep inside my code.. >> Magically, my NSObjectController does its thing and maintains the UI. Very >> cool stuff! >> >> I just recently updated my bindings for this NSTextField, so that a a Min >> and Max Value is respected. > > Interesting! How did you do that via bindings? > >> As a test, I typed a value which is outside the Min/Max value, to see what I >> need to implement. To my surprise, a sheet is created saying "The Value 500 >> is too large." It prompts the user to Discard or Keep Change. >> Where did this come from? And how do I override this? > > Implement a KVC validation method for your property. I guess. > See > file:///Library/Developer/Shared/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html#//apple_ref/doc/uid/20002173 > >> I can't find info in the docs. I do see a vague reference to a "sheet" in >> the NSObjectController Docs, with add/remove selectors, etc. But nothing >> concrete. >> Ideas? >> >> Thanks! >> >> bob. >> >> >> ___ >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/magnard%40web.de >> >> This email sent to magn...@web.de >> > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sheet created by NSObjectContoller??
Oops, missed the number formatter.. You are right.. number formatter is needed for the min/max values to show up. Which makes me thing that this is a mechanism that is a part of the number formatter. Will dig around there. Will post a note if I find anything. bob. On Dec 17, 2011, at 2:43 PM, Peter wrote: > Thanks for the info! > I never realized that this is possible with object controllers. > > But wait a minute: While playing around with this mechanism, it turns out > that you have a number formatter installed on the text field for this to > work. I realized this when my app crashed after I had removed the number > formatter with the max value binding still in place! Removing the number > formatter made the min and max bindings as well as the discard?-dialogs > disappear obviously. > > Just tested this with the example project I referred to in my posting "Re: > responding to NSStepper clicks" of tonight: > Implementing the validateXXX method for your property XXX does not help at > all. > Sorry for pointing into the wrong direction. > I had hoped you might need to overwrite something in your object controller > subclass but there seems to be nothing. > > Here is a very old thread initiated by Matt Neuburg on cocoabuilder on the > issue: > > http://www.cocoabuilder.com/archive/cocoa/73532-who-is-putting-up-this-dialog.html > > And another posting on the issue: > > http://www.cocoabuilder.com/archive/cocoa/101845-using-validatevalue-forkey-error-to-limit-slider-range-with-cocoa-bindings.html > > I couldn't make any of these work though. > > And that's about all I could find - no answers really. > > Am 17.12.2011 um 20:17 schrieb Robert Monaghan: > >> The binding is straight forward.. >> >> You create an NSObjectController, and set the "Mode" to "Class" and the >> Class Name to your object with a bunch of NSNumbers. (prepared with >> @property/@synthesize, naturally) >> >> In my NSTextField, I bind my "value", "Min Value" and "Max Value" to the >> NSObjectController, specifying which NSNumbers are to be used for each. >> So I have have inside my object a set of NSNumbers called "maxVal" "minVal" >> and "currentVal", my NSTextField would reflect those values. >> >> If minVal is 10, maxValue is 20, and currentValue is 15. Everything is >> great. Now type in 500 in the NSTextField, and out pops a sheet! >> >> I am going to see about validation. Perhaps that is how this is happening. >> >> bob.. >> >> >> >> On Dec 17, 2011, at 11:10 AM, Peter wrote: >> >>> >>> Am 17.12.2011 um 19:59 schrieb Robert Monaghan: >>> >>>> Hi Everyone, >>>> >>>> Perhaps someone can help point me in the right direction on this: >>>> >>>> I have an NSObjectController that maintains a UI for me. >>>> I have an NSTextField which contains numerical value. You could type in a >>>> number, which populates an NSNumber object deep inside my code.. >>>> Magically, my NSObjectController does its thing and maintains the UI. Very >>>> cool stuff! >>>> >>>> I just recently updated my bindings for this NSTextField, so that a a Min >>>> and Max Value is respected. >>> >>> Interesting! How did you do that via bindings? >>> >>>> As a test, I typed a value which is outside the Min/Max value, to see what >>>> I need to implement. To my surprise, a sheet is created saying "The Value >>>> 500 is too large." It prompts the user to Discard or Keep Change. >>>> Where did this come from? And how do I override this? >>> >>> Implement a KVC validation method for your property. I guess. >>> See >>> file:///Library/Developer/Shared/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html#//apple_ref/doc/uid/20002173 >>> >>>> I can't find info in the docs. I do see a vague reference to a "sheet" in >>>> the NSObjectController Docs, with add/remove selectors, etc. But nothing >>>> concrete. >>>> Ideas? >>>> >>>> Thanks! >>>> >>>> bob. >>>> >>>> >>>> ___ >>>> >>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >>>> >>>> Please do
Finder File Size discrepancy..
Hi Everyone, I am not sure where else to post this, so here is where I am going to start.. I have an application that is saving a custom file. It has a progress bar that shows the percentage of the file written, along with a byte count that is rounded to the nears Kilo/Mega/Gigabyte size. Not a big deal, as this is trivial to calculate out. However, I just had a bug report from a beta tester, that shows that the Finder reports the Size of the file vastly different from what my application shows in the save progress indicator. I thought that was strange, yet sure enough there is a pretty big difference. I have a file that is 352524244 bytes in size. My application calculates it to be 336.19 Megs in size. Finder displays this as 352.5 MB. So, if I am not mistaken, Apple isn't dividing by 1024, but rather by 1000? Has anyone else had to work though this? Thanks! bob. Robert Monaghan Glue Tools LLC P.O.Box 24124 Santa Barbara, CA, 93121 United States tel: +1 805 456 7997 fax: +1 805 456 7998 www.gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Finder File Size discrepancy..
Wow, I wake up one morning, and the definition of Megabytes change. Did anyone explain this to the computers? The last time I checked, they still used binary.. ;) bob. On Dec 27, 2011, at 8:54 AM, Mikkel Islay wrote: > > On 27 Dec 2011, at 17:48, Robert Monaghan wrote: >> >> I have a file that is 352524244 bytes in size. >> My application calculates it to be 336.19 Megs in size. >> Finder displays this as 352.5 MB. >> >> So, if I am not mistaken, Apple isn't dividing by 1024, but rather by 1000? >> >> Has anyone else had to work though this? > > Why, yes. :) > Have a look at these pages: > http://support.apple.com/kb/TS2419 > http://en.wikipedia.org/wiki/Megabyte#cite_note-4 > > Mikkel ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Finder File Size discrepancy..
Hi All, I was aware of the inflated numbers for marketing hard drives. But I wasn't aware that Apple jumped on the marketing bandwagon. (Apple adopt marketing terms? Never..) Well, as I have a 10.6/10.7, base 2 is history, I guess. I am going to keep the metric terminology myself. (MB/KB, etc.) I had not heard that SI had adopted metric terms.. :) Thanks for your thoughts! Its an annoying problem. Not a major issue. Enjoy the Holidays! bob. On Dec 27, 2011, at 11:07 AM, Scott Ribe wrote: > On Dec 27, 2011, at 9:57 AM, Robert Monaghan wrote: > >> Wow, I wake up one morning, and the definition of Megabytes change. >> Did anyone explain this to the computers? The last time I checked, they >> still used binary.. ;) > > Disk drive manufacturers have been doing this for 20 years. > > -- > Scott Ribe > scott_r...@elevated-dev.com > http://www.elevated-dev.com/ > (303) 722-0567 voice > > > > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
ALLOC/FREE problems with a NIB..
Hi Everyone, I seem to be crashing with the following message: malloc: *** error for object 0x104839c08: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug However, malloc_error_break never gets called. I have a malloc stack log going, and when I do a malloc_history for my object, I get a tonne of the following (this is the last entry): ALLOC 0x104839c00-0x10483a411 [size=2066]: thread_7fff737ac960 |start | main | NSApplicationMain | +[NSBundle(NSNibLoading) loadNibNamed:owner:] | +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] | +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] | loadNib | _decodeObject | _decodeObjectBinary | -[NSIBObjectData initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSSet(NSSet) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSWindowTemplate initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSClassSwapper initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSSplitView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSScrollView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSClipView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSTableView initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSScroller initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSScroller initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSBox initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSTextFieldCell initWithCoder:] | -[NSActionCell initWithCoder:] | -[NSCell initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSFont initW
Re: ALLOC/FREE problems with a NIB..
I can't find any cases of my NIB being deallocated. It appears as if the NIB is loaded once. One idea I have, is that this could be a XIB file that contains a NSCollectionView with the NSView for the actual Icon. Bob.. On Jan 1, 2012, at 9:51 AM, Robert Monaghan wrote: > Hi Everyone, > > I seem to be crashing with the following message: > malloc: *** error for object 0x104839c08: incorrect checksum for freed object > - object was probably modified after being freed. > *** set a breakpoint in malloc_error_break to debug > > However, malloc_error_break never gets called. > I have a malloc stack log going, and when I do a malloc_history for my > object, I get a tonne of the following (this is the last entry): > > ALLOC 0x104839c00-0x10483a411 [size=2066]: thread_7fff737ac960 |start | main > | NSApplicationMain | +[NSBundle(NSNibLoading) loadNibNamed:owner:] | > +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] | > +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] | > loadNib | _decodeObject | _decodeObjectBinary | -[NSIBObjectData > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSSet(NSSet) > initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | > _decodeObjectBinary | -[NSWindowTemplate initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSClassSwapper initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) > initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | > _decodeObjectBinary | -[NSSplitView initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) > initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | > _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSCustomView > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | > -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | > -[NSScrollView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | > -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | > -[NSClipView initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | > -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | > -[NSTableView initWithCoder:] | -[NSControl initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSScroller > initWithCoder:] | -[NSControl initWithCoder:] | -[NSView initWithCoder:] | > _decodeObject | _decodeObjectBinary | -[NSScroller initWithCoder:] | > -[NSControl initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) > initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | > _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSBox initWithCoder:] | -[NSView initWithCoder:] | > _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) initWithCoder:] | > -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | > -[NSView initWithCoder:] | _decodeObject | _decodeObjectBinary | > -[NSArray(NSArray) initWithCoder:] | -[NSKeyedUnarchiver > _decodeArrayOfObjectsForKey:] | _decodeObjectBinary | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSCustomView initWithCoder:] | -[NSView > initWithCoder:] | _decodeObject | _decodeObjectBinary | -[NSArray(NSArray) > initWithCoder:] | -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] | > _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSTextField initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObjectBinary | -[NSButton initWithCoder:] | -[NSControl > initWithCoder:] | -[NSView initWithCoder:] | _decodeObject | > _decodeObj
Re: ALLOC/FREE problems with a NIB..
Hi Martin, Thanks for the suggestion! Believe it or not, it ended up being a for loop overwriting memory under a very specific condition. This would cause a malloc to be corrupted, (for instance.) Nothing like a wild goose chase. I looked everywhere for this one. Best Regards, bob. On Jan 3, 2012, at 3:50 PM, Martin Wierschin wrote: > Hi Robert, > >> I seem to be crashing with the following message: >> malloc: *** error for object 0x104839c08: incorrect checksum for freed >> object - object was probably modified after being freed. >> *** set a breakpoint in malloc_error_break to debug >> >> However, malloc_error_break never gets called. >> I have a malloc stack log going, and when I do a malloc_history for my >> object, I get a tonne of the following (this is the last entry): > > The last entry in malloc_history isn't necessarily the cause of the problem. > You'll want to inspect and think about all the objects that ever existed at > 0x104839c08, especially those you control more directly. > > It's very unlikely that the NIB loading code is the source of your problems; > the NIB loading code is just reusing the memory address. What's more likely > is that some object/memory you allocated earlier was deallocated, and your > code is still incorrectly trying to use this now deallocated object. > > Have you tried using NSZombie yet? > > ~Martin > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Application badge (like Mail) in views other than the doc icon?
Hi Everyone, My app has an NSCollectionView of devices, each with a custom icon. I have a need to display the number of downloads happening from a given device. The way that I want to do this, is to place a badge on each icon. I have just tried to implement a "clone" of the NSDockTile badge that Mail uses. Needless to say, it isn't a perfect match.. :) I was wondering if anyone out there has been able to coax "setBadgeLabel" to draw on a custom NSView, rather than the dockTile? Could I do something like this: (typed into the email.. errors are likely) [[NSApp dockTile] setContentView:myCustomView]; [[NSApp dockTile] setBadgeLabel:@"20"]; [[NSApp dockTile] setContentView:nil]; Would this end up causing weirdness with my App's icon? (Or should I stick to my own routines for drawing a badge?) Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Giving NSProgressIndicator a new look?
Hi Everyone.. Can someone point me to a blog or webpage that describes how to give an existing NSControl a face lift? I want to change the "baby blue" appearance of NSProgressIndicator, to match my UI. Thanks! bob, ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSCollectionView and selecting a range?
Hi Everyone, This has been asked before by another Cocoa-dev follower, but there wasn't an answer... I have an NSCollectionView where I want to be able to "Shift-click" a range of Icons. Strangely, I can Command-click a range of individual icons, but a shift-click of a range will not work. What would cause this behavior? As a last resort measure, I am attempting to pipe in a flagsChanged/NSResponder routine, but this seems really dumb. Before I proceed with using a hammer to fix this, perhaps someone knows an alternative? Thanks! Bob. ___ 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
NSCollectionView mouseDown/drag is really slow.
Hi Everyone, I have just read all of the posts that I can find about the NSCollectionView and selecting an item (or items) for a drag operation. As others have pointed out, the selection takes about 1 second for a drag operation to be processed. This is a real sore spot when using the NSCollectionView in my app. My beta testers are actually logging this as a bug. Is there a technique that can be done in -mouseDown: to speed up the time for a drag operation? Or am I stuck with this? Thanks! bob. ___ 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: NSCollectionView mouseDown/drag is really slow.
Hi Lee Ann, Thanks for the info.. I was going to ask you if you had done any more digging. Heheh, my users are mostly using Lion, too. I guess more bug reports with Apple is the way to go on this. bob. On Feb 7, 2012, at 7:52 PM, Lee Ann Rucker wrote: > > On Feb 7, 2012, at 7:47 AM, Robert Monaghan wrote: > >> Hi Everyone, >> >> I have just read all of the posts that I can find about the NSCollectionView >> and selecting an item (or items) for a drag operation. As others have >> pointed out, the selection takes about 1 second for a drag operation to be >> processed. This is a real sore spot when using the NSCollectionView in my >> app. My beta testers are actually logging this as a bug. >> >> Is there a technique that can be done in -mouseDown: to speed up the time >> for a drag operation? Or am I stuck with this? >> >> Thanks! > > I've done a lot of digging into it and haven't found anything; > NSCollectionView does all the processing in a loop triggered by mouseDown: > instead of doing the mouseDragged:/mouseUp: approach, and replicating the > entire mouseDown: in a subclass is not really viable. It is better in Lion > and the users who filed bugs against my app in Snow Leopard seem happy with > Lion. > ___ 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: Xcode - An Apple Embarrassment
Hi Wade, Many of Apple's other products are pretty solid. Its a shame that XCode 4 is pretty unstable. XCode 3.2.6 -might- crash once every 2 to 3 months, Xcode 4.2 -will- crash about once an hour. I am not even interested in trying Xcode 4.3. This reminds me of how bad Microsoft Office used to be. Here is my €0.02.. - Typing in a keyword into the Organiser to search the Developer documentation is heinously slow. On 12-core mac pro, Xcode will actually hang while I type the keyword in. **Wow** how is this still possible in a GCD world? - Full IB Plugins would be incredibly handy for me. Hopefully there is a decision to re-implement this. (Right after they fix some bugs that causes XCode to crash all of the time.) - UI "Preferences" get stuck on a regular basis. My current snag is that my Toolbar is frozen into the "permanently hidden". Short of blowing away my Xcode prefs (again.) I have to keep re-opening the toolbar. None of these problems are a show stopper, but I keep having that urge to switch back to XCode 3. Unfortunately, I have some products that I foolishly started in XCode 4.x and it would be painful to try to regress back. (Not impossible, mind you.. but really painful.) The bonus would be that the Dev tool would be really solid. I would get IB Builder Plugins support. The downside is that I wouldn't get the latest Clang complier/debugger and other nifty features that XCode 4.x has. If anyone managing Xcode @ apple is reading, could you see about working on making XCode 4.4 stable? That would actually be a huge new feature to offer the developer community. I could then "happily" wait for a dev doc search textfield that doesn't choke my 12-core. Bob.. On Mar 1, 2012, at 1:41 AM, Wade Tregaskis wrote: >> *No*. I've said it before (right here) and I'll say it again; this is *not* >> jumping to the documentation, and it is *not* doing what Xcode 3 did. It >> switches to the documentation window and it enters the double-clicked word >> into the search field, and it does the search, but it doesn't display >> the actual documentation on the double-clicked word. > > Indeed, the regressions around this simple piece of functionality are > disturbing. I also find that it rarely handles double clicks correctly. I > have to triple or quadruple-click much of the time. It's often faster to > just bring up the organiser (command-shift-2, obviously) and navigate to the > desired docs directly, than play some kind of bizarro skill game with my > mouse button. > >> Once again I put forward my pet wild-and-crazy "dog food" theory that the >> people at Apple do not actually *use* Xcode for serious work. I know it >> sounds wild and crazy, but I have two kinds of evidence for this theory: > > Occam's razor (and my own nearly four years working on developer tools at > Apple) will present a different explanation: Xcode is used exhaustively > within Apple, but the Xcode team just aren't good at producing a solid > product. I'm not sure why that is; all the people I know on the Xcode team > are very good developers, at least individually. > > Someone else pretty well hit the nail on the head earlier when they suggested > that developer tools just aren't given much top-level interest. I don't know > if that can be blamed for the end result though. ___ 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: rerunning an NSOperation object
Hi Shane, NSOperationQueue will not let you re-run a previously run NSOperation Object. What I did to get around the problem was to create my own NSObject that does what I want. I then wrapped the object with an NSOperation object to run. Once complete, I can simply re-use my NSObject by wrapping a new NSOperation object around it and feeding it to NSOperationQueue. It works like a charm! bob. On Mar 6, 2011, at 4:33 AM, Shane wrote: > I have an NSOperation object that has been placed in an > NSOperationQueue. I then execute that NSOperation and all works > normal. > > What I'd like to do is then run that task again, however, when I do > run it I get the following error when trying to add that object to the > queue again. > > Caught NSInvalidArgumentException*** -[NSOperationQueue > addOperation:]: operation is finished and cannot be enqueued > > I then see that the "NSOperationQueue Class Reference" says this about > addOperation: ... > "Similarly, this method throws an NSInvalidArgumentException exception > if the operation is currently executing or has already finished > executing." > > So it has finished executing, and I'd like to know how to execute it > again but w/o having to build a new object. Is there a way to rerun an > NSOperation object, or should I do something else besides call > addOperation: again? > ___ > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Shared CoreData DataModel and DB file..
Is it possible to share a DataModel and resulting db file between 2 apps? If so, what sort of pitfalls are present? I want to create an App that creates the DB file, and a plugin for another App, that reads the database file. Thanks! bob.. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Shared CoreData DataModel and DB file..
Nice! I suspected as much. So, I should implement a file lock mechanism, as well, then. I have every reason to believe that people would use the database file over a network filesystem. bob.. On Dec 28, 2009, at 10:09 AM, Mike Abdullah wrote: > Yes. If you use the SQLite store, it automatically uses filesystem locking. > Indeed, that is how CalendarStore and AddressBook operate under the hood > these days I believe. > > The major caveat is that the locking doesn't work if the file is accessed > from two different filesystems. i.e. a local file which another machine is > also trying to access over the network at the same time. > > Mike. > > On 28 Dec 2009, at 17:50, Robert Monaghan wrote: > >> Is it possible to share a DataModel and resulting db file between 2 apps? >> If so, what sort of pitfalls are present? >> >> I want to create an App that creates the DB file, and a plugin for another >> App, that reads the database file. >> >> Thanks! >> >> bob.. >> >> ___ >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >> >> This email sent to cocoa...@mikeabdullah.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Shared CoreData DataModel and DB file..
Ideally, it is on the same machine, with the same user. Again, the DB file is read only, and due to the nature of the data, it isn't likely that the data will be updated while the plugin is reading. I still need to do better planning. bob. On Dec 28, 2009, at 10:29 AM, Mike Abdullah wrote: > But from remote and local machine at once? This sounds dangerously like a > multi-user setup which Core Data is very much NOT designed for. Trying to > force it will only result in pain later. > > On 28 Dec 2009, at 18:19, Robert Monaghan wrote: > >> Nice! I suspected as much. >> >> So, I should implement a file lock mechanism, as well, then. I have every >> reason to believe that people would use the database file over a network >> filesystem. >> >> bob.. >> >> >> On Dec 28, 2009, at 10:09 AM, Mike Abdullah wrote: >> >>> Yes. If you use the SQLite store, it automatically uses filesystem locking. >>> Indeed, that is how CalendarStore and AddressBook operate under the hood >>> these days I believe. >>> >>> The major caveat is that the locking doesn't work if the file is accessed >>> from two different filesystems. i.e. a local file which another machine is >>> also trying to access over the network at the same time. >>> >>> Mike. >>> >>> On 28 Dec 2009, at 17:50, Robert Monaghan wrote: >>> >>>> Is it possible to share a DataModel and resulting db file between 2 apps? >>>> If so, what sort of pitfalls are present? >>>> >>>> I want to create an App that creates the DB file, and a plugin for another >>>> App, that reads the database file. >>>> >>>> Thanks! >>>> >>>> bob.. >>>> >>>> ___ >>>> >>>> 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: >>>> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >>>> >>>> This email sent to cocoa...@mikeabdullah.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: >> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net >> >> This email sent to cocoa...@mikeabdullah.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Cloning an NSXMLElement and its children?
Hi Everyone.. Is there an easy way to clone an XML tree in Cocoa? Or will I be going thru recursion code hell? :) Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cloning an NSXMLElement and its children?
Its a fairly deep copy. There are several nodes deep. I am trying to copy parts of the tree, so that I don't have to write code to regenerate them. bob. On Feb 2, 2010, at 4:26 PM, Jens Alfke wrote: > > On Feb 2, 2010, at 4:16 PM, Robert Monaghan wrote: > >> Is there an easy way to clone an XML tree in Cocoa? Or will I be going thru >> recursion code hell? > > Did you try -copy? NSXMLNode implements NSCopying. The only question is > whether it's a deep or a shallow copy. > > —Jens ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cloning an NSXMLElement and its children?
Actually, I was able to use copyWithZone to do what I needed. Nice! bob. On Feb 2, 2010, at 4:28 PM, Robert Monaghan wrote: > Its a fairly deep copy. There are several nodes deep. > I am trying to copy parts of the tree, so that I don't have to write code to > regenerate them. > > bob. > > On Feb 2, 2010, at 4:26 PM, Jens Alfke wrote: > >> >> On Feb 2, 2010, at 4:16 PM, Robert Monaghan wrote: >> >>> Is there an easy way to clone an XML tree in Cocoa? Or will I be going thru >>> recursion code hell? >> >> Did you try -copy? NSXMLNode implements NSCopying. The only question is >> whether it's a deep or a shallow copy. >> >> —Jens > > ___ > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
How to get NSPathControl to resize programatically?
Hi Everyone, I am changing the NSURL of a path, that drives NSPathControl. If I edit the path so that the new text element of that path is longer or shorter than the original path, I would need to have NSPathControl redraw itself.. Here is an example of what I am doing: (myPathControl is a NSPathControl object.) NSPathComponentCell *cell = [myPathControl clickedPathComponentCell]; NSString *searchPath = [[cell URL] path]; NSURL *newPathURL = [NSURL fileURLWithPath:[[searchPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"NEWTEXT"]]; [cell setURL:newPathURL]; [cell setTitle:@"NEWTEXT"]; [myPathControl updateCell:cell]; [myPathControl setNeedsDisplay:YES]; This does make the change to the NSPathControl, and I get a new URL when I request one, but I can't figure out how to get the NSPathControl to redraw itself, taking into account the new Cell sizes. Any suggestions? Do I have to brute-force a resize of the cell and calculate it myself?? Thanks! bob.. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get NSPathControl to resize programatically?
Yeah, I did.. that didn't work either. Tried: [myPathControl sizeToFit]; bob. On Mar 9, 2010, at 12:33 PM, Sean McBride wrote: > On Tue, 9 Mar 2010 12:26:14 -0800, Robert Monaghan said: > >> I am changing the NSURL of a path, that drives NSPathControl. >> If I edit the path so that the new text element of that path is longer >> or shorter than the original path, >> I would need to have NSPathControl redraw itself.. > > Did you try "sizeToFit"? > > -- > > Sean McBride, B. Eng s...@rogue-research.com > Rogue Researchwww.rogue-research.com > Mac Software Developer Montréal, Québec, Canada > > ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Using a NSTextField inside a NSMenuItem?
Hi Everyone, Another Question: How does one make a NSTextField work inside an NSMenuItem? (For 10.5/10.6) I can place the NSTextField into a View that I've created in a NIB file, and have added it to the NSMenuItem using setView: It shows up perfectly, and I can pre-populate the text field using a setStringValue call. However, NSControlTextDidEndEditingNotification (as well as the other NSTextField notifications) do not work, nor can I get any results back from the user. Doing a stringValue on the Textfield only returns the original data from the setStringValue call that I did when I attached the view to the NSMenuItem. What am I missing? Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get NSPathControl to resize programatically? (Solved..)
I figured out how to get the NSPathControl to "resize" after changing an NSPathComponentCell URL. I realize that the description I gave is vague, so here is a better explanation.. I am changing the URL of a NSPathComponent in the middle of NSPathControl's overall URL. By making the change, I was hoping that the imagery would adjust itself after I made the change. This turned out to not be the case. Here is what I discovered: NSPathComponentCell contains its "fragment" of the path. If you have a path like: /Users/myhome/Movies/Summer/MyMovie.mov and you want to change "Summer" to "Winter", you would find the NSComponentCell and make the URL change. (ie: /Users/myhome/Movies/Summer becomes /Users/myhome/Movies/Winter) The problem is that NSPathControl still sees the original path with "Summer". I found that I had to iterate through the rest of the NSPathComponentCells in NSPathControl, and update each of the subsequent NSComponentCell objects with the new URL fragments. I then took the last URL fragment, and then updated NSPathControl with the newly changed URL. That no only re-drew the artwork, but also correctly updated the URL path in NSPathControl. A lot of work, but thats what it took. bob.. On Mar 9, 2010, at 12:57 PM, Robert Monaghan wrote: > Yeah, I did.. that didn't work either. > Tried: > [myPathControl sizeToFit]; > > bob. > > On Mar 9, 2010, at 12:33 PM, Sean McBride wrote: > >> On Tue, 9 Mar 2010 12:26:14 -0800, Robert Monaghan said: >> >>> I am changing the NSURL of a path, that drives NSPathControl. >>> If I edit the path so that the new text element of that path is longer >>> or shorter than the original path, >>> I would need to have NSPathControl redraw itself.. >> >> Did you try "sizeToFit"? >> >> -- >> >> Sean McBride, B. Eng s...@rogue-research.com >> Rogue Researchwww.rogue-research.com >> Mac Software Developer Montréal, Québec, Canada >> >> > > ___ > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com > > This email sent to b...@gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CF/NSNotifications on the same thread not working.
Hi Everyone, I am trying to post a notification (a CFNotificationCenterPostNotification) on a thread from a CFNotificationCenterGetLocalCenter, to a NSNotificationCenter defaultCenter. All on the same thread, spun off from my main thread. The observer that I am adding, never gets called. If I move all of this to my main thread, everything works as expected. I am stumped. Is there something special that I have to do, to get a notification to work entirely on the same thread? bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Refreshing an NSTableView with some columns using bindings, others not..
Hi Everyone, I have a reasonably mixed NSTableView object.. I have some columns bound to my NSArrayController, which drives an NSCell with a Checkbox. I have other Columns which are driven by the traditional delegate calls, so that I can add some logic to change the text color, depending upon the state of the objects in the NSArray. What I am seeing, is that if I have some sort of activity that changes the state of the object, my checkbox is updated immediately by the NSArrayController. However, the delegate calls that are used to change the Text Color only occur if I click inside my UI. Is there a way to make this update along side the bindings? Or am I going to have to create an IBOutlet to my TableView, and do a [tableView reloadData] everywhere that I touch any object in my NSArrayController? Should I subclass my NSArrayController and have it issue this command? Thanks! bob. ___ 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
One more try - NSCollectionView multi-selection problem..
Hi Everyone, In a previous posting, I had a problem with NSCollectionView not selecting a range of objects, when shift-selecting items. For example, if I were to click on object "3" and then shift-click on object "5", I would expect a range of 3,4,5 to be highlighted. Instead only 3 and 5 are selected. Ok, so multi-selection works. Sorta.. (BTW, this same behavior happens with Imagebrowser sample app from Apple.) I added an observer to my NSArrayController's "selectionIndexes" to see what it think is happening. Sure enough, the NSArrayController is getting a bunch of ranges that look like this: [number of indexes: 2 (in 2 ranges), indexes: (2 4)] I would have expected something like this: [number of indexes: 3 (in 1 ranges), indexes: (2-4)] Suggestions? I see a "setSelectionIndexes:" selector in the NSCollectionView object. Do I need to do something here? It seems like a huge headache to "teach" NSCollectionView to do a properly shift-selection of a range. Thanks! bob. ___ 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: One more try - NSCollectionView multi-selection problem..
Ok, So in the meantime, I have a bunch of customers filing bugs/feature requests to implement this ability.. (Its a popular request, shall we say..) Is this something that can be overridden, turned on/off? Has anyone done this? Thanks! bob. On Jul 10, 2012, at 3:48 AM, Graham Cox wrote: > I believe for icon-type views, the idea that shift-selecting selects a range > of items is no longer considered best practice these days. For example, the > icon view in the Finder doesn't do that (list view does). > > command-click and shift-click are the same thing for icon views, i.e. they > toggle the clicked item. > > --Graham > > > > > > On 09/07/2012, at 5:34 PM, Robert Monaghan wrote: > >> Hi Everyone, >> >> In a previous posting, I had a problem with NSCollectionView not selecting a >> range of objects, when shift-selecting items. >> For example, if I were to click on object "3" and then shift-click on object >> "5", I would expect a range of 3,4,5 to be highlighted. >> Instead only 3 and 5 are selected. >> >> Ok, so multi-selection works. Sorta.. >> >> (BTW, this same behavior happens with Imagebrowser sample app from Apple.) >> >> I added an observer to my NSArrayController's "selectionIndexes" to see what >> it think is happening. >> Sure enough, the NSArrayController is getting a bunch of ranges that look >> like this: >> >> [number of indexes: 2 (in 2 ranges), indexes: (2 4)] >> >> I would have expected something like this: >> [number of indexes: 3 (in 1 ranges), indexes: (2-4)] >> >> Suggestions? >> I see a "setSelectionIndexes:" selector in the NSCollectionView object. >> Do I need to do something here? It seems like a huge headache to "teach" >> NSCollectionView to do a properly shift-selection of a range. > ___ 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: cocoabuilder closed?
Hi, I just took a look. It seems to have a fairly current bunch of email from today. bob. On Jul 10, 2012, at 8:47 PM, Andy Lee wrote: > I can get to the site but it doesn't seem to have been updated since June 25. > > --Andy > > On Jul 10, 2012, at 2:35 PM, Richard Altenburg (Brainchild) wrote: > >> I just tried the website and it seems to work, I searched for my own name >> and even found some posts I was not even aware from many years ago ;-) >> >> You could try to contact Bertrand Mansion, the site owner, on >> cocoabuil...@mamasam.com for questions about the status. >> >> >> [[[Brainchild alloc] initWithName:@"Richard Altenburg"] saysBestRegards]; >> >> Op 10 jul. 2012, om 15:03 heeft Chris Paveglio het volgende geschreven: >> >>> Does anyone know what's going on with Cocoabuilder.com? I haven't been able >>> to get there for more than a month, on work or on home computers. >> >> ___ >> >> 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/aglee%40mac.com >> >> This email sent to ag...@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/bob%40gluetools.com > > This email sent to b...@gluetools.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
NSMutableData and Pinned Memory buffers..
Hi Everyone, I have just run head long into an issue with NSMutableData and existing buffers. I have the following code: UInt8 *sourcebytes = [clImgEngine srcBuffer]; [self setData:[NSMutableData dataWithBytesNoCopy:sourcebytes length:[clImgEngine inRangeByteCount] freeWhenDone:NO]]; UInt8 *resultBytes = [[self data] mutableBytes]; The source is a pinned memory buffer from OpenCL. What I want to do, is to pass this buffer inside a NSMutableData wrapper and have another object for some work. Seems simple enough, except that NSMutableData changes the memory buffer in the background. "sourcebytes" starts with an address such as: 0x00012361b000 and "resultBytes" returns 0x000136fe2000 Naturally, my work object doesn't see any data from "sourcebytes", as NSMutableData has moved the buffer. I thought that freeWhenDone:NO prevented ownership of the buffer.. Can anyone suggest a way to prevent this from happening? I need the buffer to stay "pinned". Thanks in advance! bob. ___ 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: NSMutableData and Pinned Memory buffers..
Thanks for the suggestion, Kevin! I went ahead and created a really crude subclass of NSMutableData. It seems to work for my situation. Attached is the code, for posterity. (I am sure I won't be the only one working around this.) Any suggestions to make this a bit more "Proper" are welcome. bob. // // GT_NSMutableData.h // // Created by Robert Monaghan on 12/13/12. // Copyright (c) 2012 Glue Tools LLC. All rights reserved. // #import @interface GT_NSMutableData : NSMutableData { void *_gt_buffer; NSUInteger _gt_length; BOOL _gt_freeWhenDone; } @property (readwrite) NSUInteger length; @end // // GT_NSMutableData.m // // Created by Robert Monaghan on 12/13/12. // Copyright (c) 2012 Glue Tools LLC. All rights reserved. // #import "GT_NSMutableData.h" @implementation GT_NSMutableData + (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b { return [[[GT_NSMutableData alloc] initWithBytesNoCopy:bytes length:length freeWhenDone:b] autorelease]; } - (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b { self = [super init]; if (self) { _gt_buffer = bytes; _gt_length = length; _gt_freeWhenDone = b; } return self; } - (void)dealloc { if (_gt_freeWhenDone) free(_gt_buffer); [super dealloc]; } - (void)increaseLengthBy:(NSUInteger)extraLength { } - (void)setLength:(NSUInteger)length { } - (NSUInteger) length { return _gt_length; } - (const void *)bytes { return _gt_buffer; } - (void *)mutableBytes { return _gt_buffer; } - (void)replaceBytesInRange:(NSRange)range withBytes:(const void *)bytes { } - (void)replaceBytesInRange:(NSRange)range withBytes:(const void *)replacementBytes length:(NSUInteger)replacementLength { } - (void)resetBytesInRange:(NSRange)range { } - (void)setData:(NSData *)data { _gt_buffer = (void *)[data bytes]; } @end On Dec 13, 2012, at 3:22 PM, Kevin Perry wrote: > NSMutableData currently ignores (and always has, to my knowledge) the no-copy > "hint" and always copies the bytes into an internal buffer in case something > tries to change the length of the NSMutableData. > > It would not be too difficult to make a subclass of NSMutableData that > doesn't copy and throws an exception when something tries to change the > length. That would violate the Liskov substitution principle though, so at > the very least, you want to prevent any code that doesn't understand the > fixed-length restriction from getting ahold of one of these objects. > > [kevin perry]; > > On Dec 13, 2012, at 2:28 PM, Robert Monaghan wrote: > >> Hi Everyone, >> >> I have just run head long into an issue with NSMutableData and existing >> buffers. >> I have the following code: >> >> >> UInt8 *sourcebytes = [clImgEngine srcBuffer]; >> [self setData:[NSMutableData >> dataWithBytesNoCopy:sourcebytes length:[clImgEngine inRangeByteCount] >> freeWhenDone:NO]]; >> UInt8 *resultBytes = [[self data] mutableBytes]; >> >> The source is a pinned memory buffer from OpenCL. What I want to do, is to >> pass this buffer inside a NSMutableData wrapper and have another object for >> some work. >> Seems simple enough, except that NSMutableData changes the memory buffer in >> the background. >> >> "sourcebytes" starts with an address such as: 0x00012361b000 >> and "resultBytes" returns 0x000136fe2000 >> >> Naturally, my work object doesn't see any data from "sourcebytes", as >> NSMutableData has moved the buffer. >> I thought that freeWhenDone:NO prevented ownership of the buffer.. >> >> Can anyone suggest a way to prevent this from happening? I need the buffer >> to stay "pinned". >> >> Thanks in advance! >> >> bob. >> >> ___ >> >> 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/kperry%40apple.com >> >> This email sent to kpe...@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: KVO, which thread?
Hi, Todd, Set a breakpoint and see which thread it stops on. (It is probably not the main thread. But you will find out for certain with the breakpoint.) Bob Sent from my iPhone On Feb 4, 2013, at 22:44, Todd Heberlein wrote: > I have an NSInvocationOperation, anOp, and register to observe when its > isFinished variable is set > > [anOp addObserver:self forKeyPath:@"isFinished" > options:NSKeyValueObservingOptionNew context:NULL]; > > When my operation is done, isFinished is set, and thus my method > -observeValueForKeyPath:ofObject:change:context: is called, which thread is > it being called on? The main thread, or the thread created to process the > NSInvocationOperation? > > Thanks, > > Todd > > ___ > > 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/bob%40gluetools.com > > This email sent to b...@gluetools.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
Graphics "playback" suggestion?
Hi Everyone, I am trying to figure out what the best method is, to playback "generated" graphics. I am downloading image data over ethernet, and then processing the imagery. Currently I am creating a NSBitmapImageRep, and populating the buffer with my pixel data. I then draw this inside an NSView. If I create a for loop, the imagery isn't been updated in the view, even if I do a "setNeedsDisplay". Is there a better way to do this? bob.. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTableColumn not usable with binder of class NSTextValueBinder
Hi Everyone.. I need to revive this thread. http://www.cocoabuilder.com/archive/message/cocoa/2008/8/19/216148 I have a NSTextColumn, with a custom NSCell containing a custom view. I am getting the same exception has mentioned in this email thread. The part that isn't clear, is how to fix this. I have switched my sub-classed custom NSCell to an NSActionCell. However, I am still getting the same exception. In the previous thread, there was a mention of a bind:toObject:withKeyPath:options to clear this up. But no indication of which object is binding to which object. Or why I am even binding anything. (My Custom NSCell doesn't even use/require bindings.) Could someone shed some more information on this fix? -- I am using IB 3.1.2 (677) and Xcode 3.1.2 Thanks in advance! bob. Robert Monaghan Glue Tools LLC 629 State St. Suite 220 Santa Barbara, CA, 93101 United States tel: +1 805 456 7997 fax: +1 805 456 7998 www.gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Binding Buttons and Popup Menus to NSDictionary made from a prefs plist?
Hi Everyone, I am trying to wrap my head around using a plist. Everything that I have seen on the mailing list so far, involves using an NSTableView to work with NSDictionaries. Here is what I have set up. I have several NSButtons and pre-populated NSPopup Buttons, where the index values or states are stored as NSNumbers inside a plist file. Fairly easy to figure out. You just specify a key, and you get an NSNumber Object. I am now trying use several of these plists. I have a list of projects in an NSTextColum, each with its own plist. I want to select one of the projects in the tableview, and have the controls changed to reflect the states from the appropriate plist. Again, in theory, plists should work well, here. So far, I have an NSArrayController working well, with a list of projects/plists. However, I can't seem to get the bindings to work for the various controls. I am attempting to bind the buttons and popup menus to *something" that that can drive them. I not only want the controls to be updated with each project that is selected, but have the NSDictionary that is holding the plist, to be updated when the user changes the controls. You would think that this is straight forward. Here is what I have tried: NSDictionaryController. I have an observeValueForKeyPath set up, to watch my NSArrayController, with a list of projects. Once I have a project selected, it then binds an NSMutableDictionary to the NSDictionaryController Something like this: [seqPrefsCtlr bind:NSContentDictionaryBinding toObject:self withKeyPath:@"prefsDict" options:nil]; No problem there.. But then I can't seem to figure out what to bind the assorted NSButtons and NSPopup menus to. My other idea was to subclass NSArrayController, and override selectedObjects. With this, I wanted to bind each control to the NSMutableDictionary in File's owner (somehow), and have each control observe a key in the dictionary. This seems to be a one way street, however. I can get the keys in the dictionary to initially set the buttons/popups, but nothing else. Is there any sort of example that shows how an NSDictionary can drive a pile of controls with bindings? Or should I just brute-force this, and write other code? bob. Robert Monaghan Glue Tools LLC 629 State St. Suite 220 Santa Barbara, CA, 93101 United States tel: +1 805 456 7997 fax: +1 805 456 7998 www.gluetools.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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSConnection/NSMachPort and CPU Loads.
Hi Everyone.. I have a Daemon communicating with an application using NSConnection/ NSMachPort. It appears that they loose communication somehow, under extremely heavy CPU loads on the System. Has anyone heard of this, or experienced it? I am trying to duplicate what my customer is seeing. So far without luck. I just wanted to ping this list, just in case I am barking up the wrong tree. Thanks! bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
EXC_BAD_ACCESS with 10.5.5 AppKit on some MacPros
Hi Everyone.. I have a really weird problem with my basic application. From time to time, on only a very few machines, (running 10.5.5), my application crashes when a user clicks on a button. It reports a EXC_BAD_ACCESS. Here is the crash report: Code Type: X86 (Native) Parent Process: launchd [71] Date/Time: 2008-11-12 15:47:47.776 +0100 OS Version: Mac OS X 10.5.5 (9F33) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 0 Thread 0 Crashed: 0 ...gluetools.GlueTools_KeyUtil 0x00031b9a oefst23_ + 4 1 com.apple.AppKit 0x9593fb03 -[NSApplication sendAction:to:from:] + 112 2 com.apple.AppKit 0x9593fa40 -[NSControl sendAction:to:] + 108 3 com.apple.AppKit 0x9593f8c6 -[NSCell _sendActionFrom:] + 169 4 com.apple.AppKit 0x9593ef1f -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1827 5 com.apple.AppKit 0x9593e772 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 541 6 com.apple.AppKit 0x9593e02c -[NSControl mouseDown:] + 888 7 com.apple.AppKit 0x9593c76b -[NSWindow sendEvent:] + 5381 8 com.apple.AppKit 0x95909311 -[NSApplication sendEvent:] + 2941 9 com.apple.AppKit0x95866d0f -[NSApplication run] + 847 10 com.apple.AppKit0x95833f14 NSApplicationMain + 574 11 ...gluetools.GlueTools_KeyUtil 0x2ab8 main + 30 12 ...gluetools.GlueTools_KeyUtil 0x2a7e _start + 216 13 ...gluetools.GlueTools_KeyUtil 0x29a5 start + 41 This crash isn't happening with any of my code. It seems to be crashing when referring to something in my Object. The weird part is, is that I am not releasing anything that the UI would be concerned with. The button in question is connected to an IBAction. Nothing fancy. Ideas?? bob. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NSConnection/NSMachPort and CPU Loads.
Here is what my user reports: - Under extremely heavy CPU Loads, my software app, and the daemon looses its connection. The user is rendering a lot of imagery on the same machine. I am assuming that the CPUs are being maxed out with a lot of threads tying up the machine. - Just about every user out there with moderate CPU usage appears to be fine. bob. On Nov 13, 2008, at 9:55 AM, Dave Cox wrote: I have a Daemon communicating with an application using NSConnection/ NSMachPort. It appears that they loose communication somehow, under extremely heavy CPU loads on the System. What happens that leads you to that conclusion? Over the past few days I have been documenting (on this list) problems I've been seeing with Distributed Objects, and there's more to come, but whenever my processes lose communication, there's an associated exception, error signal, or warning written to the console: http://lists.apple.com/archives/cocoa-dev/2008/Nov/msg00771.html or at the very least, an unexpected return value: http://lists.apple.com/archives/cocoa-dev/2008/Nov/msg00601.html 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: http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com This email sent to [EMAIL PROTECTED] ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Any reason to avoid GCC-4.2 for Leopard and later targeted code?
How about with Tiger users? Do the applications work there, too? Bob Sent from my iPhone On Dec 3, 2008, at 6:47 AM, Luca Ciciriello <[EMAIL PROTECTED]> wrote: No Idea, but I use currently GCC-4.2 for my Apps. I've to say that my applications are C++ and Objective-C++ apps. I haven't found any problem using GCC-4.2 on Leopard. Luca. www.mitosrl.com > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Date: Wed, 3 Dec 2008 09:31:35 -0500 > Subject: Any reason to avoid GCC-4.2 for Leopard and later targeted code? > > I've run into an apparent codegen bug (related to Obj-C properties) > that appears to be fixed in GCC-4.2. > > GCC-4 is still the "system compiler" on Leopard. For code targetting > Leopard and later (linked against the 10.5 SDK) are there any gotchas > or other issues I should be aware of before I switch over to using 4.2 > to build? > > Jim > ___ > Do not post admin requests to the list. They will be ignored. > Xcode-users mailing list ([EMAIL PROTECTED]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/xcode-users/luca_ciciriello%40hotmail.com > > This email sent to [EMAIL PROTECTED] Take your friends with you with Mobile Messenger. Click Here! ___ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list ([EMAIL PROTECTED]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/bob%40gluetools.com This email sent to [EMAIL PROTECTED] ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]