Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Alexander Spohr
Am 01.03.2010 um 08:12 schrieb Eagle Offshore: > NSManagedObject* obj; // gets created somehow > > [obj setValue: nil forKey: @"bar"]; // succeeds where NSDictionary fails > [obj setValue: [NSNull null] forKey: @"bar"]; // fails where NSDictionary > succeeds > > so - this is conceptually buggy

Re: Carbon is C++?

2010-02-28 Thread Eagle Offshore
All my audio render callbacks use the C-function-pointer-to-call-named-selector trick in JambaLaya. (http://audiofreakshow.com) In fact, the entire app is written in Objective-C. Between SnoizeMIDI, MTCoreAudio, and my own private TBAudioUnits framework - I deal with C or C++ almost never.

action for raise and lower baseline of textview

2010-02-28 Thread XiaoGang Li
Hello, Lists, When creating my document-based application, there is a default menu item, Format->Font->Baseline. select text on the text view, then click the Raise or Lower menu, I find something that I can not understand. Click Raise menu first, the space between the lines increase.

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Eagle Offshore
Documentation? "NSNull" does not appear in the documentation. http://developer.apple.com/mac/library/documentation/cocoa/reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html NSNull is conceptually the wrapper for nil, like NSNumber is the wrapper for a number.

re: Core Data 10.5 Mapping error 134140. Troubleshooting, "Value Expressions"?

2010-02-28 Thread Ben Trumbull
> In my latest model revision, I added a relationship between existing > entities. The value of nil would be fine, so I typed 'nil' in for "Value > Expression" on each end. The compiler swallowed it OK. Also, I added a Date > attribute, which I would like to default to NSDistantFuture, but si

Re: Where in the MVC should my code go?

2010-02-28 Thread Quincey Morris
On Feb 28, 2010, at 20:22, Jean-Henri Duteau wrote: > What you're essentially suggesting is putting this code in the model and I > don't think it goes there. The various strings that get displayed on the > view are for the purposes of the view only. They don't have any use in the > model. >

Re: Carbon is C++?

2010-02-28 Thread Erik Buck
On Feb 28, 2010, at 10:49 PM, David Rowland wrote: > > On Feb 28, 2010, at 7:24 PM, Erik Buck wrote: > >> I disagree. I have written very low latency device drivers in Objective-C. >> Why do you think Objective-C has too much "latency" for audio? When >> properly used, Objective-C programs

Re: Where in the MVC should my code go?

2010-02-28 Thread Jean-Henri Duteau
What you're essentially suggesting is putting this code in the model and I don't think it goes there. The various strings that get displayed on the view are for the purposes of the view only. They don't have any use in the model. I explored using Transformer's some more because, after I wrote

Re: Carbon is C++?

2010-02-28 Thread David Rowland
On Feb 28, 2010, at 7:35 PM, Paul Bruneau wrote: > That is excellent and I really like the sound of it. Someone please inform > the authors of Apple's iPhone sample code so that I won't have to deal with > C++ anymore! (I'm looking at YOU, SpeakHere!) SpeakHere displays one of the things I lik

Re: Carbon is C++?

2010-02-28 Thread David Rowland
On Feb 28, 2010, at 7:24 PM, Erik Buck wrote: > I disagree. I have written very low latency device drivers in Objective-C. > Why do you think Objective-C has too much "latency" for audio? When properly > used, Objective-C programs are no more likely to be preempted than any other > kind of

Re: Carbon is C++?

2010-02-28 Thread Kyle Sluder
On Sun, Feb 28, 2010 at 7:24 PM, Erik Buck wrote: > I disagree.  I have written very low latency device drivers in Objective-C.   > Why do you think Objective-C has too much "latency" for audio?  When properly > used, Objective-C programs are no more likely to be preempted than any other > kind

Re: Carbon is C++?

2010-02-28 Thread Paul Bruneau
That is excellent and I really like the sound of it. Someone please inform the authors of Apple's iPhone sample code so that I won't have to deal with C++ anymore! (I'm looking at YOU, SpeakHere!) On Feb 28, 2010, at 10:24 PM, Erik Buck wrote: > I disagree. I have written very low latency devi

Re: Carbon is C++?

2010-02-28 Thread Erik Buck
I disagree. I have written very low latency device drivers in Objective-C. Why do you think Objective-C has too much "latency" for audio? When properly used, Objective-C programs are no more likely to be preempted than any other kind of program. Message dispatch generally has constant time a

Re: Suppress or Fix Inverse Relationship Warnings (Mike Abdullah)

2010-02-28 Thread Steve Steinitz
Hi Mike, On 26/2/10, Mike Abdullah wrote: There's a section in the Build Settings entitled "Data Model Compiler (MOMC) Warnings". Should find everything you want there. Thank you. Really helpful. I've raised an enhancement request for an extra suppression option named, tentatively, "Suppre

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Kyle Sluder
On Sun, Feb 28, 2010 at 6:16 PM, Eagle Offshore wrote: > Really?  This is a problem somehow? Yes. You can either provide an object or nil. You gave it an object it didn't like. > NSManagedObject couldn't just take the hint and go with nil? Would you rather an API based on "taking hints" or an A

NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Eagle Offshore
Unacceptable type of value for attribute: property = "notes"; desired type = NSString; given type = NSNull; value = Really? This is a problem somehow? NSManagedObject couldn't just take the hint and go with nil? -Todd Blanchard ___ Cocoa-dev mai

Re: Using CFMutableDictionaryRef (Resolved)

2010-02-28 Thread Greg Guerin
Alexander Hartner wrote: I am still a little confused why the pointer addresses are different when storing and accessing the objects from the dictionary though. Because you're passing the address *of* the local variable, not the address *in* the local variable. Remove the leading &'s.

Re: Using CFMutableDictionaryRef (Resolved)

2010-02-28 Thread Alexander Hartner
The following code seem to work correction. I had to use CGPointMakeWithDictionaryRepresentation to re-construct a CGPoint. I am still a little confused why the pointer addresses are different when storing and accessing the objects from the dictionary though. - (void)touchesBegan:(NSSet *)touc

Re: UITextView as its own delegate - infinite loop on keyboard select

2010-02-28 Thread Kyle Sluder
On Sat, Feb 27, 2010 at 6:37 PM, Roland King wrote: > Thanks that's what I see too. That thread doesn't explain why of course. I > have a trivial test case so I'll file this as a bug and see what comes back > because I think the behaviour is wrong. For now I'm using a different object > as delegat

Re: Carbon is C++?

2010-02-28 Thread Kyle Sluder
On Sun, Feb 28, 2010 at 1:33 PM, Paul Bruneau wrote: > Or if you want to do a bunch of audio stuff in the iPhone, then you can enjoy > the experience of learning C++ even though all you want to do is obj-c. > Depressing. Nothing in Core Audio requires you to use C++, but all of the stuff in Pub

Re: Using CFMutableDictionaryRef

2010-02-28 Thread Alexander Hartner
I have made some modifications. I am using local variables at this stage to debug this problem. However once I got this working I will be using a member variable for the touchSession. When I debug this and set a brake point after fetching the point from the dictionary, but the pointDict and the

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Andreas Mayer
Am 28.02.2010 um 21:20 Uhr schrieb Alexander Bokovikov: What do you have in mind? Is it incorrect to create such behavior? I think it is. My app is a player. Dropping file into it I'd expect its activation. Why? Without activation all visual controls are not reachable unless you'll cli

Re: Using CFMutableDictionaryRef

2010-02-28 Thread Fritz Anderson
On 28 Feb 2010, at 5:09 PM, Alexander Hartner wrote: > CFDictionaryAddValue(aTouchSession, touch, pointDict); > NSLog(@"Stored Touch : %i Point : %i",&touch,&pointDict); > > CGPoint beginPoint = *(CGPoint *)CFDictionaryGetValue(aTouchSession, touch); > NSLog(@"Fetched To

Core Data - synchronize ManagedObjectContexts - save date

2010-02-28 Thread Rainer Standke
Hello, I have an document-based CoreData application that uses an NSOperation to manipulate ManagedObjects. I can successfully synchronize the main thread's context, using mergeChangesFromContextDidSaveNotification:. However, when I subsequently try to save the document I get a warning th

Using CFMutableDictionaryRef

2010-02-28 Thread Alexander Hartner
This my be a little off topic, but I am trying to store a list of UITouch events in a dictionary as suggested in the Apple Documentation. This is what I have come up with, but it's not working. The documentation refers to a MultiTouchDemo which I can't find anywhere online. So with some help f

Re: Where in the MVC should my code go?

2010-02-28 Thread Chris Hanson
On Feb 27, 2010, at 11:34 PM, Jean-Henri Duteau wrote: > BTW, I've already considered a Transformer. The problem with that is one of > code bloat - I have multiple fields on the view that are derived from this > one attribute. I haven't figured out a way at design time in IB to make one > tra

Re: Carbon is C++?

2010-02-28 Thread Paul Bruneau
On Feb 28, 2010, at 1:20 AM, Ian Joyner wrote: > Carbon was originally Pascal based, at least as far as the APIs. It does not > essentially matter what it is written in, just what APIs it supports. If it > has been rewritten in C++ (are they mad?), that should make no difference to > whatever d

preferredLocalizationsFromArray: strange behaviour

2010-02-28 Thread ANE
Hi! Let's suppose I would like to know the current preferred language. I'm using the following code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSArray *languages = [defaults objectForKey:@"AppleLanguages"]; NSLog(@"Languages: %@", languages);

Re: Carbon is C++?

2010-02-28 Thread Ian Joyner
Carbon was originally Pascal based, at least as far as the APIs. It does not essentially matter what it is written in, just what APIs it supports. If it has been rewritten in C++ (are they mad?), that should make no difference to whatever developer language is used, and would not be an argument

CoreAnimation context error

2010-02-28 Thread James Farwell
I am writing an application with a UI layout much like Address Book, with two panes, a list on the left and a read/edit view on the right. The the right pane is an NSScrollView and I have an "Edit" button beneath it that swaps the document view between the read-only view and the editing view. The r

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 22:38, Andreas Mayer wrote: Hm. You don't? Just dragging should not switch the focus to another application. What do you have in mind? Is it incorrect to create such behavior? My app is a player. Dropping file into it I'd expect its activation. Am I wrong? Without activ

Re: Connecting Outlet on Derived Array Controller

2010-02-28 Thread Ken Thomases
On Feb 28, 2010, at 11:48 AM, Joanna Carter wrote: > I think I need to add an outlet to an array controller. Why do you think that? What aspect of your design leads you to that conclusion? > Thus I have created a derived class and added the outlet to the class. Normally, an outlet would be som

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Ken Thomases
On Feb 28, 2010, at 11:45 AM, Chris Tracewell wrote: > On Feb 28, 2010, at 9:26 AM, Jens Alfke wrote: > >> On Feb 28, 2010, at 8:23 AM, Chris Tracewell wrote: >> >>> I have two synthesized properties - A and B. Whenever A changes I need B to >>> be updated to A.keypath. >> >> If B's value is e

Re: Embedding Custom NSView in NSScroller having strange effect on drawRect calls.

2010-02-28 Thread Billy Flatman
I've fixed the issue now by nesting my custom NSLayer in another layer which is also inside the NSScrollView. Not sure why this fixed things but every thing seems to be working ok now. I do have some some of the sublayers backed though. Cheers for your response, Billy. On 26 Feb 2010, at 06

Connecting Outlet on Derived Array Controller

2010-02-28 Thread Joanna Carter
Hi Folks I think I need to add an outlet to an array controller. Thus I have created a derived class and added the outlet to the class. @interface AccountingPeriodArrayController : NSArrayController { } @property (nonatomic, retain) IBOutlet AccountingPeriod *accountingPeriod; @end Now, what

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Chris Tracewell
On Feb 28, 2010, at 9:26 AM, Jens Alfke wrote: On Feb 28, 2010, at 8:23 AM, Chris Tracewell wrote: I have two synthesized properties - A and B. Whenever A changes I need B to be updated to A.keypath. If B's value is entirely dependent upon A, you don't even need to synthesize it — you c

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Chris Tracewell
On Feb 28, 2010, at 9:28 AM, Jean-Daniel Dupas wrote: Le 28 févr. 2010 à 17:23, Chris Tracewell a écrit : I have two synthesized properties - A and B. Whenever A changes I need B to be updated to A.keypath. Is the correct way to do this to override the synthesized setter of A like so? -(

Re: Webview and dynamic content

2010-02-28 Thread Jens Alfke
On Feb 28, 2010, at 1:56 AM, Jere Gmail wrote: > I know, but I'm gonna have different json files and also the webpage > with a few images, and due to javascript limitations, they have to be > on the same root folder, that is it can be in "webfolder/something" > but not in "webfolder/../something"

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Jean-Daniel Dupas
Le 28 févr. 2010 à 17:23, Chris Tracewell a écrit : > I have two synthesized properties - A and B. Whenever A changes I need B to > be updated to A.keypath. Is the correct way to do this to override the > synthesized setter of A like so? > > -(void)setA:(id)value > { > A = value >

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Jens Alfke
On Feb 28, 2010, at 8:23 AM, Chris Tracewell wrote: > I have two synthesized properties - A and B. Whenever A changes I need B to > be updated to A.keypath. If B's value is entirely dependent upon A, you don't even need to synthesize it — you can just implement B's getter to return A.keypath,

Correct way to overide synthesized setter?

2010-02-28 Thread Chris Tracewell
I have two synthesized properties - A and B. Whenever A changes I need B to be updated to A.keypath. Is the correct way to do this to override the synthesized setter of A like so? -(void)setA:(id)value { A = value [self setB:A.keypath]; } Thanks. _

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Klaus Backert
On 28 Feb 2010, at 15:46, Alexander Bokovikov wrote: On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; It looks like I've understo

Core Data 10.5 Mapping error 134140. Troubleshooting, "Value Expressions"?

2010-02-28 Thread Jerry Krinock
In a Core Data project using the 10.5 SDK, I've written several mapping models that have worked, but now going from version 4 to 5, it "just doesn't work". Compiles OK, but opening an old document results in a Cocoa Error Domain code 134140 "Can't find mapping model for migration". From experi

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Andreas Mayer
Am 28.02.2010 um 15:46 Uhr schrieb Alexander Bokovikov: I drop a file into my app's window. And the question is how to "switch the global system focus" to my app? Hm. You don't? Just dragging should not switch the focus to another application. Of course you *can* steal the focus using NSAp

Re: NSWindow - makeKeyAndOrderFront problem - solved

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; Really the problem was not in the scheduling but just in the scope of the message

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; It looks like I've understood why it is not working. Here is the message descript

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
On 28.02.2010, at 17:48, jonat...@mugginsoft.com wrote: Try scheduling it for the next iteration of the run loop. [mainWindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0.0]; I tried it too as well as performSelectorOnMainThread:(SEL)aSelector withObject:(i

Re: NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread jonat...@mugginsoft.com
On 28 Feb 2010, at 12:37, Alexander Bokovikov wrote: > Hi, All, > > Perhaps it's my misunderstanding, but I can't activate window title when I > apply > > [mainWindow makeKeyAndOrderFront:nil] > > to main app window in the "performDragOperation" drag&drop handler. The > content is dropped int

NSWindow - makeKeyAndOrderFront problem

2010-02-28 Thread Alexander Bokovikov
Hi, All, Perhaps it's my misunderstanding, but I can't activate window title when I apply [mainWindow makeKeyAndOrderFront:nil] to main app window in the "performDragOperation" drag&drop handler. The content is dropped into the window, and window goes to the top of screen, but its title

Re: Webview and dynamic content

2010-02-28 Thread Jere Gmail
I know, but I'm gonna have different json files and also the webpage with a few images, and due to javascript limitations, they have to be on the same root folder, that is it can be in "webfolder/something" but not in "webfolder/../something" On Sat, Feb 27, 2010 at 5:52 PM, Jens Alfke wrote: > >