Re: Core Data fetch with to-many relationship

2009-09-09 Thread Alex Reynolds
Hi Melissa, Thanks for the name change suggestion. When I log the test fetch results: NSArray *testFetchResults = [managedObjectContext fetchObjectsForEntityName:@Owner withPredicate:[NSString stringWithFormat:@ANY books.name like 'myPrefix*']]; NSLog([[(Owner *)[testFetchResults

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

2009-09-09 Thread Graham Cox
OK, point taken - enjoy your trip ;-) Glad you got it working, and welcome to Cocoa. --Graham On 09/09/2009, at 4:02 PM, H David Goering wrote: Graham, Yes, that works. Oh, I can run. I'm just learning my way around a new set of tripping hazards.

Re: Does Mac OS X support interior pointers?

2009-09-09 Thread Scott Thompson
Those who disagree with me implicitly acknowledge I do not think that those who disagree with you must acknowledge your two premises implicitly or explicitly. A) The compiler is generating code that violates the C standard. You put a lot of effort into claiming that it's a given that the

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]

@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

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 oleg.krup...@gmail.com 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

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

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 following

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.

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

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]

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

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

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

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

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

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,

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

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

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

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

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 volker_li...@ecoobs.de 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

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 z...@tu-clausthal.de 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

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)

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

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:

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

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 methods

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

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

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 Zachmannz...@tu-clausthal.de 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 ]]; ___

[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

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

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

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,

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

[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