Re: Newbie Core Data question.

2009-10-11 Thread Matthew Lindfield Seager
Hi Gustavo, I'm no expert but one way is for the second controller's Content Array or Content Set to be bound to some property of the first controller's selection. For example if you have an entity "Foo" with a to-many relationship called "bars" you would: - bind the "content set" of bars array c

Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]

2009-10-11 Thread Matthew Lindfield Seager
Thanks for the help. The main gap in my understanding was that by default an NSFormatter uses the same format string for converting a string to an object and converting an object to a string. It is therefore fussy about how the user types the string. By subclassing the formatter you can customise

Re: Newbie Core Data question.

2009-10-11 Thread Gustavo Pizano
Matthew hello: Well I have developed some cocoa apps, and I have a medium background on WebObjects, so EO and WO uses bindings also, so even some things are different the binding theory its quite similar. (ie, KVC) I read the Core Data programing guide, and well I found lot;'s of similar

Drag & Drop in NSCollectionView

2009-10-11 Thread Rick Mann
I'm trying to initiate a drag of my NSCollectionView items. It's all set up, and I have a delegate that implements - collectionView:canDragItemsAtIndexes:withEvent:, always returning YES. But it never gets called. I can select my items, but I can't get anything to drag. What am I missing?

Re: Newbie Core Data question.

2009-10-11 Thread Matthew Lindfield Seager
> > I want to achieve is that from the first list in the first view, I can do a > drag and drop to the second view, and once dropped I want to show the data, > so first I was trying setting the selected item directly, into the second > view, and having a NSIObjectController in that second nib, that

re: [iPhone} Exception After Creating First Object

2009-10-11 Thread Steve Steinitz
Hi Ben, Thanks for your reply. On 10/10/09, Ben Trumbull wrote: Does anyone know how to make [self.tableView endUpdates] less vulnerable when the associated database table is empty? Which version of iPhoneOS SDK are you building for ? This sounds like an issue that was fixed in 3.1. Ah,

Re: Should I try to avoid loading principal class of plug-in?

2009-10-11 Thread Gregory Weston
Rick Mann wrote: I'm working on a plug-in-based app. While I have to scan all of the plug-ins and load some information from their info.plists, I don't necessarily need to load any of the code until a plug-in is actually used. My main question is, is it worth it to do this? It seems like that's

Re: [MEET] October CocoaHeads Mac Developer Meetings

2009-10-11 Thread Lyndsey Ferguson
Hello, For those of you planning on attending the CocoaHeads meeting in Columbia, Maryland, USA, can you let me know? I would like to get a count of attendees. Thanks in advance, Lyndsey Ferguson On Sep 30, 2009, at 1:23 PM, Stephen Zyszkiewicz wrote: Greetings, CocoaHeads is an internat

Re: Newbie Core Data question.

2009-10-11 Thread I. Savant
On Oct 11, 2009, at 6:00 AM, Gustavo Pizano wrote: but I can't set the Key Model and key path to something to work.. Let's forget about the drag and drop part for now and simplify the problem. You said earlier: I have a window with 2 custom views, each view with their corresponding

Re: Newbie Core Data question.

