Re: Core Data fetch with to-many relationship

2009-09-09 Thread Alex Reynolds
I think I found a solution: NSArray *testFetchResults = [managedObjectContext fetchObjectsForEntityName:@"Owner" withPredicate:[NSString stringWithFormat:@"ANY books.name beginswith 'myPrefix'"]]; NSSet *filteredSet = [(NSSet *)[(Owner *)[testFetchResults objectAtIndex:0] buckets] filtere

@property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Oleg Krupnov
Hi, As I understand it, @property (retain) synthesizes something like this: - (void)setMyProp:(NSString*)value { [value retain]; [_myProp release]; _myProp = value; } It is not however clear, and I haven't found it in the guide, whether it's still my responsibility to call [_myProp release

Re: @property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Kyle Sluder
On Sep 9, 2009, at 12:29 AM, Oleg Krupnov wrote: It is not however clear, and I haven't found it in the guide, whether it's still my responsibility to call [_myProp release] in -(void)dealloc? Yes. If you are synthesizing your instance variables, and are on Leopard, you will instead n

Re: @property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Dave Keck
> It is not however clear, and I haven't found it in the guide, whether > it's still my responsibility to call [_myProp release] in > -(void)dealloc    ? There are varying opinions on how you go about it, but yes, you still need to make sure _myProp is released in dealloc. I prefer 'self.myProp =

Cocoaheads Lake Forest (92630) meeting 9/8/2009 at 7 pm on Google Toolkit for Mac

2009-09-09 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the month. We will be meeting at the Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630 Please join us from 7pm to 9pm on Wednesday, 9/8. Neil Rhodes will be discussing the Google Toolk

Re: Core Data fetch with to-many relationship

2009-09-09 Thread Ben Trumbull
When I log the test fetch results: NSArray *testFetchResults = [managedObjectContext fetchObjectsForEntityName:@"Owner" withPredicate:[NSString stringWithFormat:@"ANY books.name like 'myPrefix*'"]]; NSLog([[(Owner *)[testFetchResults objectAtIndex:0] books] valueForKey:@"name"]); I get the follo

Tab view customization

2009-09-09 Thread Arun
Hi All, How can we customize the NSTabView looks to look like a NSSegmentedControl? Any idea or sample code? Thanks Arun KA ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Con

how to use Tx3gDescriptionHandle

2009-09-09 Thread Sandeep Nair
Hi, anybody know how to use Tx3gDescriptionHandle? Tx3gDescriptionHandle tHandle = (Tx3gDescriptionHandle)NewHandle(sizeof (Tx3gDescription)); (*tHandle)->dataFormat = kTx3gSampleType; (*tHandle)->resvd1 = 1; (*tHandle)->resvd2 = 1; (*tHandle)->displayFlags = 1; (*tHandle)->horizontalJustification

Re: Tab view customization

2009-09-09 Thread Graham Cox
On 09/09/2009, at 5:46 PM, Arun wrote: How can we customize the NSTabView looks to look like a NSSegmentedControl? Any idea or sample code? You can't customise the tab view that way (unless you subclass it and do it yourself), but there's a much easier way. Just set the tab view to tab

Re: how to use Tx3gDescriptionHandle

2009-09-09 Thread Graham Cox
Not a Cocoa question - don't cross-post. --Graham On 09/09/2009, at 5:53 PM, Sandeep Nair wrote: Hi, anybody know how to use Tx3gDescriptionHandle? Tx3gDescriptionHandle tHandle = (Tx3gDescriptionHandle)NewHandle (sizeof (Tx3gDescription)); ___

Re: KVO can be unsafe in -init?

2009-09-09 Thread Ben Trumbull
On 08/09/2009, at 12:36 AM, John Chang wrote: Hi all, Question: is it unsafe for some reason to be adding yourself as a KVO observer during -init? We have a singleton with an -init that looks something like this: - (id)init { if ((self = [super init])) { _foo = [[NSMutableDictionary alloc] in

Re: NSController's class accessing NSDocument methods

2009-09-09 Thread BareFeet
Hi all, Following up my previous question: I have a MyDocument/File's Owner, NSOutlineView and bound NSTreeController in a nib file. The outline/table shows a list of Entities (nothing to do with Cocoa or CoreData) in the current document/file. I have successfully set up accessor methods f

Re: KVO can be unsafe in -init?

2009-09-09 Thread John Chang
On 9 sep 2009, at 04.51, Graham Cox wrote: Because you're trying to use a nil key with a dictionary. Why not set a breakpoint on objc_exception_throw and see where that is being attempted? Because it's happening for some users and not in-house :) On 9 sep 2009, at 05.02, Ken Ferry wrote:

Re: KVO can be unsafe in -init?

2009-09-09 Thread John Chang
On 9 sep 2009, at 11.21, Mike Abdullah wrote: Well I would question why you're calling +[XYZManager sharedManager] from within -[XYZManager init] like that. What if you change your init routine to: Oops, sorry. It's actually two different classes which I renamed incorrectly for the purpo

Core Data SQLite I/O error on 10.6

2009-09-09 Thread Seven Lakes Software
I checked the raw SQLite databases Core Data created under 10.5 and 10.6 with a SQLite tool. The result is pretty interesting. As said, all databases are created with the same app and therefore the same data model. The detail is about a many2many, inverse, optional relationship between "Per

Re: KVO can be unsafe in -init?

2009-09-09 Thread Mike Abdullah
On 9 Sep 2009, at 10:31, John Chang wrote: On 9 sep 2009, at 11.21, Mike Abdullah wrote: Well I would question why you're calling +[XYZManager sharedManager] from within -[XYZManager init] like that. What if you change your init routine to: Oops, sorry. It's actually two different class

Re: KVO can be unsafe in -init?

2009-09-09 Thread Roland King
On 09-Sep-2009, at 5:02 PM, John Chang wrote: On 9 sep 2009, at 05.03, Roland King wrote: One thing to note, you're using a context of NULL, which I used to do all the time until I got badly bitten. What would you recommend using as the context? I'm used to checking object/keyPath, thou

Re: KVO can be unsafe in -init?

2009-09-09 Thread Dave Keck
> What do I use. Normally a class static, provided that's granular enough, > always has been for me thus far. Either just make some static thing like a > character array and take the address of it or, as I've been doing recently, > use the address of the class object which I grab in a +initialize()

Re: KVO can be unsafe in -init?

2009-09-09 Thread Keith Duncan
On 9 Sep 2009, at 11:21, Dave Keck wrote: static void *const MyClass_KVOContext = (void *)&MyClass_KVOContext; That certainly is unusual, I use the following macro: #define NSSTRING_CONTEXT(var) static NSString *var = @#var then use the address of the identifier passed as var. This has the

Re: @property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Volker in Lists
Hi, release is necessary, as others already told you. One clarification that I got on a similar post is: -dealloc should always access instance variables directly; it should not call accessor methods. Currently this is impossible to do with synthesized instance variables, but that is consid

Custom NSView in NSMenuItem not receiving mouse events

2009-09-09 Thread Dennis Hartigan-O'Connor
I have an NSMenu popping out of an NSStatusItem using popUpStatusItemMenu. These NSMenuItems show a bunch of different links, and each one is connected with setAction: to the openLink: method of a target. This arrangement has been working fine for a long time. The user chooses a link from the m

Scripting Bridge and Powerpoint, how to make new slide?

2009-09-09 Thread Gabriel Zachmann
I know how to make a new slide in an active presentation in Powerpoint. It works like this: tell application "Microsoft PowerPoint" set newSlideC to make new slide at before slide 2 of active presentation ¬ with properties {layout:slide layout media clip and text} end tell

Snow Leopard turns CMYK jpegs green

2009-09-09 Thread Robert Clair
Cocoa has problems with CMYK jpegs. Going from Tiger to Leopard it became ambivalent about whether a CMYK pixel value of 0, 0, 0, 0 meant black or white. (I remember reading somewhere that there is an ambiguity in the jpeg standard.) You can see this with Preview. Get yourself a CMYK tiff

Re: KVO can be unsafe in -init?

2009-09-09 Thread Marc Respass
We have a singleton with an -init that looks something like this: - (id)init { if ((self = [super init])) { _foo = [[NSMutableDictionary alloc] init]; _bar = [[NSMutableDictionary alloc] init]; [[XYZManager sharedManager] addObserver:self forKeyPath:@"allObjects" options:NSKeyValueObservingOpti

RE: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Colin Deasy
Ok so I have tried both ways, using the main thread for the download messages and using NSOperationQueue to create separate threads & run loops. I'm still getting 30% CPU though. When I run it, my app seems to send the kernel_task a bit crazy (that's where most of the CPU is going). I created a bar

Re: @property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Kyle Sluder
On Sep 9, 2009, at 4:22 AM, Volker in Lists wrote: Currently this is impossible to do with synthesized instance variables, but that is considered a bug. As I mentioned in my reply to Oleg, this bug is fixed in the Snow Leopard compilers. This fact was under NDA at the time I replied to

Re: Scripting Bridge and Powerpoint, how to make new slide?

2009-09-09 Thread Kyle Sluder
On Sep 9, 2009, at 5:45 AM, Gabriel Zachmann wrote: According to Script Editor's dictionary of Powerpoint, the "make" command is in the 'Standard Suite'. But I have no idea how to find it's defintion, let alone how to use it from my Cocoa application. This is covered in the "Creating and

Re: KVO can be unsafe in -init?

2009-09-09 Thread Roland King
What about writing a method, -finishSetup, and invoke it with a delay like below? I use this pattern a lot with loading views. It seems like it would work so that you add observation when your object is ready. Marc [self performSelectorOnMainThread:@selector(finishSetup) withObject:n

Re: Does Mac OS X support interior pointers?

2009-09-09 Thread Jens Alfke
On Sep 7, 2009, at 2:32 AM, John Engelhart wrote: To my recollection, I have never discussed this problem on the list. I have discussed the following: The list of things you've discussed already sounds effectively identical to the point you brought up. Your question "Does the Mac OS X

Re: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Jens Alfke
On Sep 9, 2009, at 8:35 AM, Colin Deasy wrote: Ok so I have tried both ways, using the main thread for the download messages and using NSOperationQueue to create separate threads & run loops. I'm still getting 30% CPU though. When I run it, my app seems to send the kernel_task a bit crazy

Re: Does Mac OS X support interior pointers?

2009-09-09 Thread David Blanton
Hey, I am not a peon! ... instead of wasting your efforts on a little mailing list populated by peons who're merely trying to write applications. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: NSTextView resizeability and scrolling

2009-09-09 Thread Ross Carter
I've googled for a solution, found nothing. I tried making it by observing the NSViewFrameChangedNotification of the NSTextView from it's parent, and resizing, but this is more tricky then I imagined. I think you are on the right track. You might want to look at these threads: http://www.c

Re: NSUserDefaults synchronization in Foundation tools

2009-09-09 Thread Ross Carter
No, it does actually behave as documented. In 10.6 I know it syncs after 15 seconds. In 10.6, I've noticed that my app and other apps are leaving some empty files in ~/Library/Preferences such as "com.apple.iTunes.eq.plist.Z9l0HBm". Is it possible for these relics to occur if the automa

RE: NSURLDownload delegate methods seperate thread

2009-09-09 Thread Colin Deasy
I just tried Apple's sample code QuickLookdownloader which behaves in exactly the same manner :-/ Shark didn't give me back anything useful either! > CC: d...@rudedog.org; cocoa-dev@lists.apple.com > From: j...@mooseyard.com > To: colde...@hotmail.com > Subject: Re: NSURLDownload delegate metho

Re: How to set the media box for a CGPDFPageRef?

2009-09-09 Thread David Duncan
On Sep 8, 2009, at 8:07 PM, DairyKnight wrote: I'm trying to convert my program with PDFKit to CGPDF to get better performance. I'm trying to crop a page, with PDFPage I can simply do: [PDFPage setBounds: forBox:kPDFDisplayMediaBox]; But for CGPDFPageRef, there seems to be only a CGPDFPageGetBo

XCode's debugger won't stop at any breakpoint

2009-09-09 Thread Gabriel Zachmann
I suppose this is a FAQ and this mailing list is not quite the right place to ask, but XCode's debugger is driving me crazy. It happens to me quite often, that it just won't stop at any breakpoint I set! Neither on a function breakpoint nor on a line breakpoint. When I click in the gutter n

Re: XCode's debugger won't stop at any breakpoint

2009-09-09 Thread Kyle Sluder
On Wed, Sep 9, 2009 at 2:13 PM, Gabriel Zachmann wrote: > I suppose this is a FAQ and this mailing list is not quite the right place > to ask, but XCode's debugger is driving me crazy. You're correct. This question belongs on the xcode-users list. --Kyle Sluder __

myOutlineView rowForItem representedObject

2009-09-09 Thread jon
what is the opposite of the "representedOject" method so that indexRow comes out correctly here below? BaseNode* node4 = [[myOutlineView itemAtRow:i] representedObject]; indexRow = [myOutlineView rowForItem: [node4 ]]; ___ Co

[MEET]: LA CocoaHeads tomorrow night, 9/10 7:30pm

2009-09-09 Thread Rob Ross
Greetings LA CocoaHeads. This Thursday, Ron will be demoing his iPhone app “The DVD Bit Budget Assistant”, and showing some of the facets that went into creating it. More info on the app itself at http://www.editgroove.com/ We meet at the offices of E! Entertainment at 7:30pm. Our meeting loc

Scripting Bridge link error

2009-09-09 Thread Randall Meadows
I am trying to use Scripting Bridge to do some minor control of Adobe Photoshop CS3 from my Cocoa app. I have followed the instructions in the "Scripting Bridge Programming Guide for Cocoa", specifically: 1. Generate header files for all scriptable applications that your code is sending me

Framing a UIImageView

2009-09-09 Thread Development
I'm trying to stroke a rect around a UIImage. I have subclassed UIImageView with the following code but I get Nothing the drawRect: method is never called: -(id)initWithImage:(UIImage *)image { if(self= [super initWithImage:image]) { }

Re: Scripting Bridge link error

2009-09-09 Thread Jason Foreman
On Sep 9, 2009, at 8:52 PM, Randall Meadows wrote: AdobePhotoshopCS3JPEGSaveOptions *options = [AdobePhotoshopCS3JPEGSaveOptions new]; [...] It compiles fine, but I get this link error: Undefined symbols: ".objc_class_name_AdobePhotoshopCS3JPEGSaveOptions", referenced from: literal

Re: Framing a UIImageView

2009-09-09 Thread Joshua Pennington
UIImageView uses its underlying layer property to draw the image, so - drawRect: is not being invoked. If you are simply wanting to display a border around the image, see CALayer's borderColor & borderWidth properties. i.e. imageView.layer.borderWidth = 1.0; imageView.layer.borderColor = [[

Re: Framing a UIImageView

2009-09-09 Thread Development
Ahha. Ok thank you very much that answers the question On Sep 9, 2009, at 7:13 PM, Joshua Pennington wrote: UIImageView uses its underlying layer property to draw the image, so -drawRect: is not being invoked. If you are simply wanting to display a border around the image, see CALayer's bo

Re: myOutlineView rowForItem representedObject

2009-09-09 Thread Charles Srstka
On Sep 9, 2009, at 5:15 PM, jon wrote: what is the opposite of the "representedOject" method so that indexRow comes out correctly here below? BaseNode* node4 = [[myOutlineView itemAtRow:i] representedObject]; indexRow = [myOutlineView rowForItem: [node4 ]]; AFAICT, t

Re: NSTextView resizeability and scrolling

2009-09-09 Thread Stamenkovic Florijan
Hi Ross, Thanks for your reply, On Sep 09, 2009, at 13:15, Ross Carter wrote: I've googled for a solution, found nothing. I tried making it by observing the NSViewFrameChangedNotification of the NSTextView from it's parent, and resizing, but this is more tricky then I imagined. I think yo

[MEET] CocoaHeads-NYC tonight, Sept. 10, 6:00

2009-09-09 Thread Andy Lee
Paul Kim will be our speaker tonight. Paul will talk about porting an existing 32-bit, retain/release app to 64-bit with Garbage Collection (or more specifically, supporting both GC and retain/release). We'll go somewhere for food afterwards -- probably, but not necessarily, Goodburger in

Intercepting user changes to table cells using bindings

2009-09-09 Thread BareFeet
Hi all, I have a table view with columns bound to an NSArrayController. The user can edit the values that appear and it's all working fine. I have a class called "DataRow" for each row in the table/controller. Each DataRow is essentially an NSMutableDictionary with a key for each column n

Re: NSArray EXEC_BAD_ACCESS when initalized with strings

2009-09-09 Thread Jeff Schilling
How are you determining which call fails? Is there a back trace? Your code compiles and runs fine here (10.6). It will help if you provide some additional details, e.g. version, backtrace, some additional context around the failure. On Sep 8, 2009, at 11:13 PM, Devraj Mukherjee wrote: Hi

Re: How to remove the "Special Characters..." menu item?

2009-09-09 Thread H David Goering
Graham, Yes, that works. Oh, I can run. I'm just learning my way around a new set of tripping hazards. Thanks, David On Sep 8, 2009, at 11:43 PM, Graham Cox wrote: Look up NSUserDefaults in the documentation. That's where you need to add this setting. I find it surprising that you a

Looking for Cocoa developer in NYC

2009-09-09 Thread Josh Distler
Hello. We are in need of a talented developer for a very exciting project application development project in NYC. A slightly more detailed description follows. Please contact joshdist...@mac.com if interested. Best. /Josh --- We are looking for a talented programmer to work closely with

NSImage - drawInRect SnowLeopard issue

2009-09-09 Thread tresa
Hello, I seem to be running into an issue on Snow Leopard with NSImage. Basically , I have a thumbnail kind of view , shown as a sheet , to which I render the images read from the disk. The problem is that on Snow Leopard the image shows up as blank whereas it renders fine on Leopard and Tiger.

Passing variables between .m files

2009-09-09 Thread Aaron Robinson
I have been struggling over this one for a while now, and what frustrates me the most is the feeling that it should be relatively simple to do. Let's say I have File1.m and File2.m, and I would like to access a variable in File2.m from File1. My previous programming experience is in Java, so my f

Show/Hide file extension issue in savePanel

2009-09-09 Thread Paul Figgiani
Prior to installing Snow Leopard the following code worked with no problem, It runs a savePanel for exporting an rtf doc with the contents of a textVIew. Under 10.6 it still works. However the option to show/hide the output file extension stopped working. The savePanel checkbox toggles the visibil

Re: NSArray EXEC_BAD_ACCESS when initalized with strings

2009-09-09 Thread Dave Keck
If you enable the -Wformat warning, the compiler will warn you if you omit the trailing nil. Never understood why it's not enabled by default... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator commen

Table cell: how show blue when tapped only while editing is true?

2009-09-09 Thread Steve Fogel
Hi, all... I've got a table view for which users must tap an Edit button before they can make changes. This button puts the table view in editing mode. How can I make the cell show blue (it's selected) only while editing is true? The scenario I want: When editing = NO 1. User taps a cel