Re: Can CoreData return only unique results of an attribute

2008-02-27 Thread Jim Correia
On Feb 26, 2008, at 7:34 PM, Adam Gerson wrote: Thanks for the example. What I am looking for is slightly diferent. Lets say I have a entity called FavoriteWebsites with the attributes name and url. The current contents of the object are Name | URL

Re: NSArchiver and MySQL

2008-03-03 Thread Jim Correia
On Mar 3, 2008, at 1:21 PM, Mike Abdullah wrote: Relying on -description would almost certainly be a bad idea as it might change in the future. Also, it will take up a lot of room. I'd recommend: http://www.dribin.org/dave/blog/archives/2006/03/12/base64_cocoa/ Why convert to a string

Re: core data - beyond the simple example

2008-04-04 Thread Jim Correia
On Apr 4, 2008, at 5:44 PM, Torsten Curdt wrote: - (void)setFilter:(NSPredicate*)newFilter { if (filter != newFilter) { [filter release]; filter = newFilter; } } - (NSPredicate*)filter { return filter; } Is this the exact code you are

Re: Objective-C Instance Variable Names

2008-04-06 Thread Jim Correia
On Apr 6, 2008, at 8:18 PM, Michael Ash wrote: Of course direct ivar access works with funny naming conventions. The keys obviously have to share the funny naming convention, but this is just mildly ugly, not any sort of showstopper. For proof, watch Interface Builder not grind to a halt when

Re: KVO strangeness under 10.5

2008-04-12 Thread Jim Correia
On Apr 12, 2008, at 8:14 PM, Sean Todd wrote: Unfortunately, that doesn't work: NSKeyValueObservance 0x65009d0: Observer: 0x6500210, Key path: grade, Options: New: NO, Old: NO, Prior: NO Context: 0x1957c0, Property: 0x18edf0 ) (gdb) po 0x6500210 Program received signal EXC_BAD_ACCESS,

Re: My private problems

2008-04-20 Thread Jim Correia
On Apr 20, 2008, at 6:18 AM, Gerriet M. Denkmann wrote: So - just for fun - how can I convert the symbolic link /tmp into an absolute pathname? stringByResolvingSymlinksInPath leaves it unchanged. That the /private prefix is removed is documented behavior.

Re: ScreenSaver.framework only 32-bit?

2008-05-05 Thread Jim Correia
On May 5, 2008, at 11:09 AM, Steven Noonan wrote: I realize 64-bit is merely a buzzword at this point, but it seems strange to me that the ScreenSaver framework is 32-bit only. I kind of guessed that if Apple was releasing Cocoa with 64-bit binaries, it would only make sense that -all-

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Jim Correia
On May 10, 2008, at 1:43 AM, Chris Hanson wrote: In general terms though, I'll still state that it's a bad idea to enforce that an object be a singleton — especially if you're new to the framework and memory management rules etc. Rather, I'd treat being a singleton as a code smell, and try

Re: Multi-storage Core Data

2008-05-17 Thread Jim Correia
On May 17, 2008, at 3:00 PM, Keary Suska wrote: on 5/17/08 10:27 AM, [EMAIL PROTECTED] purportedly said: I'm trying to build a Core Data app for which some data is user- provided and some data is shipped with the program. Consider a travel itinerary program for instance where the user has a

Re: OK on Enter, not Return

2008-06-06 Thread Jim Correia
On Jun 6, 2008, at 2:19 PM, Andrew Merenbach wrote: I believe that you might do some magic with -keyDown: Douglas (and Aki) periodically answer this question. In most situations, overriding keyDown: is the wrong solution to your problem. When you want to customizes key events in

Re: NSPanel should not close on command-W

2008-06-23 Thread Jim Correia
On Jun 23, 2008, at 3:35 AM, Georg Seifert wrote: The way I would like it is that is does not respond to command-w at all. I think, I will try to implement my my own close button and disable close in IB. Or has anyone a better idea? A previous response in this thread told you how to do

Re: CoreData pagination

2008-06-23 Thread Jim Correia
On Jun 23, 2008, at 8:11 PM, Ian wrote: I know this has been asked before... I've been searching and searching and RTFMing so I've seen the paper-trail of askees over the years... Anyway, is there any way to query CoreData in chunks? I have a very large CoreData SQl store (1 million) of

Re: NSSpeechSynthesizer and empty strings

