Re: CoreData, Object/Array Controllers and KVO

2008-08-14 Thread I. Savant
On Aug 14, 2008, at 1:46 AM, Jeff Hellman wrote: - (void)willChangeValueForKey:(NSString *)key is called. So is - (void)didChangeValueForKey:(NSString *)key Why is this? I'm not actually changing the object values, am I? If you know that, you should be able to see what key changed. From

@try @catch

2008-08-14 Thread Georg Seifert
hello, is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails. I could imagine something: - (id) layerInstance { if ([[layerIns

Updating current managedobject

2008-08-14 Thread Andrew Zahra
I have a classic core data app just like all the tutorials with fields bound to the model. But now I have one field that I want to update as the result of the user selecting a directory from an NSOpenPanel. How do I access the current managedObject the user is editing to update this one field fron

Re: @try @catch

2008-08-14 Thread Graham Cox
On 14 Aug 2008, at 8:58 pm, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails. Hmmm, I'll be looking forw

Re: @try @catch

2008-08-14 Thread Devon Ferns
On 14-Aug-08, at 7:21 AM, Graham Cox wrote: On 14 Aug 2008, at 8:58 pm, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it on

Is this a bug, or am I hacking?

2008-08-14 Thread Graham Cox
I have some UI that manages a data model that can store two kinds of objects. The data management of the objects is identical but the actual objects themselves are fairly distinct. One of the things I'm trying to do is to allow my data management UI to update "live" if a change is made to t

Re: @try @catch

2008-08-14 Thread Jean-Daniel Dupas
Le 14 août 08 à 13:53, Devon Ferns a écrit : On 14-Aug-08, at 7:21 AM, Graham Cox wrote: On 14 Aug 2008, at 8:58 pm, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test

Re: @try @catch

2008-08-14 Thread Uli Kusterer
On 14.08.2008, at 12:58, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails. Apple's stance on exceptions so

Re: Is this a bug, or am I hacking?

2008-08-14 Thread Uli Kusterer
On 14.08.2008, at 13:55, Graham Cox wrote: So should the comparison of the notification name by address be considered a bug? Or have I guessed wrong about what's going on? AFAIK the pointer comparison is an optimization that's expected to happen. That said, if you can't find it in the docs

crashing MacOs application when running a build file

2008-08-14 Thread Y Nguyen
Hi all, I'm a new MacOS dev member. I'm developing an demo application that connect to SQLite (SQLite3). I have a problem with my application. I also build my app and try to run it (using app file). When I run by "Build and Run" in Xcode, there are no problem. But when I run app file (in release fo

Re: Opening an external file in a external application

2008-08-14 Thread John Love
On Aug 13, 08, at 12:09 PM, Shawn Erickson wrote: On Aug 13, 2008, at 8:17 AM, John Love wrote: On 12 Aug 2008, has wrote: Really though, what's best/practical/possible all depends on what you're trying to do, so if you want more advice then you'll need to provide more information. Ve

Re: Detect when another application goes into full screen mode or when dock becomes hidden

2008-08-14 Thread Angie Frazier
Thanks Eric, the Carbon event handler worked. On Wed, Aug 13, 2008 at 10:55 AM, Eric Schlegel <[EMAIL PROTECTED]> wrote: > > On Aug 13, 2008, at 6:21 AM, Angie Frazier wrote: > > Is there a way to detect when another application goes into and comes out >> of >> full screen mode? >> Additionally,

Re: compile error when protocol not implemented?

2008-08-14 Thread Michael Ash
On Thu, Aug 14, 2008 at 12:33 AM, Rua Haszard Morris <[EMAIL PROTECTED]> wrote: > I figured this must be the reason.. thanks for the detailed explanation. It > did occur to me when i'd implemented the protocol method but hadn't yet > declared conformance. > > At the moment this is a zero-warnings b

Re: @try @catch

2008-08-14 Thread Michael Ash
On Thu, Aug 14, 2008 at 7:21 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > > On 14 Aug 2008, at 8:58 pm, Georg Seifert wrote: > >> is it recommended to use @try .. @catch blocks as flow control like it is >> used in Python. They say explicitly to use it rather than do a lot of test >> before just try

NSStringDrawing

2008-08-14 Thread MF
Hello! I tried to draw strings in the center of a rectangle. While it's alright to execute the code, and the font is correctly shown, the alignment is wrong. (still on the left side...) the following is the codes for drawing the string. Does anyone know what's wrong with it? or simply drawing st

Re: NSStringDrawing

2008-08-14 Thread Sherm Pendley
On Thu, Aug 14, 2008 at 11:31 AM, MF <[EMAIL PROTECTED]> wrote: > Hello! Howdy. > I tried to draw strings in the center of a rectangle. While it's alright to > execute the code, and the font is correctly shown, the alignment is wrong. > (still on the left side...) ... > [NSDictionary dictionary

NSToolbarItem, textured background & Tiger

2008-08-14 Thread Peter Alshuth
Hi all, I am using a custom panel (NSPanel in a nib file) that I add to the toolbaritem with. The window attribute of this window has the 'texture' flag set. If I hide/show my toolbar the background looks fine under Leopard but apparently the same code doesn't look nice under Tiger (10.4.

Re: Is this a bug, or am I hacking?

2008-08-14 Thread Keary Suska
8/14/08 5:55 AM, also sprach [EMAIL PROTECTED]: > I have some UI that manages a data model that can store two kinds of > objects. The data management of the objects is identical but the > actual objects themselves are fairly distinct. One of the things I'm > trying to do is to allow my data manage

Re: Does NSNotificationCenter have zeroing weak references to observers ?

2008-08-14 Thread Michael Ash
On Wed, Aug 13, 2008 at 11:22 PM, Erik Buck <[EMAIL PROTECTED]> wrote: > In my test > program, how can I tell the difference between an observer for which the > NSNotificationCenter has a strong reference and an observer that is about to > be finalized but hasn't been yet ? Quite simple, actually

cocoa window in carbon?

2008-08-14 Thread Bob Sabiston
Hello, I have a cocoa window that I open and use in my carbon app. I used the apple sample code to do this, and it has worked for years -- using Xcode to compile the cocoa window bundle and Codewarrior to include it in the app. Now I am trying to do the same thing all in Xcode and it i

Re: crashing MacOs application when running a build file

2008-08-14 Thread Nick Zitzmann
On Aug 14, 2008, at 4:06 AM, Y Nguyen wrote: OS Version: 10.5 (Build 9A581) Have you tried upgrading? Version 10.5 is almost a year old; there have been several patches since it came out. 2 _objc_msgSend + 0 (in libobjc.A.dylib) [0x94a386d0] Tr

CGWindowListCopyWindowInfo(), how to pick relevant windows

2008-08-14 Thread Stefan Hafeneger
Hi, I'm using the function CGWindowListCopyWindowInfo() to get a list of all visible windows since I want to do a hit test application wide. So my code is: CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID) Afterwards I ite

AddressBook Record (Group/Person) ID: What's the best way to store ID in a NSDictionary?

2008-08-14 Thread Lee, Frederick
I would like to store references to members of the AddressBook in a NSDictionary. I found that I can use ABRecordGetRecordID to get a unique ID of a particular ABRecord (Group/Person). I want to store it in a NSDictionary for future reference (to access/delete the record from the AddressBook).

Why does Core Data retain an object when one of that object's attributes is changed?

2008-08-14 Thread Marco Masser
Hi! I came across a strange problem today: I have a simple Core Data Application whose managed object model has one entity with one attribute. I set up an AppController class that inserts one instance of that entity's backing class (NSManagedObject) into the MOC: - (void)awakeFromNib {

Re: @try @catch

2008-08-14 Thread Michael Watson
Don't forget that many of Apple's own methods return nil on failure and don't implement an NSError reference mechanism. NSFileManager's - contentsAtPath: method returns either an NSData object on success or nil on failure. -- m-s On 14 Aug, 2008, at 08:45, Uli Kusterer wrote: On 14.08.20

Threading problem using AsyncSocket

2008-08-14 Thread Matthew Youney
Hello list, This is my first attempt at threading with Cocoa, and I am having difficulty with my classes that use AsyncSocket. I am using DetachNewThreadSelector: to detach my ‘worker’ thread, and I am instantiating my class that uses AsyncSocket from within this thread. The problem is that the

Animation layer conflict w/ IKImageBrowserView

2008-08-14 Thread Robert McCullough
Does anyone know why an IKImageBrowserView won't draw if its SUPERVIEW has a Core Animation layer? NOTHING appears in the image browser view -- not even a white background. I'm enabling the CA layer on the superview using "setWantsLayer:YES". As soon as I remove that line, the image browser

Re: @try @catch

2008-08-14 Thread Clark Cox
On Thu, Aug 14, 2008 at 11:38 AM, Michael Watson <[EMAIL PROTECTED]> wrote: > Don't forget that many of Apple's own methods return nil on failure and > don't implement an NSError reference mechanism. NSFileManager's > -contentsAtPath: method returns either an NSData object on success or nil on > fa

Re: Why does Core Data retain an object when one of that object's attributes is changed?

2008-08-14 Thread Ron Lue-Sang
Two words. Un Do. The changes you're making to the managedObject are being recorded for undo. The undo action which coredata puts together behind the scenes for you needs to make sure that the object that will be undone lives for as long as the undo action does. Clear the undo stack or undo

Re: Is this a bug, or am I hacking?

2008-08-14 Thread Allison Newman
Hi Graham, Generally speaking, string constants are only optimised within statically linked binaries. Dynamically linked libraries, such as dll's, so's and Mac bundles will not share constants. Basically, under the hood, when you link together all of your object files at build time, the

Re: Why does Core Data retain an object when one of that object's attributes is changed?

2008-08-14 Thread Marco Masser
Two words. Un Do. But of course. Thanks. I don't know how I could not figure that out, considering that I am disabling & enabling the undo manager and grouping actions together in other parts of my app already. For future reference: http://developer.apple.com/documentation/Cocoa/Conceptua

Re: Opening an external file in a external application

2008-08-14 Thread John Love
workSpace = [NSWorkspace sharedWorkspace]; success = [workSpace openURL:absoluteURL]; activates Excel .. what do I need to add to re-activate my Cocoa app .. "activate me" was terribly easy with AppleScript. NSApplication has methods to active your application. found it ... thanks! [NSA

Re: Opening an external file in a external application

2008-08-14 Thread Nate Weaver
- (BOOL)openURLs:(NSArray *)urls withAppBundleIdentifier:(NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)optionsadditionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifiers:(NSArray **)identifiers Long method name, but you can pass in NSWorkspaceL

RE: Threading problem using AsyncSocket

2008-08-14 Thread Matthew Youney
Actually, I think you are correct, however I am still missing something I have added the code: NSRunLoop *rLoop [NSRunLoop currentRunLoop]; RLoop.run; And still no delegate methods firing. Can you or someone please direct me to a resource or an example of setting up a run loop appropriate

RE: Threading problem using AsyncSocket

2008-08-14 Thread Matthew Youney
Jack, Sorry for the confusion, my e-mail program (outlook) capitalized the R. It is indedd rLoop in my code. Matt -Original Message- From: Jack Carbaugh [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 4:30 PM To: Matthew Youney Subject: Re: Threading problem using AsyncSocket r

Re: Is this a bug, or am I hacking?

2008-08-14 Thread Kyle Sluder
On Thu, Aug 14, 2008 at 7:55 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > Here's the hack. The two object classes define different strings for the > "did change" notification, but my UI management code would prefer not to > care about what actual object type is in use. So I made the literal string >

drawRect is erasing view

2008-08-14 Thread jeffs87
Hi, I'm trying to do some animation where each time drawRect is called it's drawing over what was previously drawn, but something is erasing the view. I've setBackgroundColor for the window to clearColor so it's no longer drawing the default stripes but now it's erasing to black. Any ideas?

Re: CoreData, Object/Array Controllers and KVO

2008-08-14 Thread Jeff Hellman
Ok...So a bit more detail: I am setting the content of the NSObjectController (which is an IBOutlet) to a managed object that I've fetched in the WindowControllerDidLoadNib method of my application. I have one NSTextField in my NIB. If I don't bind a value from the ObjectController to the TextFi

Re: drawRect is erasing view

2008-08-14 Thread Kyle Sluder
On Thu, Aug 14, 2008 at 4:42 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to do some animation where each time drawRect is called it's > drawing over what was previously drawn, but something is erasing the view. > I've setBackgroundColor for the window to clearColor so it's no longer > drawing the

Re: @try @catch

2008-08-14 Thread Uli Kusterer
On 14.08.2008, at 20:38, Michael Watson wrote: On 14 Aug, 2008, at 08:45, Uli Kusterer wrote: On 14.08.2008, at 12:58, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test bef

Re: drawRect is erasing view

2008-08-14 Thread jeffs87
Hi, >Are you calling drawRect yourself? Don't. No I'm calling setNeedsDisplay with a timer. thanks Jeff ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the modera

Re: drawRect is erasing view

2008-08-14 Thread Jonathan Hess
Hey Jeff - The expectation of drawRect is that it will repaint the entire invalid area. I don't think there is a way to do additive drawing on each call to draw rect. If you'd like to re-use and erase portions of the same picture, you could draw to a bitmap context that you keep around and

Re: drawRect is erasing view

2008-08-14 Thread Uli Kusterer
On 14.08.2008, at 22:42, [EMAIL PROTECTED] wrote: I'm trying to do some animation where each time drawRect is called it's drawing over what was previously drawn, but something is erasing the view. I've setBackgroundColor for the window to clearColor so it's no longer drawing the default str

Re: Threading problem using AsyncSocket (Matthew Youney)

2008-08-14 Thread [EMAIL PROTECTED]
I don't know about your threading problem but surely the whole point of AsyncSocket is the Async bit. It is designed to attach itself to the runloop and remove the need for blocking sockets etc on threads. I use AsyncSocket extensively within the main thread and it can handle multiple conne

Re: @try @catch

2008-08-14 Thread Michael Watson
I was only looking at: Which fails to mention the note seen in NSFileManager.h. I'll file a docs bug. Thanks for the

Re: CoreData, Object/Array Controllers and KVO

2008-08-14 Thread Quincey Morris
On Aug 14, 2008, at 13:49, Jeff Hellman wrote: As soon as I bind the text field value to a key path (self.title or just title) in the ObjectController, then the below methods are called for each and every key in my ManagedObject. It sounds like your object is being fetched with its properties

Making a bound view re-read its value

2008-08-14 Thread Markus Spoettl
Hi List, how can I make a view value which is bound to a property manually re-read (or update) the value it displays? The simplified setup is this: I have an object, that stores its values (say a temperature) in Celcius. I also have an application preference that lets the user switch be

NSPanel not receiving events.

2008-08-14 Thread David Springer
Folks, I have an NSPanel (not modal), with one button on it. If I instantiate this panel and let the normal app loop run, everything works fine: clicking the button sends a message to the appropriate object. However, if I try to instantiate this panel, then run [NSRunLoop currentRunLoop] myself

Re: Making a bound view re-read its value

2008-08-14 Thread Kyle Sluder
On Thu, Aug 14, 2008 at 6:21 PM, Markus Spoettl <[EMAIL PROTECTED]> wrote: > So how can I manually make the view update? It seems so simple but I can't > figure out how to do this. I can think of a couple of ways: 1) When your preference changes, post a notification. The views listen for that not

Re: NSPanel not receiving events.

2008-08-14 Thread Kyle Sluder
On Thu, Aug 14, 2008 at 6:25 PM, David Springer <[EMAIL PROTECTED]> wrote: > Seems like I am missing some rudimentary thing relative to the event > loop here. But what? Help? Why would you do this? The run loop is already running. --Kyle Sluder ___

Re: NSPanel not receiving events.

2008-08-14 Thread David Springer
On Thu, Aug 14, 2008 at 4:32 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Thu, Aug 14, 2008 at 6:25 PM, David Springer <[EMAIL PROTECTED]> wrote: >> Seems like I am missing some rudimentary thing relative to the event >> loop here. But what? Help? > > Why would you do this? The run loop is al

RE: Threading problem using AsyncSocket (Matthew Youney)

2008-08-14 Thread Matthew Youney
Jonathan, The reason I need to thread is not anything to do with AsyncSocket, which is an excellent library that does not block. I have several time consuming operations that must occur sequentially. These sequences need to run (start/stop) asynchronous of each other, so I want these to run in se

Re: Making a bound view re-read its value

2008-08-14 Thread Markus Spoettl
On Aug 14, 2008, at 3:28 PM, Kyle Sluder wrote: On Thu, Aug 14, 2008 at 6:21 PM, Markus Spoettl <[EMAIL PROTECTED]> wrote: So how can I manually make the view update? It seems so simple but I can't figure out how to do this. I can think of a couple of ways: 1) When your preference changes, p

Interacting with Spaces

2008-08-14 Thread Justin Patrin
I've been working with the code for Blacktree's Nocturne to make ti work for multiple monitor and with Spaces and have had a lot of luck with parts and nto so much with others. The problem I'm trying to fix currently has to do with switching Spaces. Nocturne puts an overlay window on top of each s

Core Data merging

2008-08-14 Thread Vadim Lozko
I'm having a problem trying to upgrade an existing store of a Core Data database to a newer model that simply has 1 additional attribute property in an entity. This is not a document based app. Also, not sure if this is significant, but the xcdatamodel and all related files are stored in a

Re: Interacting with Spaces

2008-08-14 Thread Chilton Webb
Hi Justin, I think what you're after is this... [[self window] setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; ...That will make your app's window show up on any space when the user returns from 'Spaces space'. -Chilton On Aug 14, 2008, at 5:24 PM, Justin Patrin wrot

Animating a view along a path

2008-08-14 Thread Chilton Webb
Hi, I am using Core Animation Layer Backed NSViews in an app. I'd like to make one animation occur along a path. I know I can do this with just Core Animation Layers, but can I do this with a layer backed NSView ? Anyone have any example code of how to do this? Thank you, -Chilton Webb __

Re: Making a bound view re-read its value

2008-08-14 Thread Ron Lue-Sang
Here's how I look at your situation. Your view is bound to some property. It's job is to listen for KVO notifications and redraw when it gets the KVO notification. That's it. One input. When there's a change on that one input, then redraw. What you have is 2 inputs and only one notificatio

Re: @try @catch

2008-08-14 Thread Andrew Farmer
On 14 Aug 08, at 03:58, Georg Seifert wrote: is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails. Python has been optimized to hand

Re: crashing MacOs application when running a build file

2008-08-14 Thread Andrew Farmer
On 14 Aug 08, at 10:47, Nick Zitzmann wrote: Try building and running your program again with NSZombieEnabled turned on and see what happens. Search the list archives for more information. Note that you shouldn't ship an app with NSZombieEnabled turned on. NSZombieEnabled is a runtime opti

Re: crashing MacOs application when running a build file

2008-08-14 Thread Nick Zitzmann
On Aug 14, 2008, at 6:35 PM, Andrew Farmer wrote: NSZombieEnabled is a runtime option, not a build option. If you look in Foundation/NSDebug.h, you can see there's a way to programmatically turn it on. Nick Zitzmann __

Re: Problem with friend function and gcc 4.2 with objective-c++

2008-08-14 Thread Ken Worley
Just to close this out, it was confirmed that the current behavior in 4.2 is correct. The flag -ffriend-injection can be used to work around it (i.e. retain the old 4.0 behavior), but fixing the code is the better route. Ken On Aug 8, 2008, at 4:41 PM, Ken Worley wrote: Hmmm, no response

Re: Is this a bug, or am I hacking?

2008-08-14 Thread Graham Cox
On 15 Aug 2008, at 5:21 am, Allison Newman wrote: Hi Graham, Generally speaking, string constants are only optimised within statically linked binaries. Dynamically linked libraries, such as dll's, so's and Mac bundles will not share constants. Basically, under the hood, when you link to

Re: Core Data merging

2008-08-14 Thread Steve Steinitz
Hello Vadim, For what its worth, I can't see obvious problems with your code. Myself and others have been stuck at the same, frustrating point. I gave up and resurrected my custom migration code based the samples included with Mac OS X 10.4. But its a pain to maintain and gives me a headac

Re: NSPanel not receiving events.

2008-08-14 Thread Graham Cox
On 15 Aug 2008, at 8:42 am, David Springer wrote: Well, no it isn't. What I want to do is put up this panel (the button is "Cancel") then go off and do a lengthy http request. This all has to look like a synchronous operation to the calling code (legacy reasons). So I do have a reason to wan

Re: @try @catch

2008-08-14 Thread j o a r
On Aug 14, 2008, at 5:34 PM, Andrew Farmer wrote: Python has been optimized to handle exceptions quickly, so it's often faster to catch exceptions than to check for exceptional situations in Python code. Objective-C has not been similarly optimized*, so checking for errors before attemptin

Re: Cocoa and SOAP without WebServicesCore

2008-08-14 Thread Rohan Lloyd
On 13 Aug 2008, at 6:26 AM, patrick machielse wrote: I have a number of projects that require communication with a server using SOAP. Over the last couple of years I've been able to make this work on Mac OS X by leveraging WebServicesCore API, wrapped in Objective-C. Now I find myself ha

Re: @try @catch

2008-08-14 Thread Ken Ferry
On Thu, Aug 14, 2008 at 5:45 AM, Uli Kusterer <[EMAIL PROTECTED]> wrote: > On 14.08.2008, at 12:58, Georg Seifert wrote: >> >> is it recommended to use @try .. @catch blocks as flow control like it is >> used in Python. They say explicitly to use it rather than do a lot of test >> before just try i

Re: Making a bound view re-read its value

2008-08-14 Thread Markus Spoettl
On Aug 14, 2008, at 5:07 PM, Ron Lue-Sang wrote: Here's how I look at your situation. Your view is bound to some property. It's job is to listen for KVO notifications and redraw when it gets the KVO notification. That's it. One input. When there's a change on that one input, then redraw. W

Re: Making a bound view re-read its value

2008-08-14 Thread Ron Lue-Sang
On Aug 14, 2008, at 8:10 PM, Markus Spoettl wrote: On Aug 14, 2008, at 5:07 PM, Ron Lue-Sang wrote: Here's how I look at your situation. Your view is bound to some property. It's job is to listen for KVO notifications and redraw when it gets the KVO notification. That's it. One input. Whe