Core Data validateForUpdate

2009-12-20 Thread Gerriet M. Denkmann
I have a document based Core Data app. MyDocument.nib contains an NSTableView bound to an NSArrayController. There also are + and - buttons, which send add: resp. remove: to the array controller. SomeEntity.m (subclass of NSManagedObject) implements validateForInsert:, validateForUpdate: and

Re: Core Data validateForUpdate

2009-12-20 Thread Mike Abdullah
I think you misunderstand what -validateForInsert: and friends are for. They use insert here in the sense of inserting into the persistent store. So -validateForInsert: is called the first time the object is added to the store (calling -[NSManagedObjectContext save:] ). From then on,

passing a method name?

2009-12-20 Thread Chunk 1978
i have a bunch of methods that will call one method. currently, i'm passing a string object so the called method will know which method had called it, and complete the proper task based on the method that called it. instead of creating strings and passing them, is it possible to pass the method

Re: passing a method name?

2009-12-20 Thread Graham Cox
On 21/12/2009, at 12:18 AM, Chunk 1978 wrote: i have a bunch of methods that will call one method. currently, i'm passing a string object so the called method will know which method had called it, and complete the proper task based on the method that called it. Good programming practice

Re: NSTableview datasource issues

2009-12-20 Thread Alexander Spohr
Did you set a breakpoint on the data source methods? Please reread about memory management. Your code is full of wrong retains. Why is segmentDict a global variable? You just assign to it but never release it. segmentIndustry is a class and should be named with a capital S. segmentIndustryData

Re: Core Data - Importing using NSOperation - Problems on main thread

2009-12-20 Thread Greg Reichow
Hi, I have an application that persists its data using core data. It uses an NSOperation to download new versions of the data asynchronously. This NSOperation uses its own MOC (moc2) (as opposed to the MOC (moc1) used in the main thread, which is used by the UI). Both MOCs share

Re: iPhone Simulator auto-rotation touches detection bug?

2009-12-20 Thread Matt Neuburg
On or about 12/19/09 12:08 PM, thus spake Randall Meadows cocoa-...@not-pc.com: On Dec 19, 2009, at 12:53 PM, Matt Neuburg wrote: The iPhone app I'm currently writing is autorotated at startup (see my previous posts on this topic). I've noticed that there's an area about 24 pixels wide at

Re: Core Data validateForUpdate

2009-12-20 Thread Mark Townsend
I think that you want to implement the awakeFrom* methods on NSManagedObject rather than the validate* methods for your purposes. But as for them never getting called, make sure that your NSArrayController bindings are correct. Specifically that it's mapped to your NSManagedObject subclass.

Customizing NSTableViewHeader

2009-12-20 Thread Gustavo Pizano
Hello, After reading some post, and coding my own class, I was able to set up a custom glossy background color, then I realize the title was behind it, so I just place it above the background.. So, so far so good. But now when I click in the header of a column, of course because its a custom

Re: Can't trap uncaught exceptions on Snow Leopard

2009-12-20 Thread Matt Neuburg
On Sat, 19 Dec 2009 13:27:01 +0200, Oleg Krupnov oleg.krup...@gmail.com said: Anyway, I have just found that the following code works: NSExceptionHandler *handler = [NSExceptionHandler defaultExceptionHandler]; [handler setExceptionHandlingMask:NSLogAndHandleEveryExceptionMask]; [handler

Re: passing a method name?

2009-12-20 Thread Matt Neuburg
On Sun, 20 Dec 2009 08:18:36 -0500, Chunk 1978 chunk1...@gmail.com said: i have a bunch of methods that will call one method. currently, i'm passing a string object so the called method will know which method had called it, and complete the proper task based on the method that called it. instead

Charisse Marie Napenas/Cebu/Lexmark is out of the office.

2009-12-20 Thread Charisse Marie Napenas
I will be out of the office starting 12/18/2009 and will not return until 01/05/2010. I will respond to your message when I return. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Adding a shadow to a UIImage in a UIImageview

2009-12-20 Thread Development
Ok so after a couple suggestions and rereading the Quartz information on shadows I modified my code but it's mostly all redundant since the shadow color is whatever the image color is and I cant seem to change that. Anyway Below is the code I am trying to use to draw a drop shadow under a

Re: Core Data - Importing using NSOperation - Problems on main thread

2009-12-20 Thread Nick Banks
Thanks Greg, Yes I did use the [managedObjectContext save:error], in the same fashion as in some of the examples provided by Apple. Interestingly, I am using the same mechanism in a completely unrelated project with no problems, and have studied the Core Data documentation for some time. If

Re: passing a method name?

2009-12-20 Thread Nathan Day
You can pass the hidden parameter _cmd which is of type SEL you can then use @selector(selector_name) to do your test, this whole thing you are doing sounds really strange, it would be good to see what you are doing to find a better approach. based on what little information your are giving us

Re: NSTableview datasource issues

2009-12-20 Thread aronisoft
Alexander, Thanks for your help. Yes, I set the breakpoint on the data source methods? The datasource methods are not reached at all. I did not give you all the methods in my code (it is too lengthy). segmentDict is a global variable because I need it somewhere else. segmentIndustryData is

Re: passing a method name?

2009-12-20 Thread Jeffrey Oleander
On Sun, 2009/12/20, Graham Cox graham@bigpond.com wrote: From: Graham Cox graham@bigpond.com Subject: Re: passing a method name? To: Chunk 1978 chunk1...@gmail.com Cc: cocoa-dev Dev cocoa-dev@lists.apple.com Date: Sunday, 2009 December 20, 07:29 On 2009/12/21, at 00:18, Chunk 1978

Re: passing a method name?

2009-12-20 Thread Matt Neuburg
On Mon, 21 Dec 2009 00:29:00 +1100, Graham Cox graham@bigpond.com said: On 21/12/2009, at 12:18 AM, Chunk 1978 wrote: i have a bunch of methods that will call one method. currently, i'm passing a string object so the called method will know which method had called it, and complete the

Re: passing a method name?

2009-12-20 Thread Andy Lee
On Dec 20, 2009, at 1:05 PM, Jeffrey Oleander wrote: On Sun, 2009/12/20, Graham Cox graham@bigpond.com wrote: [...] Good programming practice encourages the idea that functions and methods are complete in and of themselves, and are invariant under different calling conditions.

Re: NSTableview datasource issues

2009-12-20 Thread Alexander Spohr
Am 20.12.2009 um 18:32 schrieb aronis...@afroamerica.net: I did not give you all the methods in my code (it is too lengthy). segmentDict is a global variable because I need it somewhere else. Sounds like bad design ;) a dealloc method takes care of releasing the arrays and dictionary.