2009-10-11 Thread Gustavo Pizano
I. Thanks for the link, I will then see the example and try to understand these bindings better, I thought they were something similar as in WO- EOF, but its seems lot of things changed here. I dunno what will be more difficult, if make an IB plugin or set the bindings by code, ( I guess t

Re: Newbie Core Data question.

2009-10-11 Thread I. Savant
On Oct 11, 2009, at 9:20 AM, Gustavo Pizano wrote: Thanks for the link, I will then see the example and try to understand these bindings better, I thought they were something similar as in WO-EOF, but its seems lot of things changed here. You might want to search the list archives for rel

Recursively get all files and folders

2009-10-11 Thread Tom Jones
Hello, I'm playing with NSFileManager and I'm trying to get all of the contents of a directory. When I use "directoryContentsAtPath" it just gives me the one level. Is there an easy/good way to get all subdirectories and files as well? Thanks, tom ___

Re: Snow Leopard: unsupported PointerFunctions configuration was requested

2009-10-11 Thread Kai Brüning
On 10.10.2009, at 13:56, Chris Idou wrote: Below is the RegexKit code that causes the Snow Leopard error. After reading the doco, I don't feel very enlightened about what the unsupported configuration is, or what the solution might be. Can anyone give me a clue? Sure: replace NSPointe

Re: Recursively get all files and folders

2009-10-11 Thread Dave Keck
See NSFileManager -enumeratorAtPath:. ___ 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

Binding Popup to Images

2009-10-11 Thread Gordon Apple
I saw a few refs to this from from a few years back and I guess it was problematic. Anything changed? Is there a way to bind a popup or dropdown to an array of images, other that faking it with images in text? I really don't want to set an outlet to load it, because that means a whole new co

Re: Should I try to avoid loading principal class of plug-in?

2009-10-11 Thread Rick Mann
On Oct 11, 2009, at 04:36:42, Gregory Weston wrote: Rick Mann wrote: I'm working on a plug-in-based app. While I have to scan all of the plug-ins and load some information from their info.plists, I don't necessarily need to load any of the code until a plug-in is actually used. My main questi

Re: Recursively get all files and folders

2009-10-11 Thread Tom Jones
Thanks, I have no idea how I missed that in the docs :-P tom - Original Message - From: "Dave Keck" To: "Tom Jones" Cc: cocoa-dev@lists.apple.com Sent: Sunday, October 11, 2009 10:57:43 AM GMT -08:00 US/Canada Pacific Subject: Re: Recursively get all files and folders See NSFileManager

Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Ben Haller
Hi folks. So my screensaver broke on 10.6, along with everybody else's, and I'm told that's because it has to be compiled for the 64- bit architecture, because System Prefs is a 64-bit app on 10.6. So I set up a conditional compilation thing where it compiles three versions: - ppc agains

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Dave Keck
>  So I guess System Preferences doesn't like my garbage collection setting > (which is set to "Unsupported").  Do I really need to turn GC on to get my > screensaver to work? Yes, your screensaver must be GC-supported to support Snow Leopard. This bit me recently too - I wasn't expecting it eithe

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Clark Cox
On Sun, Oct 11, 2009 at 12:23 PM, Dave Keck wrote: >>  So I guess System Preferences doesn't like my garbage collection setting >> (which is set to "Unsupported").  Do I really need to turn GC on to get my >> screensaver to work? > > Yes, your screensaver must be GC-supported to support Snow Leopa

NSCollectionView delegate methods aren't called

2009-10-11 Thread Rick Mann
I'm trying to implement drag & drop in my NSCollectionView, following the 10.6 release notes. I've got my delegate set, but nothing was happening. I then implemented each of the methods to see if any were called, and none are. I've verified that the delegate is indeed connected. Any sugge

Where to send different messages while RunLoop is running

2009-10-11 Thread John Love
Reference: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html#//apple_ref/doc/uid/1057i-CH16-SW29 As noted, Apple's sample code sends a kCheckinMessage back to the main Thread and then monitors the currentRunLoop un

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Ben Haller
On 11-Oct-09, at 3:28 PM, Clark Cox wrote: On Sun, Oct 11, 2009 at 12:23 PM, Dave Keck wrote: So I guess System Preferences doesn't like my garbage collection setting (which is set to "Unsupported"). Do I really need to turn GC on to get my screensaver to work? Yes, your screensaver m

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Kyle Sluder
On Oct 11, 2009, at 12:44 PM, Ben Haller wrote: OK, makes sense. My only question: what's the best way to switch at compile time based on whether GC is enabled for the build? I.e. what do I #if or #ifdef? I could do it based on the arch or the SDK, but if there's a flag specifically

Re: NSCollectionView delegate methods aren't called

2009-10-11 Thread I. Savant
On Oct 11, 2009, at 3:28 PM, Rick Mann wrote: I'm trying to implement drag & drop in my NSCollectionView, following the 10.6 release notes. I've got my delegate set, but nothing was happening. I then implemented each of the methods to see if any were called, and none are. I've verified that

Re: Where to send different messages while RunLoop is running

2009-10-11 Thread Alastair Houghton
On 11 Oct 2009, at 20:40, John Love wrote: Reference: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html#//apple_ref/doc/uid/1057i-CH16-SW29 As noted, Apple's sample code sends a kCheckinMessage back to the main T

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Ben Haller
On 11-Oct-09, at 3:52 PM, Kyle Sluder wrote: On Oct 11, 2009, at 12:44 PM, Ben Haller wrote: OK, makes sense. My only question: what's the best way to switch at compile time based on whether GC is enabled for the build? I.e. what do I #if or #ifdef? I could do it based on the arch or

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Clark Cox
On Sun, Oct 11, 2009 at 1:06 PM, Ben Haller wrote: > On 11-Oct-09, at 3:52 PM, Kyle Sluder wrote: > >> On Oct 11, 2009, at 12:44 PM, Ben Haller >> wrote: >> >>> OK, makes sense.  My only question: what's the best way to switch at >>> compile time based on whether GC is enabled for the build?  I.e

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Kyle Sluder
On Oct 11, 2009, at 1:06 PM, Ben Haller wrote: Yes, but my code also needs to compile as GC-unsupported against the 10.4 SDK, where any GC-specific calls that I might need to make will not compile. Am I missing something? Do you really need to compile against the 10.4 SDK? Why not comp

Creating NSMatrix of NSImageCells

2009-10-11 Thread PCWiz
I need to create an NSMatrix with NSImageCells bound to an array controller. So the content of the NSMatrix is bound to an NSArray (so there are as many NSImageCells in the matrix as there are objects in the array), then the image path of the NSImageCells are bound to a key called "iconPath

Re: Where to send different messages while RunLoop is running

2009-10-11 Thread John Love
Wow, your response was super prompt and I thank you for that. I have used a thread (and -performSelectorOnMainThread) and this approach definitely works. Having said that, I am in the process of just learning about NSMachPorts and am doing this now. I just wish to use 2 NSMachPorts to com

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Ben Haller
On 11-Oct-09, at 4:11 PM, Kyle Sluder wrote: On Oct 11, 2009, at 1:06 PM, Ben Haller wrote: Yes, but my code also needs to compile as GC-unsupported against the 10.4 SDK, where any GC-specific calls that I might need to make will not compile. Am I missing something? Do you really need

Appropriate dealloc and finalize actions

2009-10-11 Thread Karolis Ramanauskas
Good day, everyone, The situation is simple, I have two instances of the same class (MyClass). This class has a connection instance variable and a declared property for that variable: @property (readwrite, assign) MyClass * connection; So basically an object has a reference to another object of

drawing in uiview

2009-10-11 Thread Jos Timanta Tarigan
hi, i got a very basic question on iphone development. so i add an uiview via IB and try to update it by making my own interface called updateInterface(). in the update interface i put this code: CGRect frame = [polyView frame]; NSArray*polypath = [[selfclass]pointsForPolygonInRect:frame numb

RE: IBPlugin Inspector: get contents of the Library Media tab

2009-10-11 Thread Pierre Fournier
Hi all,don't know if its the right place to post a question about IBPlugin development ...Ok, so, I'm developing an IBPlugin for a custom control (among others) which uses two NSImage. I also develop a dedicated Inspector for that control, in which I would let the user choose the two images he

Fade out button in willTransitionToState of UITableViewCell

2009-10-11 Thread James Wardle
Hi, I am trying to fade a button in a UITableViewCell in and out on state transitions, however the animation is not working: the button's alpha is immediately set to 0. Any help would be greatly appreciated, Thanks. Code: -(void) willTransitionToState:(UITableViewCellStateMask)state{ if(state =

A question involving properties

2009-10-11 Thread Michael de Haan
May I indulge the group. In doing the Hillegass challenge of Chapter 18 ( creating a doc based app to draw ovals), detoured to get a deeper understanding to Apples Sketch-112, which in turn lead to properties and ivars, which lead to this little demo app to give me some more insight into ho

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Clark Cox
On Sun, Oct 11, 2009 at 1:55 PM, Ben Haller wrote: > On 11-Oct-09, at 4:11 PM, Kyle Sluder wrote: > >> On Oct 11, 2009, at 1:06 PM, Ben Haller >> wrote: >> >>> Yes, but my code also needs to compile as GC-unsupported against the 10.4 >>> SDK, where any GC-specific calls that I might need to make

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. You do not need to allocate NSTextField programmatically, it will be loaded automatically. @interface TestAppDelegate : NSObject { NSTextField * _textField; } @proper

Re: A question involving properties

2009-10-11 Thread Michael de Haan
On Oct 11, 2009, at 2:35 PM, Karolis Ramanauskas wrote: OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. Well...what I was **really** trying to do was get my head around using properties/ivars correctly :-) B

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Ben Haller
On 11-Oct-09, at 5:28 PM, Clark Cox wrote: On Sun, Oct 11, 2009 at 1:55 PM, Ben Haller wrote: Well, I imagine I'm going to need to use *something* GC-specific -- strong/weak declarations, Not likely. finalize methods, whatever. Implementing finalize methods are actually quite rare; and

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
Cool, I'm quite a beginner myself, so this may be not quite correct... When you set up your user interface using interface builder and when the application launches the window it automatically allocates and initializes all the objects you placed on the window. *I never tried to replace those object

Re: Creating NSMatrix of NSImageCells

2009-10-11 Thread Graham Cox
On 12/10/2009, at 7:20 AM, PCWiz wrote: I need to create an NSMatrix with NSImageCells bound to an array controller. So the content of the NSMatrix is bound to an NSArray (so there are as many NSImageCells in the matrix as there are objects in the array), then the image path of the NSImage

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Greg Guerin
Karolis Ramanauskas wrote: - (void)dealloc { if (self.connection) { self.connection.connection = nil; } [super dealloc]; } Why would you do this? You're making one object responsible for the internals of another object. This is a bad idea. It breaks the individu

Re: A question involving properties

2009-10-11 Thread Michael de Haan
On Oct 11, 2009, at 3:26 PM, Karolis Ramanauskas wrote: I think your exercise obscured your goal too much. I think you are correct...but in the end, I got what I wanted out of this. The reason I did this though, was that recently there has been a lot of discussion about the correct way

Re: Binding to values which aren't there

2009-10-11 Thread BareFeet
On 10/10/2009, at 9:17 AM, A B wrote: Long-held habits regarding best practices regarding relational integrity are making me reluctant to stick a "parentPerson" ivar in each Note object, otherwise the solution would be simple: Just create another property which has code in the getter that c

Writing NSArray data to file, and compression

2009-10-11 Thread Tom Jones
Hello, I'm looking to store NSDirectoryEnumerator data in a file, but it seems to create a really large file. How can I get the file size down? I have tried both of these methods to save the and while the NSKeyedArchiver reduces the size by about 1MB to 9.3MB thats still seems really big. [file

Re: NSURLRequest

2009-10-11 Thread Mike Abdullah
On 10 Oct 2009, at 15:36, DKJ wrote: I've got an NSArray that I initialise with data from a plist stored on a remote webserver. I've been doing it like this: NSURL *url = [NSURL URLWithString:@"http://www.server.com/ data.plist"]; NSArray *myArray = [NSArray arrayWithContentsOfURL

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Clark Cox
On Sun, Oct 11, 2009 at 2:57 PM, Ben Haller wrote: > On 11-Oct-09, at 5:28 PM, Clark Cox wrote: > >> On Sun, Oct 11, 2009 at 1:55 PM, Ben Haller >> wrote: >>> >>>  Well, I imagine I'm going to need to use *something* GC-specific -- >>> strong/weak declarations, >> >> Not likely. >> >>> finalize m

Re: Binding "hidden" attribute

2009-10-11 Thread BareFeet
OK, let me put this another way: Has anyone successfully bound the "hidden" attribute of an Interface object, so that it hides and shows when the ivar changes? If so, how? Thanks, Tom BareFeet From: BareFeet Date: 9 October 2009 12:18:38 AM AEDT To: Cocoa Dev Subject: Binding hidden

Re: Writing NSArray data to file, and compression

2009-10-11 Thread Dave Keck
I'm confused. NSDirectoryEnumerator doesn't conform to NSCoding, so you're not going to be able to archive it. And then, why would one want to archive an NSEnumerator in the first place? ... meanwhile, the code snippet you posted seems to be archiving an array. About all I can conjure is you're tr

how to get font information from ttf file?

2009-10-11 Thread XiaoGang Li
Hi, I am trying to find some documentations for the issue, that how to get the font information from the ttf file. But NSFont and others seems can not help me. Does anyone know where to start this investigatio. Thanks. XiaoGang ___ Cocoa-dev mailing lis

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Michael Ash
On Sun, Oct 11, 2009 at 4:08 PM, Clark Cox wrote: > On Sun, Oct 11, 2009 at 1:06 PM, Ben Haller > wrote: >> On 11-Oct-09, at 3:52 PM, Kyle Sluder wrote: >> >>> On Oct 11, 2009, at 12:44 PM, Ben Haller >>> wrote: >>> OK, makes sense.  My only question: what's the best way to switch at c

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Kyle Sluder
On Oct 11, 2009, at 7:05 PM, Michael Ash wrote: Now, I *think* that 10.4 actually has stub versions of all these calls which work correctly for the non-GC case which will always be found on 10.4, but it's manifestly not the case that there aren't any GC-specific calls to make. Any code compiled

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Michael Babin
On Oct 11, 2009, at 2:44 PM, Ben Haller wrote: My only question: what's the best way to switch at compile time based on whether GC is enabled for the build? I.e. what do I #if or #ifdef? I could do it based on the arch or the SDK, but if there's a flag specifically for GC I'd rather use

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Karolis Ramanauskas
> > If you want to do something that doesn't break encapsulation, then you > should simply release the one ivar connection. That will let the receiving > object perform its own actions, by itself, on its own behalf, as appropriate > to its own affairs. Thanks, however, I do not see how to accomp

re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Mr. George Warner
On Sun, 11 Oct 2009 15:02:22 -0400, Ben Haller > wrote: > Hi folks. So my screensaver broke on 10.6, along with everybody > else's, and I'm told that's because it has to be compiled for the 64- > bit architecture, because System Prefs is a 64-bit app on 10.6. So I > set up a conditional compil

Re: NSCollectionView delegate methods aren't called

2009-10-11 Thread Rick Mann
On Oct 11, 2009, at 12:54:20, I. Savant wrote: On Oct 11, 2009, at 3:28 PM, Rick Mann wrote: I'm trying to implement drag & drop in my NSCollectionView, following the 10.6 release notes. I've got my delegate set, but nothing was happening. I then implemented each of the methods to see if

Re: Hardware UUID in New Mac Book Pro

2009-10-11 Thread Grigutis, John A
On Oct 8, 2009, at 10:18 AM, Rajendran P wrote: > Hi, > How to fetch the Hardware UUID from New Mac Book Pro. Earlier Mac > Book's system Profiler was showing Hardware UUID but in new > machines, It might be hidden or stored in any other form/name. > Is there any command or (c/cpp) api to get

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Jens Alfke
On Oct 11, 2009, at 7:44 PM, Karolis Ramanauskas wrote: I have object1 that has a connection to object2, (object1.connection = object2). And at the same time object2.connection = object1: O1 -> O2 O2 -> O1 It's generally a bad idea to have two objects each retain the other. It prod

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Jens Alfke
On Oct 11, 2009, at 4:11 PM, Greg Guerin wrote: Why would you do this? You're making one object responsible for the internals of another object. This is a bad idea. It breaks the individual encapsulation of each object. But there are times you need to do this. One example is in some t

Re: NSCollectionView delegate methods aren't called

2009-10-11 Thread Jens Alfke
On Oct 11, 2009, at 12:28 PM, Rick Mann wrote: I'm trying to implement drag & drop in my NSCollectionView, following the 10.6 release notes. I've got my delegate set, but nothing was happening. I then implemented each of the methods to see if any were called, and none are. I've verified th

Re: NSCollectionView delegate methods aren't called

2009-10-11 Thread Rick Mann
On Oct 11, 2009, at 22:08:11, Jens Alfke wrote: On Oct 11, 2009, at 12:28 PM, Rick Mann wrote: I'm trying to implement drag & drop in my NSCollectionView, following the 10.6 release notes. I've got my delegate set, but nothing was happening. I then implemented each of the methods to see

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Greg Guerin
Jens Alfke wrote: It's not so much making an object responsible for another object's internals, as simply managing a relation from that other object. In other words, I'm the one who told the window to point its delegate property to me, so it's OK for me to tell it to point it to nil when

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Kai Brüning
Hi Karolis, I’d say your pattern is absolutely correct. I assume those two objects do not retain each other, they just need to know about the other one. And they should be allowed to die separately, while cleaning up the otherwise dangling pointer in the other object. The good news is tha

Re: How to set checkbox state in TableView columnheader

2009-10-11 Thread Zhang Li
Finally I made it! Again thanks to Jerry Krinock & Corbin Dunn. I've troubled by this issue for quite some days, and you saved me! =) I'm not sure whether it's the most proper way to do it, but the code works, I can change title, change background color and change checkbox state by clicking it