Re: Problem Binding to UserDefaults
Found the problem! I hadn't checked the 'Handles Content as Compound Value' checkbox in the Array Controller Bindings. Switching this on and all now works. On 05/12/2010, at 12:01 PM, Peter Zegelin wrote: That doesn't appear to be the problem as adding and deleting items are saved. It's only when I change a value that the result isn't saved back to the defaults. I have created a really simple project here: http://fracturedsoftware.com/downloads/developer/UserDefaultsBindingTest.zip If someone could take a quick look I'd be really grateful. On 03/12/2010, at 2:19 AM, Jerry Krinock wrote: On 2010 Dec 01, at 21:10, Peter Zegelin wrote: However, if I change the displayType of the selected row via the control, then the results are *not* saved. The new value is correct while the app is running but never saved. Make sure that, when testing this, you are quitting your app normally and not killing it, for example, by hitting the red stop button in Xcode.___ Peter___ 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
NSView/NSTableView question
Hello, In my project I have a table view on the main window which accepts drops and the dropped files will show up as a list. All works normally at this point. However as an afterthought I was thinking to put an NSView on top with a graphic stating Drop files here or something to that effect so when the table view is empty the user doesn't have to stare at an empty table view. However I have run into a few issues and I was hoping someone could point me in the right direction or maybe let me know if I'm going about this wrong. Here are the issues I'm having: 1. Once a file is dropped onto my main window I'm trying to hide the NSView so the NSTableView will show through. It works but I'm having a difficult time to unhide the NSView when the table view goes back to empty 2. My table view is the data source since this part was already done. The table view is also the one receiving drops even when my custom view is visible. Is this wrong and do I have to make my custom view a data source too? 3. Since I have custom colors in my table view and now I'm setting the color in my custom view it creates some artifacts when dragging a file on my main window. I'm guessing there must be a conflict somewhere... Well again any pointers would be great. Much appreciated! rc___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSView/NSTableView question
Another approach that might be simpler: Set up a tabbed view with 2 views - one to receive drops with all your instructions, and the other to display the table. Switch to the drop view when the table row count is 0, and switch back to the table tab when valid drops are registered. On Dec 5, 2010, at 9:12 AM, Rick C. wrote: Hello, In my project I have a table view on the main window which accepts drops and the dropped files will show up as a list. All works normally at this point. However as an afterthought I was thinking to put an NSView on top with a graphic stating Drop files here or something to that effect so when the table view is empty the user doesn't have to stare at an empty table view. However I have run into a few issues and I was hoping someone could point me in the right direction or maybe let me know if I'm going about this wrong. Here are the issues I'm having: 1. Once a file is dropped onto my main window I'm trying to hide the NSView so the NSTableView will show through. It works but I'm having a difficult time to unhide the NSView when the table view goes back to empty 2. My table view is the data source since this part was already done. The table view is also the one receiving drops even when my custom view is visible. Is this wrong and do I have to make my custom view a data source too? 3. Since I have custom colors in my table view and now I'm setting the color in my custom view it creates some artifacts when dragging a file on my main window. I'm guessing there must be a conflict somewhere... Well again any pointers would be great. Much appreciated! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
label color
How to get label color before 10.6? -- best regards Ariel ___ 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: label color
Ariel Feinerman wrote: How to get label color before 10.6? If you mean using Interface Builder, select a label, choose Attributes on the Inspector panel. Also notice the class of the label: NSTextField. Then look in NSTextField.h: - (void)setBackgroundColor:(NSColor *)color; - (NSColor *)backgroundColor; - (void)setTextColor:(NSColor *)color; - (NSColor *)textColor; -- GG ___ 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: label color
He could also be referring to the label color of a file in Finder... Dave Sent from my iPhone On Dec 5, 2010, at 8:50 AM, Greg Guerin glgue...@amug.org wrote: Ariel Feinerman wrote: How to get label color before 10.6? If you mean using Interface Builder, select a label, choose Attributes on the Inspector panel. Also notice the class of the label: NSTextField. Then look in NSTextField.h: - (void)setBackgroundColor:(NSColor *)color; - (NSColor *)backgroundColor; - (void)setTextColor:(NSColor *)color; - (NSColor *)textColor; -- GG ___ 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/davedelong%40me.com This email sent to davedel...@me.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: navigation bar tint color issue on iOS 4.2
On Fri, 3 Dec 2010 15:16:58 -0500, Phillip Mills phillip.mil...@acm.org said: On 2010-12-03, at 3:10 PM, Matt Neuburg wrote: But obviously this is something the framework would rather you didn't do. :) ...and if the framework and IB had agreed that it was a bad idea, I probably wouldn't have bothered trying...for those hours. :-) You can work around this by not using a UINavigationController; if the split view's first view is controller by a normal UIViewController but happens to contain a UINavigationBar, the split view and the popover controller won't mess with it. However, you then lose the convenience of the UINavigationController. m. -- matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.apeth.net/matt/default.html#applescriptthings___ 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
NSFetchedResultsController: different sort descriptors for different sections
I have a situation where there are two sections in a table view. The first section should have its rows sorted according to a certain index stored in the managed object, while the second section should have its rows sorted alphabetically by the name of its managed objects. How can I create a *single* fetched results controller that sorts different sections differently? From reading the docs for NSFetchedResultsController, in a situation with several sections, the first sort descriptor is responsible for splitting the data into sections. Fine, by I can't seem to think of a way to conditionally set the remaining sort descriptors according to which section the rows fall into. Here's part of the code I have now: NSEntityDescription* entity = [NSEntityDescription entityForName: @entity name inManagedObjectContext: self.managedObjectContext]; NSSortDescriptor* sortBySectionName = [[NSSortDescriptor alloc] initWithKey: @sectionName ascending: YES]; NSSortDescriptor* sortByIndex = [[NSSortDescriptor alloc] initWithKey: @index ascending: YES]; NSArray* sortDescriptors = [[NSArray alloc] initWithObjects: sortBySectionName, sortByIndex, nil]; NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity: entity]; [fetchRequest setSortDescriptors: sortDescriptors]; It works, but it sorts both sections by the managed object's index. The only alternative I can think of is to create *two* fetched results controllers, one as above and the other sorting by section name and then object name (rather than index). Then, when it comes time to feed the table view, have some logic that selects data from the appropriate controller. That sounds too cumbersome. What if I had several more sections, each needing different sorting criteria? There's got to be an easier way. Thanks in advance. WT___ 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: label color
2010/12/5 Dave DeLong davedel...@me.com He could also be referring to the label color of a file in Finder... Yes, I mean file attribute Dave Sent from my iPhone On Dec 5, 2010, at 8:50 AM, Greg Guerin glgue...@amug.org wrote: Ariel Feinerman wrote: How to get label color before 10.6? If you mean using Interface Builder, select a label, choose Attributes on the Inspector panel. Also notice the class of the label: NSTextField. Then look in NSTextField.h: - (void)setBackgroundColor:(NSColor *)color; - (NSColor *)backgroundColor; - (void)setTextColor:(NSColor *)color; - (NSColor *)textColor; -- GG ___ 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/davedelong%40me.com This email sent to davedel...@me.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/arielfapple%40gmail.com This email sent to arielfap...@gmail.com -- best regards Ariel ___ 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: label color
On Sun, Dec 5, 2010 at 12:26 PM, Ariel Feinerman arielfap...@gmail.com wrote: Yes, I mean file attribute Use FSGetCatalogInfo to get the FinderInfo struct of the file, and use the three bits at index kColor in the finderFlags field. See CarbonCore/Files.h and CarbonCore/Finder.h for more info. --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
NSView/NSTableView question
If the size of the table permits, when the table is empty, have the datasource return for one cell the string Drop Files Here When the user has dropped a file, you can adjust what the datasource returns to not show the string. Further games with setting the row height and using an attributed string for Drop Files Here will allow you to easily use a suitable font and color with very little effort. Peter ___ 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: label color
How is Carbon connected to Cocoa? Should I use Carbon APIs in my Cocoa code? Will Carbon Core go away? Is this an OK question fro a Cocoa list? -koko On Dec 5, 2010, at 1:43 PM, Kyle Sluder wrote: On Sun, Dec 5, 2010 at 12:26 PM, Ariel Feinerman arielfap...@gmail.com wrote: Yes, I mean file attribute Use FSGetCatalogInfo to get the FinderInfo struct of the file, and use the three bits at index kColor in the finderFlags field. See CarbonCore/Files.h and CarbonCore/Finder.h for more info. --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/koko%40highrolls.net This email sent to k...@highrolls.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: Obscuring an NSString
Thanks to all who responded. Let me explain my situation a little better. I am storing several string values into an XML file. I want to obscure one of them. When I encrpyt the NSString to an NSdata I can store the data as a string in XML, however when I read the string back in I dont know how to convert it back to NSData to decrypt. Adam On Thu, Dec 2, 2010 at 1:57 PM, Richard Somers rsomers.li...@infowest.com wrote: Try the open source SSCrypto.framework. It is a Cocoa wrapper around OpenSSL encryption and decryption. It works well. http://septicus.com/products/opensource/ --Richard Somers On Dec 2, 2010, at 6:30 AM, Adam Gerson wrote: I am writing an NSString to a file and I would like to obscure it in a two way reversible fashion. ___ 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: NSView/NSTableView question
Great thanks for the replies. I was also thinking about this but I might try to add a little bit of graphics too using NSBezierPath would it still work? But at least these 2 ideas can keep me going until I get this working right. Thanks! On Dec 6, 2010, at 4:58 AM, Peter Hudson wrote: If the size of the table permits, when the table is empty, have the datasource return for one cell the string Drop Files Here When the user has dropped a file, you can adjust what the datasource returns to not show the string. Further games with setting the row height and using an attributed string for Drop Files Here will allow you to easily use a suitable font and color with very little effort. Peter ___ 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/rickcorteza%40gmail.com This email sent to rickcort...@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: label color
On Dec 5, 2010, at 3:29 PM, k...@highrolls.net wrote: How is Carbon connected to Cocoa? Carbon is a fundamental part of Mac OS X. Some Cocoa classes still use Carbon at a low level, such as NSMenu. Should I use Carbon APIs in my Cocoa code? Why not? Will Carbon Core go away? No. The only parts of Carbon that have gone away are the obsolete APIs (FSSpec, Internet Config, QuickDraw, etc.) as well as HIView. The rest of Carbon isn't going anywhere. There are still a number of OS features that can only be accessed by using Carbon. Nick Zitzmann http://www.chronosnet.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: label color
On Sun, Dec 5, 2010 at 4:47 PM, Nick Zitzmann n...@chronosnet.com wrote: No. The only parts of Carbon that have gone away are the obsolete APIs (FSSpec, Internet Config, QuickDraw, etc.) as well as HIView. The rest of Carbon isn't going anywhere. There are still a number of OS features that can only be accessed by using Carbon. To generalize this a bit, I think it's fair to say that the parts of Carbon ported to 64bit will be around for a long time still. ___ 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: Obscuring an NSString
On Dec 5, 2010, at 4:31 PM, Adam Gerson wrote: Thanks to all who responded. Let me explain my situation a little better. I am storing several string values into an XML file. I want to obscure one of them. When I encrpyt the NSString to an NSdata I can store the data as a string in XML, however when I read the string back in I dont know how to convert it back to NSData to decrypt. input string (NSString) -- UTF-8 representation (NSData) -- optional encryption such as XOR -- hex string (NSString) this is fully reversible of course. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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: Cocoa/Objective-C flat name space problems
On May 6, 2010, at 7:27 PM, Stephen Blinkhorn wrote: Thanks Isaac, On 6 May 2010, at 16:35, Isaac Wankerl wrote: With #2, you might want to investigate using ibtool and the --convert option to modify the nibs. Just from reading the man page, it looks like that might work if you come up with some build scripts to run it for each project. I've never used ibtool before but this looks very promising although right now I can't seem to get ibtool to actually commit any changes to the xib file. Probably missing something simple. A simple search and replace in TextWrangler confirms this approach should work well though/ It sounds like you might not have included '--write output.xib' in your ibtool invocation. Jon Hess Thanks, Stephen Isaac http://www.kerlmax.com/ On Thu, May 6, 2010 at 5:22 PM, Stephen Blinkhorn stephen.blinkh...@audiospillage.com wrote: Hi all, I write audio unit plugins and Cocoa's flat name space is causing some real problems. Essentially I have a static library of Cocoa user interface classes that I use in multiple plug-in projects. These plug-ins are often run side by side by the user so I can't guarantee that a previous version of a class (in an older plugin) hasn't already been loaded by the run time system. I know of the following two solutions to this problem but neither are ideal: 1. Create a framework. This is quite a heavy weight solution and requires that all classes are backwards compatible. 2. Use the preprocessor the #define unique class names when the project is compiled. This is great but falls down because the original class names are still present in the nib/xib files. Anyone have any other suggestions or tips for dealing with this situation? With the move towards Cocoa well under way this is starting to affect a lot of people. Thanks, Stephen ___ 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/jhess%40apple.com This email sent to jh...@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/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Obscuring an NSString
On Dec 5, 2010, at 2:31 PM, Adam Gerson agers...@gmail.com wrote: Thanks to all who responded. Let me explain my situation a little better. I am storing several string values into an XML file. I want to obscure one of them. When I encrpyt the NSString to an NSdata I can store the data as a string in XML, however when I read the string back in I dont know how to convert it back to NSData to decrypt. You'd better not be treating your XML data as an NSString. ;-) As long as you store your data in a CDATA section, the XML API you're using should give you the ability to get the raw data for a node. Alternatively, one of the convenient properties of Base64 is that it maps your data into a range of printable ASCII characters. So you can treat the Base64 data as ASCII and write it as a string in your XML document (being mindful, of course, of the document's encoding, which is most likely UTF-8 and therefore identical to ASCII for the Base64 output range). Then read it back in as a string, convert it to ASCII, and feed the raw ASCII data into the Base64 decoding algorithm. So to maximize flexibility without involving CDATAs, here's the process I'd use: Saving: Plaintext NSString -- Plaintext NSData (UTF-8; use -dataWithEncoding:) -- Base64 NSData (ASCII) -- Base64 NSString (use +stringWithData:encoding: to create this) -- your XML document Loading: Your XML document -- Base64 NSString (UTF-16) -- Base64 NSData (ASCII characters; use -dataWithEncoding to get this) -- Plaintext NSData (UTF-16) -- NSString (again use +stringWithData:encoding:) HTH, --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