Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Trygve Inda
> On Sep 28, 2010, at 22:48, Trygve Inda wrote: > >>[myObject removeObjectForKey:myDict]; > > Shouldn't that be: > > [myObject removeObjectForKey:myOldKey]; > > ? Yes. Sorry - typing in Mail. Correct code (still crashes on PPC) myDict = [myObject objectForKey:myOldKey]; if (myDict) {

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Roland King
Did you read my post about retaining things before you remove them from dictionaries? On Sep 29, 2010, at 15:29, Trygve Inda wrote: >> On Sep 28, 2010, at 22:48, Trygve Inda wrote: >> >>> [myObject removeObjectForKey:myDict]; >> >> Shouldn't that be: >> >> [myObject removeObjectForKey:my

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Trygve Inda
> Did you read my post about retaining things before you remove them from > dictionaries? > > myDict = [myObject objectForKey:myOldKey]; > if (myDict) > { >[myObject removeObjectForKey: myOldKey]; >[myObject setValue:myDict forKey:myNewKey]; > >[[NSUserDefaults standardUserDefaults]

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Roland King
There's nothing odd about it. It's simple memory management rules. The moment you remove the object from the dictionary the dictionary is no longer an owner and since you've not retained it, neither are you. If nobody else is, it's subject to dealloc as soon as the dictionary releases it If it s

Re: I want a window's file owner that's not a NSWindowController

2010-09-29 Thread Jonny Taylor
> Quincey Morris wrote: >> You're kind of mixing up two different tasks here. The Camera object is >> (likely) part of your data model (in the MVC paradigm). A window controller >> is a ... controller. For your settings window, you'll have least heartache >> if you make the NIB's File's Owner a

Background-Task (Timer)

2010-09-29 Thread Lukas Tenbrink
Hey there, Cocoa List! I've got a question about background tasking, and I couldn't really answer myself it by searching in the documentation (or even in the internet). I want to make a background task with an application. Firstly, I used the code they gave as a sample, which looks like this: -

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-29 Thread Oleg Krupnov
Hi Ken, Now I see. I hardly find words to thank you for your patience! :) There's been indeed a misunderstanding. I imagined mistakenly that there could be many "connection points" on the server, one connection point per thread, and each such connection point could vend a different object of diff

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-29 Thread Ken Thomases
Hi Oleg, On Sep 29, 2010, at 5:16 AM, Oleg Krupnov wrote: > Now I see. I hardly find words to thank you for your patience! :) You're welcome. I'm glad I could help. > Now I see that the correct picture is the following. There is only one > connection point, and there is only one root vended o

Button performs action and then stores result to a binding?

2010-09-29 Thread Jonny Taylor
I have a modal dialog which, among other things, contains a number of file paths. There are "set..." buttons to set which files these are pointing to. I feel that with bindings I should be able to set things up automatically in InterfaceBuilder so that when that button is clicked a nav dialog is

Re: I want a window's file owner that's not a NSWindowController

2010-09-29 Thread Ken Thomases
On Sep 29, 2010, at 3:21 AM, Jonny Taylor wrote: > OK, while that's a very handy thing to know, I think I have worked out a > simpler way that does not require an intermediate class - I'll state it here > for the archives (and any comments welcome...) > > I show the window using the following c

Re: Button performs action and then stores result to a binding?

2010-09-29 Thread Ken Thomases
On Sep 29, 2010, at 6:31 AM, Jonny Taylor wrote: > I have a modal dialog which, among other things, contains a number of file > paths. There are "set..." buttons to set which files these are pointing to. You should probably by using NSPathControl instead of displaying paths and having "set" but

Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Hi, I have a bidirectional one to one relationship between two entities like this: Foo <-> Bar, and Foo has a subclass FooSub. All entities are concrete. Sometimes when I set the inverse relationship it's like this aBar.toFoo = aFoo, and this works fine, but when it's linking back to the subcl

Re: My NSSwappedDouble decoding crashes on iPhone 4