2008-06-28 Thread Jim Correia
On Jun 26, 2008, at 8:32 PM, Nick Zitzmann wrote: On Jun 26, 2008, at 6:16 PM, William Squires wrote: Actually, if ([myString length] == 0) is probably better, but just IMHO... :) No; don't ever do that. It is possible for an NSString to have zero length but not be empty. See

Re: Handling framework exceptions/errors?

2008-06-29 Thread Jim Correia
On Jun 29, 2008, at 4:17 PM, Sherm Pendley wrote: On Sun, Jun 29, 2008 at 4:00 PM, Jens Alfke [EMAIL PROTECTED] wrote: Also, what do you mean by a URL containing Kanji characters? I suppose he means one like this: http://例え.テスト - which works correctly in Safari, btw. Safari is

Re: Cocoa Spaces

2008-07-19 Thread Jim Correia
On Jul 19, 2008, at 12:27 PM, Aaron Wallis wrote: Just wondering if anybody's come across any documentation (or examples) on how to get cocoa applications to play nice with Spaces? My app is primarily run through a HUD window which is activated from the menu bar. ATM, when I activate the

Re: Core Data, dynamic accessors and compiler warnings

2008-08-10 Thread Jim Correia
On Aug 10, 2008, at 10:02 AM, Chris Idou wrote: The Core data doco suggests that if you have a 1:M accessor for FooBar that you define in a header: - (void)addFooBarObject:(FooBar *)value; In order to suppress compiler warnings for using this dynamically generated method. However this

Re: What's the use of the Z_UUID in the Z_METADATA table?

2008-08-13 Thread Jim Correia
On Aug 13, 2008, at 9:56 AM, Gustavo Vera wrote: Maybe I should not, but I'm doing it anyway :D I'm looking inside and also I'm manipulating the structure and data of the sqlite file since about 200 revisions in my project. I'm doing this to provide newer versions of the app that has the

Re: !foo vs foo == nil

2008-08-21 Thread Jim Correia
On Aug 21, 2008, at 3:54 AM, Jules Colding wrote: For that simple reason, I'd go for nil == foo every time. Yes, and in general you should always do if (CONSTANT == foo) to catch the potential if (CONSTANT = foo) error. If your name is Yoda, then perhaps if (3 != x) reads naturally to

Re: !foo vs foo == nil

2008-08-21 Thread Jim Correia
On Aug 20, 2008, at 9:31 PM, Marcel Weiher wrote: I was swayed by the nil == foo arguments for a while, but my gut kept tugging at me and now I have switched back to just if ( !foo), or better (I prefer positive ifs), if (foo). Of course, if all the if (foo) is protecting is a

Re: Implementing isEqual: and hash

2008-08-23 Thread Jim Correia
On Aug 23, 2008, at 7:41 AM, Graham Cox wrote: I have a class for which equality can be defined as having the same internal string value (which happens to be a UUID-turned-string). I can easily implement isEqual: based on that but the docs say I also need to implement -hash. Any pointers

Re: What to use observeValueForKeyPath: context

2008-08-29 Thread Jim Correia
On Aug 29, 2008, at 10:56 AM, Dave Dribin wrote: It seems that KVO best practice is to use the context in observeValueForKeyPath:ofObject:change:context: to differentiate between different key paths, rather than check key path strings for equality. Since context is a void *, it also seems

Re: NSTask is Weird

2008-09-10 Thread Jim Correia
On Sep 11, 2008, at 12:12 AM, Andrew Farmer wrote: Arguments needs to be an array containing one element per argument to the task That is correct. including argv[0] as the name of the executable. That advice is incorrect for NSTask. Consider the output of the following code, which

Re: NSMutableString question

2008-09-16 Thread Jim Correia
On Sep 16, 2008, at 8:59 PM, Dave DeLong wrote: The general rule with convenience class methods like that is that they return an autoreleased object. The rules are encapsulated in the object ownership policy:

Re: Differences between -isEqual: and -isEqualTo:?

2008-09-18 Thread Jim Correia
On Sep 18, 2008, at 6:23 PM, Rick Mann wrote: I thought isEqualTo was a method on NSObject, but I realize now it's part of the NSComparisonMethods Protocol. The whole thing strikes me as a bit messy. Also note which header that category lives in - NSScriptWhoseTests.h. That provides

Re: Differences between -isEqual: and -isEqualTo:?