Re: Core Data - Importing using NSOperation - Problems on main thread

2009-12-20 Thread Quincey Morris
On Dec 20, 2009, at 09:16, Nick Banks wrote: Yes I did use the [managedObjectContext save:error], in the same fashion as in some of the examples provided by Apple. Interestingly, I am using the same mechanism in a completely unrelated project with no problems, and have studied the Core

Re: Customizing NSTableViewHeader.. I think I got it.

2009-12-20 Thread Gustavo Pizano
.. I think I got it... I overwrote the mouseDown method from NSResponder, and the sorting doesn't happen... so I guess I must aim my efforts starting form this method. I will let you know my progress. G. On Dec 20, 2009, at 5:30 PM, Gustavo Pizano wrote: Hello, After reading some post,

Re: NSTableview datasource issues

2009-12-20 Thread Greg Guerin
Yes, I set the breakpoint on the data source methods? The datasource methods are not reached at all. Then you must consider the possibility that your table view has a nil data source, or a data source of a different class. If the methods definitely aren't being called, then simple logic

passing around Protocols like passing SEL?

2009-12-20 Thread aaron smith
Hey all, quick question. How you do pass around protocol references? I'm looking to do something like what NSDistantObject uses to set a protocol, (setProtocolForProxy:). That method takes a (Proxy *), and all I've found is that in some headers they declare a class (@class Protocol). So does this

Localization strategies?

2009-12-20 Thread Ricky Sharp
In getting quotes from many localization companies, I've found that some have different processes. For example, one company would prefer if I just provide .string files. During their QA process, they'll then run the app and look at everything in context. While generating .strings from nibs

tracking EXC_BAD_ACCESS error in applescript command

2009-12-20 Thread François Guillet
Hi All, I'm trying to implement an object-first command targeted at the document of a document based app. Doing so always results in the same EXC_BAD_ACCESS error : #0 0x7fff86951466 in -[NSScriptCommand _sendToRemainingReceivers] () #1 0x7fff86951fe5 in -[NSScriptCommand

Re: passing around Protocols like passing SEL?

2009-12-20 Thread Mike Abdullah
See http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ObjectiveC/Articles/ocProtocols.html#//apple_ref/doc/uid/TP30001163-CH15-TPXREF149 On 20 Dec 2009, at 20:15, aaron smith wrote: Hey all, quick question. How you do pass around protocol references? I'm looking to do

Re: passing a method name?

2009-12-20 Thread Graham Cox
On 21/12/2009, at 5:05 AM, Jeffrey Oleander wrote: OTOH [] An action is the message a control sends to the target Target/action is not what I was talking about at all. It's OK to store a SEL which is invoked as a response - the signature of that SEL does not change the behaviour or state

Re: passing a method name?

2009-12-20 Thread Dave Carrigan
On Dec 20, 2009, at 3:29 PM, Graham Cox wrote: I think what the OP was talking about was making a called method sensitive to its caller, which is a no-no. That's what I thought the OP was saying, and I agree. It would mean that doing a refactor and changing a method's name, or even adding

Re: NSTableview datasource issues

2009-12-20 Thread aronisoft
Greg, I understand your proposition. For some reason, the spaces are stripped off by the e-mail system, but you got it right. Actually, segmentDict contains the copy of a global dictionary created by the method [[MyDocument getSectorSegmentData:(id) sender] mutableCopy]. Unfortunately i

Re: NSTableview datasource issues

2009-12-20 Thread Greg Guerin
I understand your proposition. For some reason, the spaces are stripped off by the e-mail system, but you got it right. Did your email system also capitalize ObjectValueForTableColumn? Actually, segmentDict contains the copy of a global dictionary created by the method [[MyDocument

Re: tracking EXC_BAD_ACCESS error in applescript command

2009-12-20 Thread Jerry Krinock
On 2009 Dec 20, at 13:50, François Guillet wrote: EXC_BAD_ACCESS error : #0 0x7fff86951466 in -[NSScriptCommand _sendToRemainingReceivers] () #1 0x7fff86951fe5 in -[NSScriptCommand executeCommand] () #2 0x7fff8696902e in -[NSScriptingAppleEventHandler

IKImageBrowserView managing the number of columns manually

2009-12-20 Thread Nicolas Berloquin
Hi ! I'm using an IKImageBrowserView to show a series of image captures and it works really well. I would like to be able to manage the number of images shown in a row in a precise way, and I'd like to know if there is any public way to do this ? The zoom variable is nice, but I don't like having

Core Data Migration

2009-12-20 Thread Chaitanya Pandit
Hello, List, I'm working on the migration for one of my Core Data document based application, i've created a mapping model in XCode and am using the NSMigratePersistentStoresAutomaticallyOption property by overriding the configurePersistentStoreCoordinatorForURL:... method. as described in