2010-09-29 Thread Markus Spoettl
On Sep 29, 2010, at 2:41 AM, Markus Spoettl wrote: > The the Mac code is 32bit and runs on Leopard and Snow Leopard. > > - (void)encodeDouble:(double)value forKey:(NSString *)key withCoder:(NSCoder > *)encoder > { >NSSwappedDouble sd = NSSwapHostDoubleToLittle(value); >[encoder encodeByte

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-29 Thread Oleg Krupnov
Hi Ken, > I'm not sure exactly what's happening. It sounds like the connection's ports > are still scheduled in the main thread's run loop as well as the new thread's > run loop. When a request arrives and both run loops are idle, it's > effectively arbitrary which one will handle the request

Text "ghosting" or "doubling" problem

2010-09-29 Thread Andrew Hughes
Hello all, I am working on a word processing problem. I have a paginated view that has multiple text containers and text views laid out to form pages. I have an intermittent bug where one line of text from another text view/text container gets overlaid onto a line from the "current" text

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread jeremy
If your data store is SQLite, I believe the problem is the subclass FooSub. Since FooSub is a subclass of Foo, CoreData combines both Foo and FooSub into a single table whose columns include all properties from Foo AND FooSub. Consequently, when you create a new instance of Foo, columns from Foo

portable app

2010-09-29 Thread Amy Heavey
I'm writing an app for personal use, using core data. At the moment it's set up to save the data file in the library/ application support/myapp folder on the machine. I also want to store a growing number of images to use with the app, so they are set to store in this folder as well. Howev

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Martin Wierschin
On Sep 29, 2010, at 16:02, Trygve Inda wrote: There is example code here (2nd example) that removes before setting too. http://stackoverflow.com/questions/1024938/renaming-keys-in-nsmutabledictionary That 2nd example shouldn't be followed. Either retain the value obtained from the dictio

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Quincey Morris
On Sep 29, 2010, at 06:28, Gideon King wrote: > I would have thought it would be OK for the relationship to point to an > instance of FooSub shouldn't it? After all, it is a subclass of Foo. Or do > things work differently for subclasses in Core Data? If so, how should I work > around this prob

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Jerry Krinock
On 2010 Sep 29, at 09:19, jeremy wrote: > For a solution, rework your schema to subclass FooSub directly from > NSManagedObject. That might work. If it doesn't, On Sep 29, 2010, at 9:28 AM, Gideon King wrote: > All entities are concrete … I would have thought it would be OK for the > relati

Re: portable app

2010-09-29 Thread Matt Neuburg
On Sep 29, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > Message: 6 > Date: Wed, 29 Sep 2010 17:48:43 +0100 > From: Amy Heavey > Subject: portable app > To: cocoa-dev@lists.apple.com > Message-ID: > <5bd34c42-c5df-42a4-a054-9f6f9376d...@willowtreecrafts.co.uk> > Content-Typ

Re: Background-Task (Timer)

2010-09-29 Thread Keary Suska
On Sep 29, 2010, at 2:54 AM, Lukas Tenbrink wrote: > I've got a question about background tasking, and I couldn't really answer > myself it by searching in the documentation (or even in the internet). > I want to make a background task with an application. Firstly, I used the > code they gave as

Open Multiple Files

2010-09-29 Thread Richard Somers
I need to know how many files the user is attempting to open. The NSApplicationDelegate Protocol has this method. - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames Just count the number of items in the array and then re-route the call for continued processing. But

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Thanks but no, it's an atomic store which gets written to XML. Regards Gideon On 30/09/2010, at 2:19 AM, jeremy wrote: > If your data store is SQLite, I believe the problem is the subclass FooSub. > > Since FooSub is a subclass of Foo, CoreData combines both Foo and FooSub into > a single tab

Core Data inheritance across models?

2010-09-29 Thread Rick Mann
Is it possible for an Entity defined in one .xcdatamodel file to inherit from an Entity in a separate .xcdatamodel file? TIA, Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Sorry, I should have been clearer. It is a sub-entity which is implemented as a subclass. Regards Gideon On 30/09/2010, at 3:39 AM, Quincey Morris wrote: > On Sep 29, 2010, at 06:28, Gideon King wrote: > >> I would have thought it would be OK for the relationship to point to an >> instance o

Re: Open Multiple Files

2010-09-29 Thread Sean McBride
On Wed, 29 Sep 2010 16:21:41 -0600, Richard Somers said: >I need to know how many files the user is attempting to open. > >The NSApplicationDelegate Protocol has this method. > >- (void)application:(NSApplication *)sender openFiles:(NSArray >*)filenames > >Just count the number of items in the arr

Re: Core Data inheritance across models?

2010-09-29 Thread Sean McBride
On Wed, 29 Sep 2010 15:29:39 -0700, Rick Mann said: >Is it possible for an Entity defined in one .xcdatamodel file to inherit >from an Entity in a separate .xcdatamodel file? No (AFAIK). But .xcdatamodels are not magic, you could build everything programatically I suppose. See: NSEntityDescript

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Hi Jerry, Can I just clarify what you mean about working around a bug on 10.5? I do need this to work on 10.5. FooSub is a subentity of Foo, and both have their classes defined, with FooSub's class being a subclass of Foo's class. Thanks Gideon On 30/09/2010, at 3:49 AM, Jerry Krinock wrote

Re: Open Multiple Files

2010-09-29 Thread Richard Somers
On Sep 29, 2010, at 4:32 PM, Sean McBride wrote: Are you a document-based app? Have you seen this:? Yes it is document-based app. I have seen this, but not recently. Looks l

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Quincey Morris
On Sep 29, 2010, at 15:30, Gideon King wrote: > Sorry, I should have been clearer. It is a sub-entity which is implemented as > a subclass. Hmm. I'd suspect a limitation of delete cascading rules, but that doesn't really fit with the error message your reported. Was that error text exactly wha

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
That's actually how I eventually managed to work out that it appeared to be a subclass/subentity thing. It got picked up on validateForInsert when I was doing a Save As, and I checked the objects, and they all seemed fine. But this actually gives me an idea for a bit more testing that I can do -

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-29 Thread Ken Thomases
Hi Oleg, On Sep 29, 2010, at 9:57 AM, Oleg Krupnov wrote: > I tried -[NSConnection removeRunLoop:[NSRunLoop currentRunLoop]], but > it doesn't seem to change anything. Huh. I don't know what's going on there. You might consider opening a developer technical support incident with Apple to ask

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Jerry Krinock
On 2010 Sep 29, at 15:57, Gideon King wrote: > Can I just clarify what you mean about working around a bug on 10.5? I do > need this to work on 10.5. It was Quincey who tipped me off to this a few weeks ago: http://developer.apple.com/mac/library/releasenotes/Cocoa/MigrationCrashBuild106Run105

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Thanks Jerry, I'll need to keep that in mind. In the meantime, I've done more research this morning, and it appears that the underlying issue is that my one to one relationships that have an inverse are not being maintained properly during a Save As operation, even though at the managed object

CGEventTap Not Receiving Events after some time

2010-09-29 Thread Erik Aigner
When I create an event tap with CGEventTapCreate(..) and add it to the runloop everything works as expected. However, after some time (I don't know what triggers this) the event tap doesn't receive events anymore, until I manually call CGEventTapEnable(..) again. Any clues what could cause this

Accessing Scrollers in NSBrowser ?

2010-09-29 Thread Naresh Kongara
Hi, I want to add an icon over scrollers of Each column in NSBrowser. How can I access the scrollview of each column and how to add action icon to the scroller in each column. Can anybody help me out ? Thanks. kongara___ Cocoa-dev mailing list (Coc

Interface showing wrong values

2010-09-29 Thread Evan Coleman
I'm having a very strange problem. I can't provide any code because I don't know which part of my code is causing the problem. I have an NSMenuExtra, and for some reason some labels and image views in an NSView inside of an NSMenuItem are displaying their default values (the values that are set in

Creating and associating my own file extension based on plist

2010-09-29 Thread Ignacio Enriquez
Hi This is basically a duplicate of this thread: but the more eyes the better I thought so here is my question: My iPad application handles with files of type *.mndl which is not more than a customized *.plist. Up until now I've been using *.plist files but now I want to associate the extension an

Re: Interface showing wrong values

2010-09-29 Thread Kyle Sluder
On Sep 29, 2010, at 7:02 PM, Evan Coleman wrote: > I'm having a very strange problem. I can't provide any code because I don't > know which part of my code is causing the problem. I have an NSMenuExtra, > and for some reason some labels and image views in an NSView inside of an > NSMenuItem are d

Re: Table column alignment

2010-09-29 Thread Reinhard Segeler
No. -- Reinhard Am 26.09.2010 um 18:04 schrieb k...@highrolls.net: In IB I have set the properties of a table text field cell to be right justified but do not see this result when displaying data; i.e. the data remains left justified. Is there some other setting that must be made for