2008-09-18 Thread Jim Correia
On Sep 18, 2008, at 7:32 PM, Shawn Erickson wrote: On Thu, Sep 18, 2008 at 4:19 PM, Keith Duncan [EMAIL PROTECTED] wrote: if two objects compare equal, then they must have the same hash [...] [you] have to implement a corresponding -hash that maintains this invariant rule. Is there an

Re: Differences between -isEqual: and -isEqualTo:?

2008-09-18 Thread Jim Correia
On Sep 18, 2008, at 8:36 PM, Shawn Erickson wrote: On Sep 18, 2008, at 4:39 PM, Jim Correia wrote: Additional care must be taken if you are implementing a mutable object and intend to store it in a collection: the object's -hash cannot change while it is in the collection (so effectively

Re: Differences between -isEqual: and -isEqualTo:?

2008-09-18 Thread Jim Correia
On Sep 18, 2008, at 8:54 PM, Jim Correia wrote: Since mutable framework provided objects can (and do) change hash values as they are mutated, I agree with your tenuous classification of the situation. In the general case, storing mutable objects in hash-table like collections outside

Re: Weird Error

2008-09-19 Thread Jim Correia
On Sep 19, 2008, at 11:18 AM, development2 wrote: Ok I hope someone can help me. I need to get this working. Here is what I am doing. I have a class called Object, it is set up like this: Object is the root object defined by the Objective-C language. (NSObject is typically the root

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-04 Thread Jim Correia
On Oct 4, 2008, at 10:45 PM, Nathan Vander Wilt wrote: HFS types seem to be well deprecated in nearly every other area, the drag destination guides don't encourage checking the types anyway Can you post a reference? You generally should check the type in the drag, and not offer to accept

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 12:44 AM, Nathan Vander Wilt wrote: I'm not sure what you mean here. The documentation for promise drags says to encode the OSType using NSFileTypeForHFSTypeCode() which in my testing just turns the characters the programmer sees in their source into a string (ie 'uint'

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 4:43 PM, Brian Stern wrote: This is the question I really wanted to ask: I have an object X that is alloc/inited on the main thread. This object creates some NSThreads with detachNewThreadSelector:toTarget:withObject, which have object X as their target. At a later

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 5:41 PM, Brian Stern wrote: My main reason was just cleanliness. Looking more closely at the code however, most of which I didn't write, there are some runloop sources that are removed and calls to NSObject cancelPreviousPerformRequestsWithTarge:selector:object. Most of

Re: NSTextView/NSAttributedString supported file types

2008-10-08 Thread Jim Correia
On Oct 8, 2008, at 5:46 PM, Ben Lachman wrote: I have an open panel that I'd like to handle text a little more fluidly. At the moment I call runModalForTypes with an array composed of my best guesses at what NSMutableAttributedString can figure out in its readFromData:... method. However

Re: NSTextView/NSAttributedString supported file types

2008-10-08 Thread Jim Correia
On Oct 8, 2008, at 10:33 PM, Ben Lachman wrote: Thanks Jim. Not sure how I missed that, its exactly what I was looking for. Unfortunately it's deprecated in 10.5. Know what the advised API to transition to is? For 10.5 and later, there are UTI based variants. Jim

Animating view transitions with Core Animation (problems with BasicCocoaAnimations sample)

2008-10-13 Thread Jim Correia
I have some old NSAnimation based code that I'd like to update to use Core Animation. Since BasicCocoaAnimations [1] does essentially what I want to do (at least for starters) I am using that as a starting point. [1] http://developer.apple.com/samplecode/BasicCocoaAnimations/index.html

Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-15 Thread Jim Correia
On Oct 15, 2008, at 8:46 PM, Chris Idou wrote: I can't do that because my object inherits from NSObject, and NSObject doesn't contain an implementation of observeValueForKeyPath. So that gives a runtime error. NSObject does have an implementation of -

Re: Objective 2.0 properties

2008-10-17 Thread Jim Correia
On Oct 17, 2008, at 1:25 PM, Ignacio Enriquez wrote: Second: Let me see If I understood. they should be copy since all the classes all conform to NSCopying. this means that all (and I mean ALL ) properties should be copy?? (since all objects inherits from NSObject and this class conform to

Re: Objective 2.0 properties

2008-10-17 Thread Jim Correia
On Oct 17, 2008, at 1:59 PM, Ignacio Enriquez wrote: I think I am beginning to understand this. What gives you the impression that NSObject (and thus all of its subclasses) conform to NSCopying? I think I was wrong... I will read the documentation about this. A property should be copy

Re: Objective 2.0 properties

2008-10-18 Thread Jim Correia
On Oct 17, 2008, at 2:29 PM, Jim Correia wrote: For object types, in a non-garbage collected application (traditional retain/release style memory management) you never want to use assign. It is the equivalent of hand writing an accessor that does a pointer assignment (with no additional

Using Core Animation to animate view properties?

2008-10-20 Thread Jim Correia
I have some view properties for which I'd like to use Core Animation to drive the animation. In my old code, I used a subclass of NSAnimation which interpolated the target value and set the property on the view via KVO. This seems like a perfect use for CABasicAnimation and the animator

Re: Using Core Animation to animate view properties?

2008-10-22 Thread Jim Correia
On Oct 22, 2008, at 12:54 PM, Matt Long wrote: 1. If you want to know whether an animation is still running, just check to see if it is still in the animations dictionary in the layer. A call like this would do it: [...] How you apply this to view properties, I'm not sure, but this is how

Re: Core Data Questions--Relationships, UUIDs, and Dirty States

2008-10-27 Thread Jim Correia
On Oct 27, 2008, at 4:31 PM, Keary Suska wrote: 1. Confirmation clarification: do I understand correctly, considering typical RDBMS data integrity rules, that for most to-one relationships, I would set the delete rule to no action, since deletion of the many item should not effect the one

Re: Lack of Initializers or Factory Methods

2008-11-03 Thread Jim Correia
On Nov 3, 2008, at 10:53 AM, Gordon Apple wrote: The following example is one of several I have run into recently. Inheritance is as follows: CAKeyframeAnimation: CAPropertyAnimation : CAAnimation. CAKeyframeAnimation has no explicit initializer or factory method. Dudney's book

Re: Lack of Initializers or Factory Methods

2008-11-03 Thread Jim Correia
On Nov 3, 2008, at 11:30 AM, Gordon Apple wrote: Is self even defined for a class object? `self` is the class object when you are in a class method. If so, should case 1 (or similar) be the assumed implementation for all of Cocoa? If not, then, IMHO, the docs in general should specify

Re: Official keycode table?

2009-02-16 Thread Jim Correia
On Feb 16, 2009, at 3:04 PM, Shayne Wissler wrote: Is there an official table somewhere, preferably in an OSX header file? HIToolbox/Events.h in the 10.5 SDK. - Jim ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

NSTask -launch/+launchedTaskWithPath:... - externally retained for life of task?

2009-03-03 Thread Jim Correia
Suppose you have the following code, running in either retain/release land or GC land (ends up the behavior is similar because of the autorelease pool or collector after return): NSTask *task = [[NSTask alloc] init]; [task setLaunchPath: @/bin/sleep]; [task

Re: Double Initialize - is that how it should be?

2009-03-17 Thread Jim Correia
On Mar 16, 2009, at 10:21 PM, Steve Cronin wrote: I use an object in my application called 'appDelegate'; it's a subclass of NSObject. I instantiate this object in the main Nib file This object has IBActions for the main menu and since it is -app delegate it is a kind on central

Bindings: which object+property is being edited?

2009-03-17 Thread Jim Correia
Given an NSObjectController subclass, or an NSManagedObjectContext (with chained controllers), is it possible to determine the set of objects + properties currently being edited? The NSEditorRegistration protocol is untyped: - (void)objectDidBeginEditing:(id)editor; -

Re: How to make letters appear in italics?

2009-03-17 Thread Jim Correia
On Mar 17, 2009, at 10:14 AM, Li Fumin wrote: Hi,all.I am new to cocoa. I am reading Aaron Hillegass's Book Cocoa Programming for Mac OS X. I have got some problems with challenge 2 of Chapter 20.I have a custom NSView called BigLetterView, and then it show the input letter on the

Re: NSAppleScript - what is going on here?

2009-03-22 Thread Jim Correia
On Mar 22, 2009, at 1:53 PM, Steve Cronin wrote: I'm an ObjC guy -- I generally avoid the C stuff if possible - 'cause I have to support my own code. Objective-C is a superset of C. Avoiding the C stuff isn't really possible - it is a core part of the language. As far as choice of API, I

Re: Force bindings to sync

2009-03-25 Thread Jim Correia
On Mar 25, 2009, at 5:07 PM, Sidney San Martín wrote: While my object is updated just fine when a field loses focus, nothing happens when the window is closed or a button is clicked: the last-edited field is always out of sync. How can I force the focused element to commit its changes?

Re: GetProcessBundleLocation() -- no good in background agents!

2009-03-25 Thread Jim Correia
On Mar 25, 2009, at 7:20 PM, Jerry Krinock wrote: /* Use this code to build a Cocoa Command-Line tool and place the product in Contents/MacOS of any application. Then doubleclick it. Watch the log in the Terminal window and un-hide and watch your dock. There are a couple of edge cases you

Re: NSArchiver atomic?

2009-03-29 Thread Jim Correia
On Mar 29, 2009, at 5:39 AM, Michael Vannorsdel wrote: Does anyone know if NSArchiver's archive to file methods do atomic file writes? Yes - anyone who has read the API documentation for those methods knows whether or not they write the files atomically. Jim

Re: Strange cast for CFURLRef

2009-03-31 Thread Jim Correia
On Mar 31, 2009, at 1:32 PM, Patrick Burleson wrote: I ran into something I don't quite understand and was hoping to get some enlightenment. There's a method defined on AudioPlayer that goes like this: - (id) initWithURL: (CFURLRef) fileURL; [...] The question I have is on the line:

Re: KVC and @ as key

2009-04-14 Thread Jim Correia
On Apr 15, 2009, at 12:19 AM, Micha Fuhrmann wrote: I'm bumping against KVC, indirectly. I've got a dictionary with first character keys, each object of the key is an Array with objects. So key b of my Dictionary is an array with file objects' name starting with the letter b. The problem

Re: Core Data Fetches + Transient Properties + NSPredicateEditor = Sadness

2009-04-20 Thread Jim Correia
On Apr 20, 2009, at 2:02 PM, Jerry Krinock wrote: A much better way appears to be to fetch all objects from the store with no predicate and then use -[NSArray filteredArrayWithPredicate:]. This takes only one more line of code, solves all problems, and is supposedly cheaper too: If you

Re: Problem implementing keyPathsForvaluesAffectingKey

2009-04-23 Thread Jim Correia
On Apr 22, 2009, at 10:45 AM, jonat...@mugginsoft.com wrote: The property canDelete is dependent on three other properties as shown below. Is there a problem with my implementation of + keyPathsForValuesAffectingCanDelete with regard to the key path @arrayController.canRemove? Is is a

Re: ESC while editing NSOutlineView subclass

2009-04-23 Thread Jim Correia
On Thu, Apr 23, 2009 at 5:16 PM, Kevin Gessner ke...@kevingessner.comwrote: I've got this in MyEditorOutlineView, my NSOutlineView subclass. - (void)keyDown:(NSEvent *)theEvent { [super keyDown:theEvent]; NSLog(@keyDown: %d, [theEvent keyCode]); #define returnKeyCode 36

Core Data: thread safety of NSPersistentStore +metadataForPersistentStoreWithURL:... (and +set...)?

2009-04-24 Thread Jim Correia
I don't see that the documentation specifically calls out @interface NSPersistentStore + (NSDictionary *)metadataForPersistentStoreWithURL:(NSURL *)url error: (NSError **)error; + (BOOL)setMetadata:(NSDictionary *)metadata forPersistentStoreWithURL: (NSURL*)url error:(NSError **)error; @end

Re: Trying to get flagsChanged: to work

2009-04-25 Thread Jim Correia
On Sat, Apr 25, 2009 at 1:19 PM, Dave DeLong davedel...@me.com wrote: It seems that the responder chain is not set up during awakeFromNib (even though all the outlets are), because I moved the loop to my addGroup: IBAction, where it printed off my chain.  My GroupListController was not in the

Re: NSPopUpButtonCell Keeps on Trackin'! Demo, Movie

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 10:41 AM, Jerry Krinock je...@ieee.org wrote: // Table View delegate method. // A little more complicated since we have to dig into the // parts of the table, and assign it as a header cell. - (void)               tableView:(NSTableView*)tableView  

Re: figuring out which TableView I am?

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 7:05 PM, WT jrca...@gmail.com wrote: More importantly, perhaps, is the fact that adding property/ivars is not a scalable solution in that it requires adding more code in several places if more tables are added. The tags solution only requires some fiddling with IB and

Re: figuring out which TableView I am?

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 8:04 PM, Graham Cox graham@bigpond.com wrote: This is true, but your example of non-scalability does reflect a poor approach that you wouldn't be likely to follow in practice. A tag is 32 bits, so can represent 2^32 different states, if used wisely. Dividing this

Re: Key Value Coding is not case-sensitive?

2009-04-27 Thread Jim Correia
On Tue, Apr 28, 2009 at 12:09 AM, DairyKnight dairykni...@gmail.com wrote:   And have the following set methods:   -(void) setfido ...   -(void) setFido ...   Both by calling [self setValue: ... forKey:@fido] or [self setValue:... forKey:@Fido], the runtime would call the same 'setFido'

Re: Why is NSString-FSRef so hard?

2009-04-29 Thread Jim Correia
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka cocoa...@charlessoft.com wrote: With that said, I don't really see what is harmful about recommending the use of NSString's path concatenation methods, which could save quite a few headaches in the case that this *does* somehow change for some

Re: -[CALayer hitTest:] incorrect when embedding layer-backed NSView subclass inside NSScrollView

2009-05-04 Thread Jim Correia
On Mon, May 4, 2009 at 6:19 PM, Steven Degutis steven.degu...@gmail.com wrote: Specifically, you'll notice that the -hitTest: returns the correct layer *only* if you click the view while it is fully visible in the window, and before you have made it not-fully-visible for the first time. After

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-06 Thread Jim Correia
On Wed, May 6, 2009 at 1:05 PM, Jerry Krinock je...@ieee.org wrote: In any case using multiple MOCs for different jobs is a good idea. Accessing the same store?  I always thought that was a bad idea, but I'll give it some thought. Using multiple MOCs with a single persistent store

Re: Getting a StringPtr from Gestalt on 64-bit

2009-09-02 Thread Jim Correia
On Sep 2, 2009, at 9:02 PM, Scott Lahteine wrote: My preference pane uses Gestalt(gestaltUserVisibleMachineName, mySInt32), coercing the SInt32 into a StringPtr to get the Machine Name. On 64-bit I get a warning because StringPtr is a 64-bit pointer on that architecture. Does Gestalt()

Re: restoring NSSplitView divider's position

2009-09-03 Thread Jim Correia
On Sep 3, 2009, at 6:00 PM, kvic...@pobox.com wrote: ps. i do see the method for setting the divider's position... i just don't see how to get the current position for saving. The divider’s current position can be computed by looking at the frames of the subviews (account for both

Re: [UNSOLVED] How to observe every child entity

2009-09-20 Thread Jim Correia
First, a bit about terminology. What you are talking about is not observing child entities. You wish to observe related instances (NSManagedObject or subclass thereof). The entity describes the instance, but is not the instance. (I'm trying to avoid being overly pedantic, but talking about

Re: Can an app query the values in its own Info.plist?

2009-09-28 Thread Jim Correia
On Sep 28, 2009, at 1:34 AM, Kyle Sluder wrote: Done. rdar://problem://7257097 Also notes that the same collision issue exists for user defaults, where AppKit stores window and splitter autosave information. It is unlikely that any apple framework is ever going to introduce a key of the

NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?

2009-10-07 Thread Jim Correia
The documentation for -[NSAttributedString isEqualToAttributedString:] says: Attributed strings must match in both characters and attributes to be equal. It doesn't mention attachments at all. Consider the following code: attributedString is the input string, and it may contain image

Re: [UTI] Anyway to retrieve the UTI of a file without having to use a FSRef?

2009-10-12 Thread Jim Correia
On Mon, Oct 12, 2009 at 6:36 PM, Iceberg-Dev dev.iceb...@gmail.com wrote: From what I've found in the documentation, the UTI type of a file can be retrieved using the LaunchServices APIs. This requires to provide a FSRef. Wouldn't there be an API I didn't see in Foundation that lets you

Re: Preserving camelCase when prefixing a method name?

2009-10-13 Thread Jim Correia
On Oct 13, 2009, at 10:24 AM, Graham Cox wrote: I think just making the first character uppercase would be sufficient, but I'm not sure how to do that reliably with the unichar data type, so that's my first question. Well you don't have to consider all of unicode, just those characters

Re: Trying to understand -awakeFromNib problem

2009-10-25 Thread Jim Correia
On Oct 25, 2009, at 7:53 AM, Graham Cox wrote: Then, running on 10.5.(8) I stared to get an error that the object new class derived from new base class did not respond to - awakeFromNib. I'd not previously seen this error until I refactored my code. Sure enough my new base class and its new

Re: Trying to understand -awakeFromNib problem

2009-10-25 Thread Jim Correia
On Oct 25, 2009, at 12:22 PM, Roland King wrote: Where's that documented??? I looked for that when I saw the original question. For iPhone it's documented under NSObject UIKit Additions Reference, for 10.6 it's under NSNibAwakingProtocol which doesn't show up anywhere as an implemented

Re: keyPathsForValuesAffectingValueForkey: not updating immediately

2009-10-26 Thread Jim Correia
On Mon, Oct 26, 2009 at 10:03 PM, Brad Gibbs bradgi...@mac.com wrote: I did read the documentation, which is why I used +keyPathsForValuesAffectingFullAddress.  I also tried +keyPathsForValuesAffectingValueForFullAddress: Both methods work, but only after changing the view and then coming

Re: keyPathsForValuesAffectingValueForkey: not updating immediately

2009-10-27 Thread Jim Correia
On Tue, Oct 27, 2009 at 11:39 AM, Brad Gibbs bradgi...@mac.com wrote: I don't think there's anything wrong with the method -- I've used it successfully in other apps and have seen it work in Apple sample apps, it just isn't working in this particular case. I'm sure that there's something

Re: Programmatically invoking double-click bindings on NSTableView

2009-10-28 Thread Jim Correia
On Wed, Oct 28, 2009 at 12:25 PM, Gerd Knops gerti-cocoa...@bitart.com wrote: Seems this should be easy: I have an NSTableView's Double Click Target, Double Click Argument,  Double Click Argument2 etc. binding set, and they work fine. Now I would like to programmatically get the tableview to

Re: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Jim Correia
On Sat, Oct 31, 2009 at 12:05 PM, Richard Somers rsomers.li...@infowest.com wrote: The documentation states didTurnIntoFault method may be used to clear out custom data caches. So far so good. I was creating custom data caches in awakeFromFetch (or awakeFromInsert) until I realized that

Re: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Jim Correia
On Oct 31, 2009, at 12:25 PM, Richard Somers wrote: On Oct 31, 2009, at 10:12 AM, Jim Correia wrote: Typically you set up the baseline value in -awakeFromFetch. Is there a specific reason you need this to be undoable? When the managed object is removed, didTurnIntoFault is called

Re: Programmatic Binding KVC KVO

2009-11-04 Thread Jim Correia
On Nov 4, 2009, at 3:17 PM, Richard Somers wrote: @interface MyView : NSView { double num; } @end @implementation MyView - (double)num { return num; } - (void)setnum:(double)newNum { [self willChangeValueForKey:@num]; num = newNum; [self didChangeValueForKey:@num]; }

Re: removeObserver:forKeyPath: when already removed

2009-11-11 Thread Jim Correia
On Nov 11, 2009, at 5:35 PM, James Walker wrote: I had a situation where removeObserver:forKeyPath: was called twice for the same receiver (an NSUserDefaultsController), the same observer, and the same key path. It threw an NSRangeException. But the KVO docs don't say anything about

Dependent/injected tests vs. linker visibility

2009-11-16 Thread Jim Correia
[Moved from Xcode-Users since it really isn’t an Xcode issue.] I have some dependent/injected unit tests to test application-specific functionality. I've added a test that calls a C function which is defined in the application. This causes a link-time error because, by default,

Re: Question about Style wrt private methods

2009-11-18 Thread Jim Correia
On Nov 18, 2009, at 1:49 PM, Jens Alfke wrote: This is unfortunately true. The danger is that if you add an _- prefixed method to your class, it might conflict with a private method declared in a superclass. If this happens your method will override the internal one, and Really Bad Things

Re: Question about Style wrt private methods

2009-11-18 Thread Jim Correia
On Nov 18, 2009, at 2:32 PM, Jens Alfke wrote: On Nov 18, 2009, at 11:15 AM, Jim Correia wrote: This problem is just not restricted to private methods, or additions through categories. You can also run afoul of a namespace conflict with a public method in your subclass. Yes

Re: Dealing with faults in CoreData / AppleScript

2009-11-20 Thread Jim Correia
On Nov 19, 2009, at 10:19 PM, Greg Hoover wrote: I've been working through adding scriptability to my CoreData application but ran into a snag: accessing relationships may return a fault instead of the actual set of objects. Is there an accepted way of solving this issue? I don't want

Behavior of CFStringUpper/Lowercase for NULL Locale?

2009-11-30 Thread Jim Correia
The documentation for CFStringUppercase says: locale A CFLocale object that specifies a particular language or region. Prior to Mac OS X v10.3, this parameter was an untyped pointer and not used. The locale argument affects

Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Jim Correia
On Dec 4, 2009, at 1:52 PM, Grant Erickson wrote: I have implemented a custom class that derives from NSTextFieldCell to draw status for an associated device (not unlike the network source list in the Network System Preferences) overriding only: […] The issue I am having is determining the

Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Jim Correia
On Dec 4, 2009, at 10:54 PM, Grant Erickson wrote: Thanks for the prompt reply. I forgot to mention one key element. The subclass must support 10.4- and later so I cannot rely on 10.5- and later APIs such as this. In that situation I’d probably write (and test!) if ([self

Re: TransformProcessType() still doesn't show menu (Bug ID# 5905139)

2011-05-26 Thread Jim Correia
On May 26, 2011, at 7:21 PM, Jerry Krinock wrote: I just thought I'd lift my head up long to say thank you, Anders. Unfortunately, your code doesn't work in my app. Tried several mutations; still no good. Another thing I learned is that programmatically switching apps, simulating the

Re: Using Multi-Gesture events with Carbon

2011-07-13 Thread Jim Correia
On Jun 29, 2011, at 2:24 PM, Abdul Sowayan wrote: I have a carbon based application that we are converting overtime to Cocoa. What I would like to do, if possible, is to incorporate multi-gesture events (such as magnify event) into my carbon application. I can see that NSResponder has

Re: confused by what seems to be a recursive declaration/definition

2011-08-11 Thread Jim Correia
On Aug 11, 2011, at 7:27 PM, William Squires wrote: On Aug 11, 2011, at 6:51 PM, Kyle Sluder wrote: On Thu, Aug 11, 2011 at 4:26 PM, Jens Alfke j...@mooseyard.com wrote: On Aug 11, 2011, at 4:10 PM, Luther Baker wrote: static void

Re: Core Data : Undo Delete : Cannot fulfill a fault

2011-09-29 Thread Jim Correia
On Sep 29, 2011, at 11:20 AM, Quincey Morris wrote: I think the answer to your original question is that You're Doing It Wrong™. :) I'm pretty sure (though I never really thought about it before today) that Core Data undo *doesn't* work across 'save:' boundaries. The documentation for

Re: Core Data : Undo Delete : Cannot fulfill a fault

2011-09-30 Thread Jim Correia
On Sep 30, 2011, at 12:06 AM, Quincey Morris wrote: The actual failure scenario I described has 2 necessary conditions. One is a save boundary. The other is the flushing of cached property information for the deleted object. The latter is difficult to cause, especially in a trivial

Re: Core Data : Undo Delete : Cannot fulfill a fault

2011-09-30 Thread Jim Correia
On Sep 30, 2011, at 5:41 AM, Jerry Krinock wrote: I'm still working on this issue, trying to find the trigger which moves my corner case into the corner, hoping for a workaround. It's tedious because of different operations and states. But you have a pretty reliable way to reproduce the

-[NSURLCredentialStorage removeCredential:forProtectionSpace:] broken?

2011-10-06 Thread Jim Correia
Is there a known problem with -[NSURLCredentialStorage removeCredential:forProtectionSpace:], or are my expectations wrong? I iterate all the credials in the storage looking for the one I wish to remove, then send -removeCredential:forProtectionSpace: to the instance, and it doesn't actually

Re: adding something to a setter

2011-10-06 Thread Jim Correia
Do not use self as your observation context. Your observation context has to be unique for all observers of the object. “self” is a bad choice. Also, you should only do your own work in the case that the observer is your observer. In the code below, you are also doing your work in the case

Re: NSTask temrinationStatus always == 1?

2009-05-10 Thread Jim Correia
On Sun, May 10, 2009 at 2:18 PM, marc hoffman m...@elitedev.com wrote: i have an odd issue with NSTask. for some reason, no matter what result code my executable returns (im running xcodebuild, if that matters), NSTask's terminationStatus always reports back as 1. if instead i use system() to

Re: NSTask temrinationStatus always == 1?

2009-05-10 Thread Jim Correia
On Sun, May 10, 2009 at 2:18 PM, marc hoffman m...@elitedev.com wrote: i have an odd issue with NSTask. for some reason, no matter what result code my executable returns (im running xcodebuild, if that matters), NSTask's terminationStatus always reports back as 1. if instead i use system() to

  1   2   >