Re: Cleanup inside a failed init method

2008-12-07 Thread Jens Bauer

Hi Chuck,

On Dec 7, 2008, at 03:00, Charles Steinman wrote:

I'm sorry, I think I misunderstood the following line (due to the way  
we say things in Danish):


Happily, the object should be released anyway if you plan to  
return nil since
otherwise you'll leak a half-initialized object every time the  
method fails.


-I'm actually trying to say the same thing: self should be deallocated/ 
released.



So you should release self and return nil.




-Exactly!


 self=NULL;

...should automatically deallocate the object, and I've never heard  
that it did.


I don't know why you think the object would be dealloced between  
alloc and init. If the if(self) conditional evaluates to nil, that's  
because [super init] returned nil.


Sorry for the noise. =)


Love,
Jens

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


core data + undo + to-many relationship

2008-12-07 Thread John Clayton

Hi everyone

In a core-data model I have a 'layer' which contains a to-many  
relationship to a set of 'effects'.  When I add an effect, everything  
is working well.


When I use Ctrl-Z to have the undo manager undo the addition of the  
effect, then none of my custom accessors are fired (so my GUI doesn't  
react) - although the Effect instance faults and is deallocated (as I  
can see from my logging).


I thought implementing the accessors: addEffectObject: /  
removeEffectObject: and the set variations addEffects: /  
removeEffects: on my Layer core-data class was enough to get the undo  
management to work in this case - or did I misread the core-data docs?


Any hints / tips appreciated.

Thanks
--
John Clayton
Skype: johncclayton




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data + undo + to-many relationship

2008-12-07 Thread John Clayton
OK, I can understand that its more efficient - and have now seen my  
error (I think).


The listener to the remove event is getting fired (via KVO), but all  
of the data on the core-data Effect instances is nil, so my code  
discards the event.  I've got my own uniqueID value set up on the  
Effect, because I wanted to totally avoid any ID changes that occurred  
on the Effect object when it was saved (ie. model ID changes from a  
temp to a permanent id).


Couple of questions:
a) why are all the values nil on my core-data object
b) can I force the objectID to be some permanent value - instead of  
having it change on me?  I need to track the Effect in a dictionary -  
which is why I'm after some kind of stable key that I can use for the  
lookup (normally I'd say the instance ptr is OK, but in core-data two  
instances could point to the same data - theoretically).


Thanks
--
John Clayton
Skype: johncclayton


On 7/12/2008, at 12:48 PM, Mike Abdullah wrote:

Core Data is specifically designed not to invoke accessor methods  
when undoing or redoing changes. For efficiency, it just rolls back  
the state of the objects. It does NOT perform the reverse of your  
original actions. Of course, during an undo/redo, KVO notifications  
are fired, so your UI should be watching out for those in order to  
update itself.


Mike.

On 7 Dec 2008, at 11:42, John Clayton wrote:


Hi everyone

In a core-data model I have a 'layer' which contains a to-many  
relationship to a set of 'effects'.  When I add an effect,  
everything is working well.


When I use Ctrl-Z to have the undo manager undo the addition of the  
effect, then none of my custom accessors are fired (so my GUI  
doesn't react) - although the Effect instance faults and is  
deallocated (as I can see from my logging).


I thought implementing the accessors: addEffectObject: /  
removeEffectObject: and the set variations addEffects: /  
removeEffects: on my Layer core-data class was enough to get the  
undo management to work in this case - or did I misread the core- 
data docs?


Any hints / tips appreciated.

Thanks
--
John Clayton
Skype: johncclayton




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data + undo + to-many relationship

2008-12-07 Thread John Clayton

Actually, extra note here...

Things would probably work OK in my code if the object's values hadn't  
been set to nil by the time I get a willTurnIntoFault message.  Is  
there a way to be notified prior to the event taking place?


Thanks
--
John Clayton
Skype: johncclayton




On 7/12/2008, at 1:13 PM, John Clayton wrote:

OK, I can understand that its more efficient - and have now seen my  
error (I think).


The listener to the remove event is getting fired (via KVO), but all  
of the data on the core-data Effect instances is nil, so my code  
discards the event.  I've got my own uniqueID value set up on the  
Effect, because I wanted to totally avoid any ID changes that  
occurred on the Effect object when it was saved (ie. model ID  
changes from a temp to a permanent id).


Couple of questions:
a) why are all the values nil on my core-data object
b) can I force the objectID to be some permanent value - instead of  
having it change on me?  I need to track the Effect in a dictionary  
- which is why I'm after some kind of stable key that I can use for  
the lookup (normally I'd say the instance ptr is OK, but in core- 
data two instances could point to the same data - theoretically).


Thanks
--
John Clayton
Skype: johncclayton


On 7/12/2008, at 12:48 PM, Mike Abdullah wrote:

Core Data is specifically designed not to invoke accessor methods  
when undoing or redoing changes. For efficiency, it just rolls back  
the state of the objects. It does NOT perform the reverse of your  
original actions. Of course, during an undo/redo, KVO notifications  
are fired, so your UI should be watching out for those in order to  
update itself.


Mike.

On 7 Dec 2008, at 11:42, John Clayton wrote:


Hi everyone

In a core-data model I have a 'layer' which contains a to-many  
relationship to a set of 'effects'.  When I add an effect,  
everything is working well.


When I use Ctrl-Z to have the undo manager undo the addition of  
the effect, then none of my custom accessors are fired (so my GUI  
doesn't react) - although the Effect instance faults and is  
deallocated (as I can see from my logging).


I thought implementing the accessors: addEffectObject: /  
removeEffectObject: and the set variations addEffects: /  
removeEffects: on my Layer core-data class was enough to get the  
undo management to work in this case - or did I misread the core- 
data docs?


Any hints / tips appreciated.

Thanks
--
John Clayton
Skype: johncclayton




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/john_clayton 
%40mac.com


This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


core data + undo + accessors

2008-12-07 Thread John Clayton

Hi all,

Tell me if I'm missing the point please.

With core data and undo, apparently the undo system + core data (not  
sure if its a combination of them both), do NOT fire accessor methods  
on core-data objects when the undo manager changes the state of the  
object model.


For example (outlined in a previous email), I have a 'Layer' object  
with many 'Effects'.  There is a to-many relationship from the layer  
to the effects instance called, surprise surprise, 'effects'.


If I create an Effect instance - the accessor methods are fired.  If I  
then hit Ctrl-Z to undo that, none of the accessor methods are fired,  
only KVO notifications are sent.


Doesn't this behaviour entirely invalidate the idea of putting  
business/program logic into your core-data derived class accessor  
methods?


I had thought that it was sensible to derive classes from my core-data  
objects, and then put logic in them - e.g. when an object is added  
into a relationship, I can then begin listening for changes on my  
parent for example - but the fact that none of my accessors are called  
when the undo manager begins modifying my object graph means that it  
is *impossible* to rely on using custom accessors because they are not  
always called when the model is changed.


This in turn leads me to believe that I should only use core-data for  
pure data storage, and nothing else.  And that I should never put any  
model-changing logic into any custom accessors on my NSManagedObject  
accessors. Further, the only reason I can see to have custom accessors  
would be to provide type safety and an easier programming interface to  
the core-data based API that I am writing.


Have a missed the point?  Are there other posts / articles you think  
could help me?


Thanks
--
John Clayton
Skype: johncclayton




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data + undo + to-many relationship

2008-12-07 Thread Mike Abdullah
Core Data is specifically designed not to invoke accessor methods when  
undoing or redoing changes. For efficiency, it just rolls back the  
state of the objects. It does NOT perform the reverse of your original  
actions. Of course, during an undo/redo, KVO notifications are fired,  
so your UI should be watching out for those in order to update itself.


Mike.

On 7 Dec 2008, at 11:42, John Clayton wrote:


Hi everyone

In a core-data model I have a 'layer' which contains a to-many  
relationship to a set of 'effects'.  When I add an effect,  
everything is working well.


When I use Ctrl-Z to have the undo manager undo the addition of the  
effect, then none of my custom accessors are fired (so my GUI  
doesn't react) - although the Effect instance faults and is  
deallocated (as I can see from my logging).


I thought implementing the accessors: addEffectObject: /  
removeEffectObject: and the set variations addEffects: /  
removeEffects: on my Layer core-data class was enough to get the  
undo management to work in this case - or did I misread the core- 
data docs?


Any hints / tips appreciated.

Thanks
--
John Clayton
Skype: johncclayton




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Fix Populated NSMenu Of Files, Folders And Their Respected Images

2008-12-07 Thread Chunk 1978
nevermind, i managed to get it right... not sure how efficient this
code is, but at least it works :)

-=-=-=-=-

@interface AppController : NSObject
{
IBOutlet NSMenu *theMenu;
}

- (void)launchFileOrFolder:(id)sender;

@end

-=-=-=-=-=-

#import "AppController.h"


@implementation AppController


- (void)awakeFromNib
{
NSMenu *desktopMenu = [[NSMenu alloc] initWithTitle:@""];
NSMenuItem *desktopItem = [[NSMenuItem alloc] initWithTitle:@"Desktop
Files" action:nil keyEquivalent:@""];
[desktopItem setSubmenu:desktopMenu];

NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *desktopDirectory = [@"~/Desktop" 
stringByExpandingTildeInPath];
NSDirectoryEnumerator *directoryCount = [fileManager
enumeratorAtPath:desktopDirectory];
NSDirectoryEnumerator *directoryEnumerator = [fileManager
enumeratorAtPath:desktopDirectory];
NSString *fileOrFolder;

int hiddenFIles = 0;
while ((fileOrFolder = [directoryCount nextObject]))
{
if ([fileOrFolder hasPrefix:@"."])
{
hiddenFIles++;
}
}
NSLog(@"hiddenfiles = %d", hiddenFIles);

NSArray *directoryContents = [fileManager
directoryContentsAtPath:desktopDirectory];
int allFiles = [directoryContents count];
NSLog(@"totalfiles = %d", allFiles);


if ((allFiles - hiddenFIles) == 0)
{
NSLog(@"directory contains only hidden files");
NSMenuItem *noFilesItem = [[NSMenuItem alloc] 
initWithTitle:@"Empty"
action:nil keyEquivalent:@""];
[desktopMenu addItem:noFilesItem];
[noFilesItem release];

  //or alternatively just disable the item
  //with this line of code:  [desktopItem setEnabled:NO];

}
else
{
while ((fileOrFolder = [directoryEnumerator nextObject]))
{
//ignore invisible files
if ([fileOrFolder hasPrefix:@"."])
{
continue;
}

[directoryEnumerator skipDescendents];

NSMenuItem *desktopItems = [[NSMenuItem alloc]
initWithTitle:fileOrFolder action:@selector(launchFileOrFolder:)
keyEquivalent:@""];
[desktopItems setTarget:self];
[desktopItems setRepresentedObject:[desktopDirectory
stringByAppendingPathComponent:fileOrFolder]];

NSImage *fileOrFolderIcons = [[NSWorkspace 
sharedWorkspace]
iconForFile:[desktopDirectory
stringByAppendingPathComponent:fileOrFolder]];
[fileOrFolderIcons setScalesWhenResized:YES];
NSSize mySize; mySize.width=16; mySize.height=16;
[fileOrFolderIcons setSize:mySize];
[desktopItems setImage:fileOrFolderIcons];  


[desktopMenu addItem:desktopItems];
[desktopItems release];
}
}
[theMenu insertItem:desktopItem atIndex:1];
[desktopMenu release];
[desktopItem release];
}

- (void)launchFileOrFolder:(id)sender
{
NSString *filePath = [sender representedObject];
[[NSWorkspace sharedWorkspace] openFile:filePath];
}

- (void)dealloc
{
[super dealloc];
}

@end

-=-=-=-=-

On Sat, Dec 6, 2008 at 6:01 AM, Chunk 1978 <[EMAIL PROTECTED]> wrote:
> thanks ashley, you cleared up a lot for me. however, i'm now presented
> with two (seemingly) small issues.  the first is determining whether
> the directory is empty.  i've added an array with
> directoryContentsAtPath, and an if statement counting the array, but
> it doesn't seem to work.
>
> second, how is it possible to change the size of the iconForFile(s)
> using setSize:NSMakeSize(16, 16), or any other way?
>
> my updated code follows:
>
> -=-=-=-=-
>
> - (void)awakeFromNib
>{
>NSMenu *desktopMenu = [[NSMenu alloc] initWithTitle:@""];
>NSMenuItem *desktopItem = [[NSMenuItem alloc] initWithTitle:@"Desktop
> Files" action:nil keyEquivalent:@""];
>[desktopItem setSubmenu:desktopMenu];
>
>NSFileManager *fileManager = [NSFileManager defaultManager];
>NSString *desktopDirectory = [@"~/Desktop/9" 
> stringByExpandingTildeInPath];
>NSDirectoryEnumerator *directoryEnumerator = [fileManager
> enumeratorAtPath:desktopDirectory];
>NSString *fileOrFolder;
>NSArray *theFolderContents = [fileManager
> dir

Re: core data, refreshObject, multiple threads

2008-12-07 Thread Chris Idou
I've got fairly modest requirements, in so far as I'm using the XML store, and 
I'm happy to refresh the entire object graph of my worker thread when there is 
a change. So I've even tried [managedObjectContext reset] and querying from the 
beginning, but that doesn't seem to work either.

I'm starting to think in terms of rebuilding the entire 
PersistentStoreCoordinator / ManagedObjectContext stack as a way to get new 
data. But a question I've had in the back of my mind for some time now, is 
there is no obvious way to close a NSPersistentStoreCoordinator or close a 
NSManagedObjectContext. Does one simply dealloc them, or in the case of garbage 
collection, just throw them away? Usually database type interfaces require some 
kind of close API


--- On Fri, 5/12/08, Steve Steinitz <[EMAIL PROTECTED]> wrote:

> From: Steve Steinitz <[EMAIL PROTECTED]>
> Subject: Re: core data, refreshObject, multiple threads
> To: cocoa-dev@lists.apple.com
> Cc: [EMAIL PROTECTED]
> Received: Friday, 5 December, 2008, 4:04 PM
> Hi Chris,
> 
> On 5/12/08, Chris Idou <[EMAIL PROTECTED]> wrote:
> 
> > I've got a main thread that handles a gui, and a
> worker thread with its own persistentStoreCoordinator and
> managedObjectContext. The gui notifies the worker thread of
> a change, passing it an objectID, and the worker thread gets
> the object, and other objects it is connected to, and calls
> [managedObjectContext refreshObject: on them.
> > 
> > But they don't seem to get an updated object.
> I'm using the XML store. The store is saved, I've
> checked that the new values are in the XML. But refresh
> doesn't seem to update anything. Is there any trick to
> it?
> 
> Yes, I believe there are some tricks and also possibly some
> cases where it just won't update anything.  Ben Trumbull
> was kind enough to contribute to a similar question I posted
> back in October.  Here is the thread:
> http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg19221.html
> 
> In particular see his comment about the issue with small
> staleness intervals.  At the time, I thought that had solved
> my problem but I've since discovered other scenarios
> where refreshObject doesn't update anything.  Its
> possibly more likely to occur after optimistic locking
> errors (which, so far, I am unable to avoid).  But I
> haven't yet demonstrated that with any degree of
> scientific method.  I'm going to put it under the
> microscope again over the Christmas holidays.  Feel free to
> stay in touch about it.
> 
> Best regards and best of luck,
> 
> Steve


  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data, refreshObject, multiple threads

2008-12-07 Thread John Clayton

Chris,

Can you make use of the - (void)refreshObject:(NSManagedObject  
*)object mergeChanges:(BOOL)flag method on NSManagedObjectContext?


Thanks
--
John Clayton
Skype: johncclayton




On 7/12/2008, at 12:22 PM, Chris Idou wrote:

I've got fairly modest requirements, in so far as I'm using the XML  
store, and I'm happy to refresh the entire object graph of my worker  
thread when there is a change. So I've even tried  
[managedObjectContext reset] and querying from the beginning, but  
that doesn't seem to work either.


I'm starting to think in terms of rebuilding the entire  
PersistentStoreCoordinator / ManagedObjectContext stack as a way to  
get new data. But a question I've had in the back of my mind for  
some time now, is there is no obvious way to close a  
NSPersistentStoreCoordinator or close a NSManagedObjectContext. Does  
one simply dealloc them, or in the case of garbage collection, just  
throw them away? Usually database type interfaces require some kind  
of close API



--- On Fri, 5/12/08, Steve Steinitz <[EMAIL PROTECTED]>  
wrote:



From: Steve Steinitz <[EMAIL PROTECTED]>
Subject: Re: core data, refreshObject, multiple threads
To: cocoa-dev@lists.apple.com
Cc: [EMAIL PROTECTED]
Received: Friday, 5 December, 2008, 4:04 PM
Hi Chris,

On 5/12/08, Chris Idou <[EMAIL PROTECTED]> wrote:


I've got a main thread that handles a gui, and a

worker thread with its own persistentStoreCoordinator and
managedObjectContext. The gui notifies the worker thread of
a change, passing it an objectID, and the worker thread gets
the object, and other objects it is connected to, and calls
[managedObjectContext refreshObject: on them.


But they don't seem to get an updated object.

I'm using the XML store. The store is saved, I've
checked that the new values are in the XML. But refresh
doesn't seem to update anything. Is there any trick to
it?

Yes, I believe there are some tricks and also possibly some
cases where it just won't update anything.  Ben Trumbull
was kind enough to contribute to a similar question I posted
back in October.  Here is the thread:
http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg19221.html

In particular see his comment about the issue with small
staleness intervals.  At the time, I thought that had solved
my problem but I've since discovered other scenarios
where refreshObject doesn't update anything.  Its
possibly more likely to occur after optimistic locking
errors (which, so far, I am unable to avoid).  But I
haven't yet demonstrated that with any degree of
scientific method.  I'm going to put it under the
microscope again over the Christmas holidays.  Feel free to
stay in touch about it.

Best regards and best of luck,

Steve



 Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/john_clayton 
%40mac.com


This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Debugger launched after closing the app window.

2008-12-07 Thread Gustavo Pizano

Hello Everybody.

I dunno why, but I have been looking into the the list for the answer  
and hadn't been able to find the solution. Sometimes when I close the  
main window of the app, the debugger its loaded,  I have been checking  
my code looking for unreleased objects thinking this might be the  
cause, can some body explaing me why is this happening. It happens  
only if I close the main window from the red X button,  it doesn't  
happens if I go to the app menu and click on the Quit label.



Thanks

Best regards


Gustavo

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Access to this item is restricted?

2008-12-07 Thread Robert Nicholson
So, in KeyChain Access if you press "Deny" it permanently marks the keychain
such that any access to items in it are restricted?
Last night I was helping my wife setup keychains and it seems there was a
time when the Deny button was hit. Either when trying to access a single
item or the actual password for the login keychain.

Now it seems access is restricted to all items in her login keychain.

Is there a way to correct that?

The keychain services API doesn't elaborate on what it necessary when you've
got yourself in this state and it's not clear which object the access is
restricted to but it seems either it's the entire login keychain or all
items within.
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Debugger launched after closing the app window.

2008-12-07 Thread Gustavo Pizano

Hi Tim.

the overview, I have the main window which has 3 Custom views, 2 of  
them are subclasses of a NSView.
What Im doing, after reading the memory management rules, is that for  
all the instances variables which are pointers and which Im allocating  
memory for them in some part of the code, Im releasing  them on the  
dealloc method, but never assigning them to nil after. But it what Im  
thinking about is that this wasn't happening before, and Im going back  
to were I was , commenting the new stuff I added and the problem  
persist.


Im kinda new to cocoa development but let me know what else  
specifically can I provide you to help me solve this issue.


Gustavo.

Im gonna try assigning the IV to nil.
On 7.12.2008, at 15:13, Tim Isted wrote:


Hi Gustavo,

One suggestion - are you using a custom view or have you got some  
bindings set up?


It might be that something in your code is trying to access an  
object that has been released... If you use the dealloc method on a  
window or in custom objects etc to release attributes on a window  
controller/object, particularly if a window is closed, make sure you  
then set the pointer to nil - eg:


- (void)dealloc
{
[_someObject release];
_someObject = nil;
}

Otherwise, perhaps you could give us a little more information about  
your code - ie are you using Core Data/window controllers/a document- 
based app etc?


Hope this might be a first step to solving the problem!
Tim


--
http://www.timisted.net
Twitter: timisted

Are you registered for MacDev 2009 Europe?
The conference for Macintosh Developers in Europe, taking place from  
April 15th to April 17th, 2009.

For details and to register, visit: http://www.macdeveurope.com
Christmas Special for December - register and receive over £40-worth  
of developer software!



On 7 Dec 2008, at 13:47, Gustavo Pizano wrote:


Hello Everybody.

I dunno why, but I have been looking into the the list for the  
answer and hadn't been able to find the solution. Sometimes when I  
close the main window of the app, the debugger its loaded,  I have  
been checking my code looking for unreleased objects thinking this  
might be the cause, can some body explaing me why is this  
happening. It happens only if I close the main window from the red  
X button,  it doesn't happens if I go to the app menu and click on  
the Quit label.



Thanks

Best regards


Gustavo

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40timisted.com

This email sent to [EMAIL PROTECTED]




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Debugger launched after closing the app window.

2008-12-07 Thread Gustavo Pizano
Hi again me, I forgot to tell you that in my "business" controller,  
the one in charge of handling the operations between the 2 views I  
implemented a singleton pattern, but dunno if I should release the  
static variable I use to create the singleton.


The app is a Naval Battle gameboard. so the 2 vies is one for the  
player and one for the opponent (which so far is the computer), later  
on will be another player over the network.


THX

G


On 7.12.2008, at 15:41, Gustavo Pizano wrote:


Hi Tim.

the overview, I have the main window which has 3 Custom views, 2 of  
them are subclasses of a NSView.
What Im doing, after reading the memory management rules, is that  
for all the instances variables which are pointers and which Im  
allocating memory for them in some part of the code, Im releasing   
them on the dealloc method, but never assigning them to nil after.  
But it what Im thinking about is that this wasn't happening before,  
and Im going back to were I was , commenting the new stuff I added  
and the problem persist.


Im kinda new to cocoa development but let me know what else  
specifically can I provide you to help me solve this issue.


Gustavo.

Im gonna try assigning the IV to nil.
On 7.12.2008, at 15:13, Tim Isted wrote:


Hi Gustavo,

One suggestion - are you using a custom view or have you got some  
bindings set up?


It might be that something in your code is trying to access an  
object that has been released... If you use the dealloc method on a  
window or in custom objects etc to release attributes on a window  
controller/object, particularly if a window is closed, make sure  
you then set the pointer to nil - eg:


- (void)dealloc
{
[_someObject release];
_someObject = nil;
}

Otherwise, perhaps you could give us a little more information  
about your code - ie are you using Core Data/window controllers/a  
document-based app etc?


Hope this might be a first step to solving the problem!
Tim


--
http://www.timisted.net
Twitter: timisted

Are you registered for MacDev 2009 Europe?
The conference for Macintosh Developers in Europe, taking place  
from April 15th to April 17th, 2009.

For details and to register, visit: http://www.macdeveurope.com
Christmas Special for December - register and receive over £40- 
worth of developer software!



On 7 Dec 2008, at 13:47, Gustavo Pizano wrote:


Hello Everybody.

I dunno why, but I have been looking into the the list for the  
answer and hadn't been able to find the solution. Sometimes when I  
close the main window of the app, the debugger its loaded,  I have  
been checking my code looking for unreleased objects thinking this  
might be the cause, can some body explaing me why is this  
happening. It happens only if I close the main window from the red  
X button,  it doesn't happens if I go to the app menu and click on  
the Quit label.



Thanks

Best regards


Gustavo

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40timisted.com

This email sent to [EMAIL PROTECTED]






___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


How to disable the transparency in dropdown sheets?

2008-12-07 Thread Arun
Hi

I am displaying a window using [NSApp beginsheet] to display data to users
in My App.
By default the drop down sheet is transparent. How to disable transparency
in the sheet?

Thanks
Arun KA
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSArrayController setSelectedObjects: not working with newly created objects

2008-12-07 Thread Matteo Manferdini
Hi everyone,
I stumbled into another weird behaviour of Cocoa.
If I try to set as selected newly created objects into an
NSArrayController, the method does not work and the controller loses
its selection. The array controller is bound to a core data managed
object context. Here there is the code:


IBOutlet NSArrayController *arrayController;

/***/

NSManagedObject *newObject = [arrayController newObject];
[arrayController setSelectedObjects:[NSArray arrayWithObject:newObject]];


If I call [arrayController selectedObject] just before these two
lines, the array returned contains the actual selection, but if I call
it just after them, it returns an empty array.

I use setSelectedObjects: in another place of my code, on the same
array controller, passing the very same parameter, and there it works
perfectly. So it makes me guess that it does not work on just created
objects, but I wonder why.

I also tried to isolate the above code in an ad hoc project with just
those lines, just to make sure it was not some bug of mine, and it
still does not work.

Anyone has any hint?
Should I file a radar?
Thank you very much.
Cheers.

Matteo Manferdini
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSArrayController setSelectedObjects: not working with newly created objects

2008-12-07 Thread mmalcolm crawford


On Dec 7, 2008, at 8:29 AM, Matteo Manferdini wrote:


NSManagedObject *newObject = [arrayController newObject];
[arrayController setSelectedObjects:[NSArray  
arrayWithObject:newObject]];


If I call [arrayController selectedObject] just before these two
lines, the array returned contains the actual selection, but if I call
it just after them, it returns an empty array.

I'm not sure why this is "weird"? -- it's certainly not a bug, it's  
behaving correctly.


newObject doesn't insert the object into the array.

Assuming that you have automatically prepares content set for the  
array controller, then newObject will be added later when the array  
controller receives an  
NSManagedObjectContextObjectsDidChangeNotification notification:


- (void)setAutomaticallyPreparesContent:(BOOL)flag

"If flag is YES and a managed object context is set, the initial  
content is fetched from the managed object context using the current  
fetch predicate. The controller also registers as an observer of its  
managed object context. It then tracks insertions and deletions of its  
entity using the context's notifications, and updates its content  
array as appropriate."



So when you invoke 'setSelectedObjects:[NSArray  
arrayWithObject:newObject]', newObject isn't in the array...



If you want to immediately insert and select the new object, then do  
so, e.g. per 


- (IBAction)newAtTop:sender {

   id newObject = [arrayController newObject];
   [arrayController insertObject:newObject atArrangedObjectIndex:0];
   [tableView editColumn:0 row:0 withEvent:nil select:YES];
   [newObject release];
}


mmalc

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to disable the transparency in dropdown sheets?

2008-12-07 Thread Mike Abdullah
Why do you want to do this? Why do you want your app to be different  
to all others on the system? That said, NSWindow does have a - 
setAlphaValue: method, does setting that before or after starting the  
sheet achieve anything?


Mike.

On 7 Dec 2008, at 15:41, Arun wrote:


Hi

I am displaying a window using [NSApp beginsheet] to display data to  
users

in My App.
By default the drop down sheet is transparent. How to disable  
transparency

in the sheet?

Thanks
Arun KA
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to disable the transparency in dropdown sheets?

2008-12-07 Thread Chunk 1978
it's also possible to simply fill your window (that is your sheet)
with a colored view with alpha:1.0...

On Sun, Dec 7, 2008 at 12:21 PM, Mike Abdullah
<[EMAIL PROTECTED]> wrote:
> Why do you want to do this? Why do you want your app to be different to all
> others on the system? That said, NSWindow does have a -setAlphaValue:
> method, does setting that before or after starting the sheet achieve
> anything?
>
> Mike.
>
> On 7 Dec 2008, at 15:41, Arun wrote:
>
>> Hi
>>
>> I am displaying a window using [NSApp beginsheet] to display data to users
>> in My App.
>> By default the drop down sheet is transparent. How to disable transparency
>> in the sheet?
>>
>> Thanks
>> Arun KA
>> ___
>>
>> 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 Subscription:
>>
>> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net
>>
>> This email sent to [EMAIL PROTECTED]
>
> ___
>
> 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 Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


CALayer Mask

2008-12-07 Thread Gordon Apple
Either the mask setting of CALayer is the most ill-behaved item in Cocoa
or I totally don't understand it.  I suspect the latter.  Although I have
successfully used a mask layer in a CALayer (mainly QTMovieLayer and
QTCapture Layer) when first creating the CALayer, changing the transform
(rotations, flips, etc.) to the CAlayer has unpredictable results for the
mask until the original transform is re-established.  I've tried applying
the same transform to the mask and a few other things to no avail.  I've
also tried re-computing and resetting the mask each time the transform is
changed.

What space does the mask reside in?  The CALayer's bounds?  It's
superlayer?

How exactly does the mask relate the the containing CALayer?  It is a
sublayer of the CALayer?

As far as I can tell, there is no documentation on any of this and the
sample code does not help.  Any help here would be appreciated.




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


3-float struct?

2008-12-07 Thread Dave DeLong

Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3 float  
members.  The person asking me was looking for a struct that could  
contain a 3 dimensional point (so like a CG- or NSPoint, but with a z  
member).


My quick searches didn't reveal anything, but I was wondering if any  
of you knew of one.


Thanks,

Dave
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Window moving during drag and drop operation, (newbiew question)

2008-12-07 Thread Jesper Storm Bache

Are you using a "metal" style window (NSTexturedBackgroundWindowMask).
If so, then you will want to look into how [NSView  
mouseDownCanMoveWindow] works (try overriding it and return NO)


Jesper Storm Bache


On Dec 6, 2008, at 6:39 AM, Gustavo Pizano wrote:



On 6.12.2008, at 12:20, Gustavo Pizano wrote:

Hi all, its me again. well Im implementing the drag-n-drop op for my
app. in the Soruce view I have different layers, im checking which one
of those was clicked and then commence the drag and drop, but the
funny part is that ithe main window ts moving. Any clues why is this
happening..
thsi is my code Im using

-(void)mouseDragged:(NSEvent *)event
{
   NSPoint down = [mouseDownEvent locationInWindow];
   NSPoint drag = [event locationInWindow];

   float distance = hypot(down.x - drag.x , down.y - drag.y);
   if(distance < 3){
   return;
   }

   //NSEnumerator * e = [shipsLayers objectEnumerator];
   NSPoint auxPoint;
   auxPoint = [self convertPoint:[mouseDownEvent locationInWindow]
fromView:nil];
   CGRect r;
   CALayer * actualLayer = [CALayer layer];
   BOOL inRect = NO;
   int i;
   for (i =0;i < [shipsLayers  count]; i++){
   actualLayer = [shipsLayers objectAtIndex:i];
   r = [actualLayer frame];
   if(NSPointInRect(auxPoint,NSRectFromCGRect(r))){
   inRect= YES;
   break;
   }
   }

   if(!inRect)
   return; //if the drag wasn't made on any of the  
layers containning

ships

   //Create the image that will be dragged
   NSSize s;
   s = NSSizeFromCGSize(actualLayer.frame.size);
   //Create a rect in which the image will be drawn
   NSRect imageBounds;
   imageBounds.origin=NSZeroPoint;
   imageBounds.size = s;
   //try out
   CGImageRef cgImage =  (CGImageRef)actualLayer.contents;
   NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc]
initWithCGImage:cgImage];
   // Create an NSImage and add the bitmap rep to it...
   NSImage *image = [[NSImage alloc] init];
   [image addRepresentation:bitmapRep];
   [bitmapRep release];

   // to here

   //draw the image
   [image lockFocus];
   NSRect drawingRect =  imageBounds;
   [image drawInRect:drawingRect fromRect:imageBounds
operation:NSCompositeSourceOver fraction:0.8];
   [image unlockFocus];

   //get the location of the mouse
   auxPoint.x = auxPoint.x - s.width/2;
   auxPoint.y = auxPoint.y - s.height/2;

   //Get the Pasteboard
   NSPasteboard * pb = [NSPasteboard  
pasteboardWithName:NSDragPboard];


   //put the image on the pb, first delcare the types then copy  
the

image into the pb
   [pb declareTypes:[NSArray
arrayWithObjects:NSTIFFPboardType,NSPostScriptPboardType,nil]
owner:self];
   //put the image into the pasteboard
   [pb setData:[NSKeyedArchiver archivedDataWithRootObject:image]
forType:NSTIFFPboardType];

   //start the drag
   [self dragImage:image at:auxPoint offset:NSMakeSize(0, 0)
event:mouseDownEvent pasteboard:pb source:self slideBack:YES];
   [image release];

}

Thanks  a lot guys for your help

Gustavo


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Window moving during drag and drop operation, (newbiew question)

2008-12-07 Thread Gustavo Pizano
In fact yes I was using that NSWindow interesting.. thanks for the  
help, I was looking for something like that, but I wouldn't  imagine  
it was such a method.


thanks a lot


Gus

On 7.12.2008, at 19:48, Jesper Storm Bache wrote:


Are you using a "metal" style window (NSTexturedBackgroundWindowMask).
If so, then you will want to look into how [NSView  
mouseDownCanMoveWindow] works (try overriding it and return NO)


Jesper Storm Bache


On Dec 6, 2008, at 6:39 AM, Gustavo Pizano wrote:



On 6.12.2008, at 12:20, Gustavo Pizano wrote:

Hi all, its me again. well Im implementing the drag-n-drop op for my
app. in the Soruce view I have different layers, im checking which  
one

of those was clicked and then commence the drag and drop, but the
funny part is that ithe main window ts moving. Any clues why is this
happening..
thsi is my code Im using

-(void)mouseDragged:(NSEvent *)event
{
  NSPoint down = [mouseDownEvent locationInWindow];
  NSPoint drag = [event locationInWindow];

  float distance = hypot(down.x - drag.x , down.y - drag.y);
  if(distance < 3){
  return;
  }

  //NSEnumerator * e = [shipsLayers objectEnumerator];
  NSPoint auxPoint;
  auxPoint = [self convertPoint:[mouseDownEvent locationInWindow]
fromView:nil];
  CGRect r;
  CALayer * actualLayer = [CALayer layer];
  BOOL inRect = NO;
  int i;
  for (i =0;i < [shipsLayers  count]; i++){
  actualLayer = [shipsLayers objectAtIndex:i];
  r = [actualLayer frame];
  if(NSPointInRect(auxPoint,NSRectFromCGRect(r))){
  inRect= YES;
  break;
  }
  }

  if(!inRect)
  return; //if the drag wasn't made on any of the  
layers containning

ships

  //Create the image that will be dragged
  NSSize s;
  s = NSSizeFromCGSize(actualLayer.frame.size);
  //Create a rect in which the image will be drawn
  NSRect imageBounds;
  imageBounds.origin=NSZeroPoint;
  imageBounds.size = s;
  //try out
  CGImageRef cgImage =  (CGImageRef)actualLayer.contents;
  NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc]
initWithCGImage:cgImage];
  // Create an NSImage and add the bitmap rep to it...
  NSImage *image = [[NSImage alloc] init];
  [image addRepresentation:bitmapRep];
  [bitmapRep release];

  // to here

  //draw the image
  [image lockFocus];
  NSRect drawingRect =  imageBounds;
  [image drawInRect:drawingRect fromRect:imageBounds
operation:NSCompositeSourceOver fraction:0.8];
  [image unlockFocus];

  //get the location of the mouse
  auxPoint.x = auxPoint.x - s.width/2;
  auxPoint.y = auxPoint.y - s.height/2;

  //Get the Pasteboard
  NSPasteboard * pb = [NSPasteboard  
pasteboardWithName:NSDragPboard];


  //put the image on the pb, first delcare the types then copy  
the

image into the pb
  [pb declareTypes:[NSArray
arrayWithObjects:NSTIFFPboardType,NSPostScriptPboardType,nil]
owner:self];
  //put the image into the pasteboard
  [pb setData:[NSKeyedArchiver archivedDataWithRootObject:image]
forType:NSTIFFPboardType];

  //start the drag
  [self dragImage:image at:auxPoint offset:NSMakeSize(0, 0)
event:mouseDownEvent pasteboard:pb source:self slideBack:YES];
  [image release];

}

Thanks  a lot guys for your help

Gustavo


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com

This email sent to [EMAIL PROTECTED]




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?

2008-12-07 Thread Michael A. Crawford


Well, I don't know if you guys are still listening on this thread but,  
for the record, I did put Graham's suggestion into practice,  
immediately.  It was fast, easy, and simple to modify when I wanted to  
tweak the behavior to use float values instead of integers.  Thanks,  
Graham.


After going back and reading the entire thread (just now), I have  
decided to remove Graham's solution and go with the recommendation,  
from Michael and Bill, to use inheritance instead.  I also appreciated  
Sherm's suggestion as a good solution to consider in the future any  
time I need to do something like this and decide to use categories,  
but want to be more intelligent about it.  I don't have a lot of  
experience with categories and I'm not sure that, if Apple did make  
changes and code broke, I would remember or recognize that this  
category might be the culprit.  The problem is that I'm inexperienced  
and new to a lot of the deeper concepts in Objective-C, I barely  
understand how categories do what they do.  I'm a C++ guy.  I'm sure  
the underlying details are similar but in all honestly don't want to  
waste my time trying to master this.  I just want to finish my  
application.


Thanks again, for all the great input and the lively debate.

-Michael

On Nov 27, 2008, at 9:37 PM, Sherm Pendley wrote:


On Nov 27, 2008, at 7:24 PM, Graham Cox wrote:

Yep, that's a potentially more serious issue. It would be nice if a  
category had a way to check for an existing implementation and  
quietly no-op itself. Just checking respondsToSelector: doesn't  
work of course, always returning YES.


Build your category methods into a loadable bundle. Check with  
respondsToSelector:, and if it returns NO, load the bundle.


sherm--



-Michael
--
There are two ways of constructing a software design. One way is to  
make it so simple that there are obviously no deficiencies.
And the other way is to make it so complicated that there are no  
obvious deficiencies.


-- C.A.R. Hoare




smime.p7s
Description: S/MIME cryptographic signature
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

NSPredicateEditor and date comparisons

2008-12-07 Thread Josh Abernathy

Hi all,

In my application, users have the option of comparing to a date in an  
NSPredicateEditor. For the NSDates it is comparing against, only the  
date is important; time doesn't matter.


The interesting thing I found about NSPredicateEditor is the  
NSTimeInterval it compares my NSDates to has the time set to  
13:41:40.  That means my NSDates with the default 12:00:00 time don't  
match an "is" predicate. It's not a big deal because I can just change  
my NSDate's time to 13:41:40 to fix the problem.


But what I'm wondering is if this is guaranteed to always be true. I  
couldn't find it anywhere in the documentation.


Thanks,
Josh
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread Benjamin Dobson

On 7 Dec 2008, at 18:46:18, Dave DeLong wrote:


Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3 float  
members.  The person asking me was looking for a struct that could  
contain a 3 dimensional point (so like a CG- or NSPoint, but with a  
z member).


My quick searches didn't reveal anything, but I was wondering if any  
of you knew of one.


Thanks,

Dave


Surely you could define one of your own?
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread Dave DeLong
Of course you could.  But it's not uncommon to need a 3 dimensional  
coordinate, so we were just wondering if there's one built in.   
Obviously 2 dimensional coordinates are everywhere, and as such the  
appropriate struct is included in the frameworks.  We were thinking  
that with 3 dimensional graphics becoming more and more common, there  
might be one built in already.


Dave

On 7 Dec, 2008, at 1:11 PM, Benjamin Dobson wrote:


On 7 Dec 2008, at 18:46:18, Dave DeLong wrote:


Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3 float  
members.  The person asking me was looking for a struct that could  
contain a 3 dimensional point (so like a CG- or NSPoint, but with a  
z member).


My quick searches didn't reveal anything, but I was wondering if  
any of you knew of one.


Thanks,

Dave


Surely you could define one of your own?

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Debugger launched after closing the app window.

2008-12-07 Thread Michael Ash
On Sun, Dec 7, 2008 at 8:47 AM, Gustavo Pizano
<[EMAIL PROTECTED]> wrote:
> Hello Everybody.
>
> I dunno why, but I have been looking into the the list for the answer and
> hadn't been able to find the solution. Sometimes when I close the main
> window of the app, the debugger its loaded,  I have been checking my code
> looking for unreleased objects thinking this might be the cause, can some
> body explaing me why is this happening. It happens only if I close the main
> window from the red X button,  it doesn't happens if I go to the app menu
> and click on the Quit label.

The whole idea of the debugger is to let you examine the program and
find out what's going on so you can figure out what's causing the
problem. Start out by looking at the reason it said that it dropped
you into the debugger, then look at the stack trace it gives you, and
those two should give you a good start.

Mike
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSTreeController, NSOutlineView, and a leak?

2008-12-07 Thread [EMAIL PROTECTED]
i've got an outline bound via a tree controller to a mutable set of 
my own proxy objects. when i create a new "real" object, i create a 
new proxy object and add it to the mutable set via the kvo compliant 
add<>Object: and all works well, and then i proceed to select the new 
object (line in the outline view). this all works as expected and the 
new object shows up properly in the outline view.


if i then undo the creation, i remove the proxy object from my 
mutable set via the kvo compliant remove<>Object. and this works 
fine... visually. however, my proxy object is not released and thus 
not deallocated.


i discovered (after about a day and a half of debuging) that the tree 
controller was holding a reference to my proxy object as part of its 
selection, even tho the object had been removed from its bound set. 
i've been able to solve this by calling the tree controller's 
-setSelectedIndexPath: nil, prior to my removing my proxy from the 
bound set.


is this expected behavior? or is this a bug that i should report via radar?

thanx,
ken
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread Mike Abdullah

The closest you'll find I think is the CIVector class.

Mike.

On 7 Dec 2008, at 20:19, Dave DeLong wrote:

Of course you could.  But it's not uncommon to need a 3 dimensional  
coordinate, so we were just wondering if there's one built in.   
Obviously 2 dimensional coordinates are everywhere, and as such the  
appropriate struct is included in the frameworks.  We were thinking  
that with 3 dimensional graphics becoming more and more common,  
there might be one built in already.


Dave

On 7 Dec, 2008, at 1:11 PM, Benjamin Dobson wrote:


On 7 Dec 2008, at 18:46:18, Dave DeLong wrote:


Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3  
float members.  The person asking me was looking for a struct that  
could contain a 3 dimensional point (so like a CG- or NSPoint, but  
with a z member).


My quick searches didn't reveal anything, but I was wondering if  
any of you knew of one.


Thanks,

Dave


Surely you could define one of your own?

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread Michael Ash
On Sun, Dec 7, 2008 at 1:46 PM, Dave DeLong <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I was asked yesterday if there's a struct in Cocoa that has 3 float members.
>  The person asking me was looking for a struct that could contain a 3
> dimensional point (so like a CG- or NSPoint, but with a z member).
>
> My quick searches didn't reveal anything, but I was wondering if any of you
> knew of one.

Well, it's part of CoreGraphics, not Cocoa, but there's CGDeviceColor
which has three float members.

Mike
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Unit Testing Frameworks

2008-12-07 Thread Thaddeus Cooper

Hello all.

I am having a problem with setting up unit testing for frameworks.  
I've read the documentation that is provided in the Apple doc set  and found Chris Hanson's updates to that documentation at . I've set up the framework to include a new target with the Unit  
Test Bundle and added my tests to it. I've also set up the dependency  
so that the tests should be run when the framework gets built (at  
least that's what I understand should happen), and I've set the target  
membership for my framework so that my framework gets linked into the  
tests.


The framework builds correctly -- no warnings or errors, but the test  
cases do not get built automatically. I then switch my active target  
to my test bundle (creatively named Tests), and do a build and get the  
following error dump (note I've highlighted the line I believe to be  
the major error):


/bin/sh -c /Users/cooper/src/Sections/build/Sections.build/Debug/ 
Tests.build/Script-1E7E14D00EEC6FD2006D87B7.sh
/Developer/Tools/RunPlatformUnitTests.include:358: note: Started tests  
for architectures 'i386'
/Developer/Tools/RunPlatformUnitTests.include:365: note: Running tests  
for architecture 'i386' (GC OFF)

objc[42098]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
objc[42098]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
2008-12-07 14:15:35.042 otest[42098:80f] The executable for the test  
bundle at /Users/cooper/src/Sections/build/Debug/Tests.octest could  
not be found.
2008-12-07 14:15:35.044 otest[42098:80f] Usage: otest [-SenTest Self |  
All | None | ] tested>
2008-12-07 14:15:35.046 otest[42098:80f] *** -[NSCFDictionary  
setObject:forKey:]: attempt to insert nil value (key:  
_NSTaskExecutablePath)
/Developer/Tools/RunPlatformUnitTests.include:384: error: Failed tests  
for architecture 'i386' (GC OFF)
/Developer/Tools/RunPlatformUnitTests.include:393: note: Completed  
tests for architectures 'i386'


I'm not sure why I'm getting this error, and what I should do to  
correct it so the tests run correctly.


 If anyone could shed some light on this for me I'd be really  
appreciative.


Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Fwd: Unit Testing Frameworks

2008-12-07 Thread Thaddeus Cooper
Woops -- the highlighting didn't come through. Here is the line from  
below:


2008-12-07 14:15:35.042 otest[42098:80f] The executable for the test  
bundle at /Users/cooper/src/Sections/build/Debug/Tests.octest could  
not be found.


Thaddeus O. Cooper
([EMAIL PROTECTED])



Begin forwarded message:


From: Thaddeus Cooper <[EMAIL PROTECTED]>
Date: December 7, 2008 2:25:37 PM PST
To: Cocoa-Dev Mail 
Subject: Unit Testing Frameworks

Hello all.

I am having a problem with setting up unit testing for frameworks.  
I've read the documentation that is provided in the Apple doc set  and found Chris Hanson's updates to that documentation at . I've set up the framework to include a new target with the Unit  
Test Bundle and added my tests to it. I've also set up the  
dependency so that the tests should be run when the framework gets  
built (at least that's what I understand should happen), and I've  
set the target membership for my framework so that my framework gets  
linked into the tests.


The framework builds correctly -- no warnings or errors, but the  
test cases do not get built automatically. I then switch my active  
target to my test bundle (creatively named Tests), and do a build  
and get the following error dump (note I've highlighted the line I  
believe to be the major error):


/bin/sh -c /Users/cooper/src/Sections/build/Sections.build/Debug/ 
Tests.build/Script-1E7E14D00EEC6FD2006D87B7.sh
/Developer/Tools/RunPlatformUnitTests.include:358: note: Started  
tests for architectures 'i386'
/Developer/Tools/RunPlatformUnitTests.include:365: note: Running  
tests for architecture 'i386' (GC OFF)

objc[42098]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
objc[42098]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
2008-12-07 14:15:35.042 otest[42098:80f] The executable for the test  
bundle at /Users/cooper/src/Sections/build/Debug/Tests.octest could  
not be found.
2008-12-07 14:15:35.044 otest[42098:80f] Usage: otest [-SenTest Self  
| All | None | ] be tested>
2008-12-07 14:15:35.046 otest[42098:80f] *** -[NSCFDictionary  
setObject:forKey:]: attempt to insert nil value (key:  
_NSTaskExecutablePath)
/Developer/Tools/RunPlatformUnitTests.include:384: error: Failed  
tests for architecture 'i386' (GC OFF)
/Developer/Tools/RunPlatformUnitTests.include:393: note: Completed  
tests for architectures 'i386'


I'm not sure why I'm getting this error, and what I should do to  
correct it so the tests run correctly.


If anyone could shed some light on this for me I'd be really  
appreciative.


Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/tcooper%40nomoreboxes.com

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data, refreshObject, multiple threads

2008-12-07 Thread Chris Idou
--- On Sun, 7/12/08, John Clayton <[EMAIL PROTECTED]> wrote:

> From: John Clayton <[EMAIL PROTECTED]>
> Subject: Re: core data, refreshObject, multiple threads
> To: [EMAIL PROTECTED]
> Cc: cocoa-dev@lists.apple.com, "Steve Steinitz" <[EMAIL PROTECTED]>
> Received: Sunday, 7 December, 2008, 5:45 AM
> Chris,
> 
> Can you make use of the -
> (void)refreshObject:(NSManagedObject *)object
> mergeChanges:(BOOL)flag method on NSManagedObjectContext?

See my original posting below.

> 
> Thanks
> --
> John Clayton
> Skype: johncclayton
> 
> 
> 
> 
> On 7/12/2008, at 12:22 PM, Chris Idou wrote:
> 
> > I've got fairly modest requirements, in so far as
> I'm using the XML store, and I'm happy to refresh
> the entire object graph of my worker thread when there is a
> change. So I've even tried [managedObjectContext reset]
> and querying from the beginning, but that doesn't seem
> to work either.
> > 
> > I'm starting to think in terms of rebuilding the
> entire PersistentStoreCoordinator / ManagedObjectContext
> stack as a way to get new data. But a question I've had
> in the back of my mind for some time now, is there is no
> obvious way to close a NSPersistentStoreCoordinator or close
> a NSManagedObjectContext. Does one simply dealloc them, or
> in the case of garbage collection, just throw them away?
> Usually database type interfaces require some kind of close
> API
> > 
> > 
> > --- On Fri, 5/12/08, Steve Steinitz
> <[EMAIL PROTECTED]> wrote:
> > 
> >> From: Steve Steinitz
> <[EMAIL PROTECTED]>
> >> Subject: Re: core data, refreshObject, multiple
> threads
> >> To: cocoa-dev@lists.apple.com
> >> Cc: [EMAIL PROTECTED]
> >> Received: Friday, 5 December, 2008, 4:04 PM
> >> Hi Chris,
> >> 
> >> On 5/12/08, Chris Idou <[EMAIL PROTECTED]>
> wrote:
> >> 
> >>> I've got a main thread that handles a gui,
> and a
> >> worker thread with its own
> persistentStoreCoordinator and
> >> managedObjectContext. The gui notifies the worker
> thread of
> >> a change, passing it an objectID, and the worker
> thread gets
> >> the object, and other objects it is connected to,
> and calls
> >> [managedObjectContext refreshObject: on them.
> >>> 
> >>> But they don't seem to get an updated
> object.
> >> I'm using the XML store. The store is saved,
> I've
> >> checked that the new values are in the XML. But
> refresh
> >> doesn't seem to update anything. Is there any
> trick to
> >> it?
> >> 
> >> Yes, I believe there are some tricks and also
> possibly some
> >> cases where it just won't update anything. 
> Ben Trumbull
> >> was kind enough to contribute to a similar
> question I posted
> >> back in October.  Here is the thread:
> >>
> http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg19221.html
> >> 
> >> In particular see his comment about the issue with
> small
> >> staleness intervals.  At the time, I thought that
> had solved
> >> my problem but I've since discovered other
> scenarios
> >> where refreshObject doesn't update anything. 
> Its
> >> possibly more likely to occur after optimistic
> locking
> >> errors (which, so far, I am unable to avoid).  But
> I
> >> haven't yet demonstrated that with any degree
> of
> >> scientific method.  I'm going to put it under
> the
> >> microscope again over the Christmas holidays. 
> Feel free to
> >> stay in touch about it.
> >> 
> >> Best regards and best of luck,
> >> 
> >> Steve
> > 
> > 
> >  Start your day with Yahoo!7 and win a Sony Bravia
> TV. Enter now
> http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
> > ___
> > 
> > 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 Subscription:
> >
> http://lists.apple.com/mailman/options/cocoa-dev/john_clayton%40mac.com
> > 
> > This email sent to [EMAIL PROTECTED]


  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: 3-float struct?

2008-12-07 Thread glenn andreas


On Dec 7, 2008, at 3:35 PM, Michael Ash wrote:


On Sun, Dec 7, 2008 at 1:46 PM, Dave DeLong <[EMAIL PROTECTED]> wrote:

Hi everyone,

I was asked yesterday if there's a struct in Cocoa that has 3 float  
members.

The person asking me was looking for a struct that could contain a 3
dimensional point (so like a CG- or NSPoint, but with a z member).

My quick searches didn't reveal anything, but I was wondering if  
any of you

knew of one.


Well, it's part of CoreGraphics, not Cocoa, but there's CGDeviceColor
which has three float members.

There's also CIVector (though that technically has 4 floats), and it's  
not a structure but an object, which removes the need to wrap it in an  
NSValue to keep it a Foundation collection object...


Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next  
generation of fractal art




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor and date comparisons

2008-12-07 Thread Chris Idou

I'm a bit confused by your post. NSPredicateEditor doesn't compare any dates, 
it just creates NSPredicates. Maybe you're saying that if you have a 
NSDatePicker in your NSPredicateEditor, that it creates a predicate with a date 
set to 13:41:40. If that's the case, then it probably has more to do with the 
NSDatePicker than predicates. Unless you're converting the predicate to a 
string, which introduces more complications. NSPredicateEditor tends to just 
call objectValue on the gui component, so try calling that yourself on your 
NSDatePicker and see what happens.

--- On Sun, 7/12/08, Josh Abernathy <[EMAIL PROTECTED]> wrote:

> From: Josh Abernathy <[EMAIL PROTECTED]>
> Subject: NSPredicateEditor and date comparisons
> To: "Cocoa-Dev List" 
> Received: Sunday, 7 December, 2008, 11:14 AM
> Hi all,
> 
> In my application, users have the option of comparing to a
> date in an NSPredicateEditor. For the NSDates it is
> comparing against, only the date is important; time
> doesn't matter.
> 
> The interesting thing I found about NSPredicateEditor is
> the NSTimeInterval it compares my NSDates to has the time
> set to 13:41:40.  That means my NSDates with the default
> 12:00:00 time don't match an "is" predicate.
> It's not a big deal because I can just change my
> NSDate's time to 13:41:40 to fix the problem.
> 
> But what I'm wondering is if this is guaranteed to
> always be true. I couldn't find it anywhere in the
> documentation.
> 
> Thanks,
> Josh
> ___
> 
> 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 Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com
> 
> This email sent to [EMAIL PROTECTED]


  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: core data, refreshObject, multiple threads

2008-12-07 Thread Steve Steinitz

Hi Chris,

On 7/12/08, Chris Idou wrote:


I've even tried [managedObjectContext reset] and querying from the
beginning, but that doesn't seem to work either.


My experience has been that that works (at least in 10.5 with GC 
activated).  I'm no Cocaa memory management expert but I suppose 
there could be a scenario where you would also have to release 
and nil all the managed objects.



rebuilding the entire PersistentStoreCoordinator /
ManagedObjectContext stack as a way to get new data


I agree that one can get to that way of thinking after being 
shunned by refreshObject etc :) However, I suggest fiddling a 
little more with MOC reset, first -- its not as coy as refreshObject.


Cheers,

Steve

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


How to use NSWorkspace?

2008-12-07 Thread John Velman

I'm missing something obvious, but I don't know what.

I want to use NSWorkspace to open an application from a command line
Foundation Tool.  

When I try to build the simplest thing, I get

--

Undefined symbols:
  ".objc_class_name_NSWorkspace", referenced from:
  [EMAIL PROTECTED]@[EMAIL PROTECTED] in LaunchMyMail.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
  ".objc_class_name_NSWorkspace", referenced from:
  [EMAIL PROTECTED]@[EMAIL PROTECTED] in LaunchMyMail.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

---

This happens whatever combination of the following imports I use:
#import 
#import 
#import 
#import 

This also happens for 
  [[NSWorkspace sharedWorkspace] openFile:@"SomeFile" 
withApplication:@"someApp"];


Examples I find, don't seem to have any problem, but when I copy them onto
my machine, they don't work.


Thanks,

John V.
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to use NSWorkspace?

2008-12-07 Thread Mike Abdullah
NSWorkspace is part of AppKit, so you need to link against that, not  
just Foundation. Alternatively, you could drop down directly to the  
Launch Services functions.


On 8 Dec 2008, at 00:07, John Velman wrote:



I'm missing something obvious, but I don't know what.

I want to use NSWorkspace to open an application from a command line
Foundation Tool.

When I try to build the simplest thing, I get

--

Undefined symbols:
 ".objc_class_name_NSWorkspace", referenced from:
 [EMAIL PROTECTED]@[EMAIL PROTECTED] in LaunchMyMail.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
  ".objc_class_name_NSWorkspace", referenced from:
  [EMAIL PROTECTED]@[EMAIL PROTECTED] in LaunchMyMail.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

---

This happens whatever combination of the following imports I use:
#import 
#import 
#import 
#import 

This also happens for
 [[NSWorkspace sharedWorkspace] openFile:@"SomeFile"  
withApplication:@"someApp"];



Examples I find, don't seem to have any problem, but when I copy  
them onto

my machine, they don't work.


Thanks,

John V.
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to use NSWorkspace?

2008-12-07 Thread Rob Keniger


On 08/12/2008, at 10:07 AM, John Velman wrote:


I want to use NSWorkspace to open an application from a command line
Foundation Tool.



You probably don't want to use NSWorkspace to do this. You should use  
NSTask to run command line tools.


--
Rob Keniger



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Unit Testing Frameworks

2008-12-07 Thread Rob Keniger


On 08/12/2008, at 8:25 AM, Thaddeus Cooper wrote:
The framework builds correctly -- no warnings or errors, but the  
test cases do not get built automatically. I then switch my active  
target to my test bundle (creatively named Tests), and do a build  
and get the following error dump (note I've highlighted the line I  
believe to be the major error):



2008-12-07 14:15:35.042 otest[42098:80f] The executable for the test  
bundle at /Users/cooper/src/Sections/build/Debug/Tests.octest could  
not be found.



It looks like you have not configured the BUNDLE_LOADER configuration  
directive in your Tests target's settings to point to your executable.


You need to make sure that the bundle loader is set to $ 
{BUILT_PRODUCTS_DIR}/YourAppName.app/Contents/MacOS/YourAppName for  
the test target to be able to launch your app and run the tests.


--
Rob Keniger



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor and date comparisons

2008-12-07 Thread Josh Abernathy
Ah, yes, that would be the more accurate way to explain it. I have an  
NSDatePicker in my NSPredicateEditor and no funny business is going on  
with conversions. It's just the simple default, setup-in-IB usage.


So I guess the question is better put: is there any guarantee about  
the time of an NSDatePicker in an NSPredicateEditor?


I created a quick test of an NSDatePicker outside an NSPredicateEditor  
and its default time seems to be 8:00:00.


On Dec 7, 2008, at 5:57 PM, Chris Idou wrote:



I'm a bit confused by your post. NSPredicateEditor doesn't compare  
any dates, it just creates NSPredicates. Maybe you're saying that if  
you have a NSDatePicker in your NSPredicateEditor, that it creates a  
predicate with a date set to 13:41:40. If that's the case, then it  
probably has more to do with the NSDatePicker than predicates.  
Unless you're converting the predicate to a string, which introduces  
more complications. NSPredicateEditor tends to just call objectValue  
on the gui component, so try calling that yourself on your  
NSDatePicker and see what happens.


--- On Sun, 7/12/08, Josh Abernathy <[EMAIL PROTECTED]> wrote:


From: Josh Abernathy <[EMAIL PROTECTED]>
Subject: NSPredicateEditor and date comparisons
To: "Cocoa-Dev List" 
Received: Sunday, 7 December, 2008, 11:14 AM
Hi all,

In my application, users have the option of comparing to a
date in an NSPredicateEditor. For the NSDates it is
comparing against, only the date is important; time
doesn't matter.

The interesting thing I found about NSPredicateEditor is
the NSTimeInterval it compares my NSDates to has the time
set to 13:41:40.  That means my NSDates with the default
12:00:00 time don't match an "is" predicate.
It's not a big deal because I can just change my
NSDate's time to 13:41:40 to fix the problem.

But what I'm wondering is if this is guaranteed to
always be true. I couldn't find it anywhere in the
documentation.

Thanks,
Josh
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com

This email sent to [EMAIL PROTECTED]



 Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Device type list for scanners/cameras, etc...

2008-12-07 Thread jmunson

Namaste!

I'm working with ICA.

Does anyone know any of the following:

1.  What the list of device types are for connected devices?
2.  Where I might find that list (in case you don't want to disclose it)?
3.  Or, just the keywords for a scanner (I assume "scanner" but want  
to be sure) and a multi-function unit (I assume "MFP" but I want to be  
sure).


I can't use the "subtype" method, so the corresponding kICA consts  
won't work in this instance - I need the full "device type."


Googling "scanner camera device type values ICA" didn't turn up  
anything other than the honorable mention in the Apple dox for "camera."


Thanks in advance!

Peace, Love, and Light,

/s/ Jon C. Munson II

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor and date comparisons

2008-12-07 Thread Chris Idou

Would your time zone happen to somehow correspond to 8:00 ?

Try doing a setDateValue on the gui component before you start, with a 
particular time. I've got a suspicion that it will then leave the time 
component alone. When you got a result of 13:41:40, might that have been the 
time you ran the program?


--- On Sun, 7/12/08, Josh Abernathy <[EMAIL PROTECTED]> wrote:

> From: Josh Abernathy <[EMAIL PROTECTED]>
> Subject: Re: NSPredicateEditor and date comparisons
> To: [EMAIL PROTECTED]
> Cc: "Cocoa-Dev List" 
> Received: Sunday, 7 December, 2008, 5:00 PM
> Ah, yes, that would be the more accurate way to explain it.
> I have an NSDatePicker in my NSPredicateEditor and no funny
> business is going on with conversions. It's just the
> simple default, setup-in-IB usage.
> 
> So I guess the question is better put: is there any
> guarantee about the time of an NSDatePicker in an
> NSPredicateEditor?
> 
> I created a quick test of an NSDatePicker outside an
> NSPredicateEditor and its default time seems to be 8:00:00.
> 
> On Dec 7, 2008, at 5:57 PM, Chris Idou wrote:
> 
> > 
> > I'm a bit confused by your post. NSPredicateEditor
> doesn't compare any dates, it just creates NSPredicates.
> Maybe you're saying that if you have a NSDatePicker in
> your NSPredicateEditor, that it creates a predicate with a
> date set to 13:41:40. If that's the case, then it
> probably has more to do with the NSDatePicker than
> predicates. Unless you're converting the predicate to a
> string, which introduces more complications.
> NSPredicateEditor tends to just call objectValue on the gui
> component, so try calling that yourself on your NSDatePicker
> and see what happens.
> > 
> > --- On Sun, 7/12/08, Josh Abernathy
> <[EMAIL PROTECTED]> wrote:
> > 
> >> From: Josh Abernathy <[EMAIL PROTECTED]>
> >> Subject: NSPredicateEditor and date comparisons
> >> To: "Cocoa-Dev List"
> 
> >> Received: Sunday, 7 December, 2008, 11:14 AM
> >> Hi all,
> >> 
> >> In my application, users have the option of
> comparing to a
> >> date in an NSPredicateEditor. For the NSDates it
> is
> >> comparing against, only the date is important;
> time
> >> doesn't matter.
> >> 
> >> The interesting thing I found about
> NSPredicateEditor is
> >> the NSTimeInterval it compares my NSDates to has
> the time
> >> set to 13:41:40.  That means my NSDates with the
> default
> >> 12:00:00 time don't match an "is"
> predicate.
> >> It's not a big deal because I can just change
> my
> >> NSDate's time to 13:41:40 to fix the problem.
> >> 
> >> But what I'm wondering is if this is
> guaranteed to
> >> always be true. I couldn't find it anywhere in
> the
> >> documentation.
> >> 
> >> Thanks,
> >> Josh
> >> ___
> >> 
> >> 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 Subscription:
> >>
> http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com
> >> 
> >> This email sent to [EMAIL PROTECTED]
> > 
> > 
> >  Start your day with Yahoo!7 and win a Sony Bravia
> TV. Enter now
> http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline


  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now 
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor and date comparisons

2008-12-07 Thread jmunson
I remember, way long ago in the past, having to supply a time  
component to go with a date component - otherwise some seemingly  
"random" time was inserted which then threw off anything else I did.   
If I only needed a date (from a datetime field), I had to format it  
that way (as only a date, and in the format I needed) and do some  
seemingly-odd comparison (like comparing two strings).  It worked, so  
I didn't care past that point.


Quoting Chris Idou <[EMAIL PROTECTED]>:



Would your time zone happen to somehow correspond to 8:00 ?

Try doing a setDateValue on the gui component before you start, with  
 a particular time. I've got a suspicion that it will then leave the  
 time component alone. When you got a result of 13:41:40, might that  
 have been the time you ran the program?



--- On Sun, 7/12/08, Josh Abernathy <[EMAIL PROTECTED]> wrote:


From: Josh Abernathy <[EMAIL PROTECTED]>
Subject: Re: NSPredicateEditor and date comparisons
To: [EMAIL PROTECTED]
Cc: "Cocoa-Dev List" 
Received: Sunday, 7 December, 2008, 5:00 PM
Ah, yes, that would be the more accurate way to explain it.
I have an NSDatePicker in my NSPredicateEditor and no funny
business is going on with conversions. It's just the
simple default, setup-in-IB usage.

So I guess the question is better put: is there any
guarantee about the time of an NSDatePicker in an
NSPredicateEditor?

I created a quick test of an NSDatePicker outside an
NSPredicateEditor and its default time seems to be 8:00:00.

On Dec 7, 2008, at 5:57 PM, Chris Idou wrote:

>
> I'm a bit confused by your post. NSPredicateEditor
doesn't compare any dates, it just creates NSPredicates.
Maybe you're saying that if you have a NSDatePicker in
your NSPredicateEditor, that it creates a predicate with a
date set to 13:41:40. If that's the case, then it
probably has more to do with the NSDatePicker than
predicates. Unless you're converting the predicate to a
string, which introduces more complications.
NSPredicateEditor tends to just call objectValue on the gui
component, so try calling that yourself on your NSDatePicker
and see what happens.
>
> --- On Sun, 7/12/08, Josh Abernathy
<[EMAIL PROTECTED]> wrote:
>
>> From: Josh Abernathy <[EMAIL PROTECTED]>
>> Subject: NSPredicateEditor and date comparisons
>> To: "Cocoa-Dev List"

>> Received: Sunday, 7 December, 2008, 11:14 AM
>> Hi all,
>>
>> In my application, users have the option of
comparing to a
>> date in an NSPredicateEditor. For the NSDates it
is
>> comparing against, only the date is important;
time
>> doesn't matter.
>>
>> The interesting thing I found about
NSPredicateEditor is
>> the NSTimeInterval it compares my NSDates to has
the time
>> set to 13:41:40.  That means my NSDates with the
default
>> 12:00:00 time don't match an "is"
predicate.
>> It's not a big deal because I can just change
my
>> NSDate's time to 13:41:40 to fix the problem.
>>
>> But what I'm wondering is if this is
guaranteed to
>> always be true. I couldn't find it anywhere in
the
>> documentation.
>>
>> Thanks,
>> Josh
>> ___
>>
>> 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 Subscription:
>>
http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com
>>
>> This email sent to [EMAIL PROTECTED]
>
>
>  Start your day with Yahoo!7 and win a Sony Bravia
TV. Enter now
http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline



  Start your day with Yahoo!7 and win a Sony Bravia TV. Enter   
now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com

This email sent to [EMAIL PROTECTED]





___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor and date comparisons

2008-12-07 Thread Chris Idou

I think you're better off writing a custom Date compare function, and 
customising the NSPredicateEditor to return a predicate using the function, so 
that you can guarantee that date comparison happens the way you want. I guess 
you *could* control the date passed into the predicate to normalise the date to 
midday or something, but then if you later added some predicate terms that used 
the time, that wouldn't work, do it would be a bit of a kludge.


--- On Sun, 7/12/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Subject: Re: NSPredicateEditor and date comparisons
> To: cocoa-dev@lists.apple.com
> Received: Sunday, 7 December, 2008, 6:16 PM
> I remember, way long ago in the past, having to supply a
> time component to go with a date component - otherwise some
> seemingly "random" time was inserted which then
> threw off anything else I did.  If I only needed a date
> (from a datetime field), I had to format it that way (as
> only a date, and in the format I needed) and do some
> seemingly-odd comparison (like comparing two strings).  It
> worked, so I didn't care past that point.
> 
> Quoting Chris Idou <[EMAIL PROTECTED]>:
> 
> > 
> > Would your time zone happen to somehow correspond to
> 8:00 ?
> > 
> > Try doing a setDateValue on the gui component before
> you start, with  a particular time. I've got a suspicion
> that it will then leave the  time component alone. When you
> got a result of 13:41:40, might that  have been the time you
> ran the program?
> > 
> > 
> > --- On Sun, 7/12/08, Josh Abernathy
> <[EMAIL PROTECTED]> wrote:
> > 
> >> From: Josh Abernathy <[EMAIL PROTECTED]>
> >> Subject: Re: NSPredicateEditor and date
> comparisons
> >> To: [EMAIL PROTECTED]
> >> Cc: "Cocoa-Dev List"
> 
> >> Received: Sunday, 7 December, 2008, 5:00 PM
> >> Ah, yes, that would be the more accurate way to
> explain it.
> >> I have an NSDatePicker in my NSPredicateEditor and
> no funny
> >> business is going on with conversions. It's
> just the
> >> simple default, setup-in-IB usage.
> >> 
> >> So I guess the question is better put: is there
> any
> >> guarantee about the time of an NSDatePicker in an
> >> NSPredicateEditor?
> >> 
> >> I created a quick test of an NSDatePicker outside
> an
> >> NSPredicateEditor and its default time seems to be
> 8:00:00.
> >> 
> >> On Dec 7, 2008, at 5:57 PM, Chris Idou wrote:
> >> 
> >> >
> >> > I'm a bit confused by your post.
> NSPredicateEditor
> >> doesn't compare any dates, it just creates
> NSPredicates.
> >> Maybe you're saying that if you have a
> NSDatePicker in
> >> your NSPredicateEditor, that it creates a
> predicate with a
> >> date set to 13:41:40. If that's the case, then
> it
> >> probably has more to do with the NSDatePicker than
> >> predicates. Unless you're converting the
> predicate to a
> >> string, which introduces more complications.
> >> NSPredicateEditor tends to just call objectValue
> on the gui
> >> component, so try calling that yourself on your
> NSDatePicker
> >> and see what happens.
> >> >
> >> > --- On Sun, 7/12/08, Josh Abernathy
> >> <[EMAIL PROTECTED]> wrote:
> >> >
> >> >> From: Josh Abernathy
> <[EMAIL PROTECTED]>
> >> >> Subject: NSPredicateEditor and date
> comparisons
> >> >> To: "Cocoa-Dev List"
> >> 
> >> >> Received: Sunday, 7 December, 2008, 11:14
> AM
> >> >> Hi all,
> >> >>
> >> >> In my application, users have the option
> of
> >> comparing to a
> >> >> date in an NSPredicateEditor. For the
> NSDates it
> >> is
> >> >> comparing against, only the date is
> important;
> >> time
> >> >> doesn't matter.
> >> >>
> >> >> The interesting thing I found about
> >> NSPredicateEditor is
> >> >> the NSTimeInterval it compares my NSDates
> to has
> >> the time
> >> >> set to 13:41:40.  That means my NSDates
> with the
> >> default
> >> >> 12:00:00 time don't match an
> "is"
> >> predicate.
> >> >> It's not a big deal because I can
> just change
> >> my
> >> >> NSDate's time to 13:41:40 to fix the
> problem.
> >> >>
> >> >> But what I'm wondering is if this is
> >> guaranteed to
> >> >> always be true. I couldn't find it
> anywhere in
> >> the
> >> >> documentation.
> >> >>
> >> >> Thanks,
> >> >> Josh
> >> >>
> ___
> >> >>
> >> >> 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
> Subscription:
> >> >>
> >>
> http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com
> >> >>
> >> >> This email sent to [EMAIL PROTECTED]
> >> >
> >> >
> >> >  Start your day with Yahoo!7 and win a
> Sony Bravia
> >> TV. Enter now
> >>
> http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
> > 
> > 
> >   Start your day with Yahoo!7 and win a Sony
> Bravia TV. Enter  now
> http://au.docs.yahoo.com/homepageset/?p1=ot

Re: 3-float struct?

2008-12-07 Thread Gregory Weston

Dave DeLong wrote:


Of course you could.  But it's not uncommon to need a 3 dimensional
coordinate, so we were just wondering if there's one built in.
Obviously 2 dimensional coordinates are everywhere, and as such the
appropriate struct is included in the frameworks.  We were thinking
that with 3 dimensional graphics becoming more and more common, there
might be one built in already.


Ah, but the dominant 3D graphics API doesn't use a structure to  
represent coordinates.

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


how to manage two nib files

2008-12-07 Thread XiaoGang Li
Hi, List,

  I have a question about how to design my applicaiton in Cocoa.

  My applicaiton is not a normal application.  it is a utility for my
printer device. when user double-click the application icon, the application
first register an apple event before any UI being shown, he application will
receive a apple event from Mac OS later, which tells it that whether the
device is USB-connected or Network-connected, when the application get this
information, then it will launch the corresponding UI depend on the connect
mode. (there are two nib files, one for USB, another for Network.).

  I have no idea how to manage two nib files, or two window controller.
I hope soneone can give me some comments. thanks very much.

XiaogangLi
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


One-way communication from NSPanel in MainMenu.xib to Custom View

2008-12-07 Thread Gordon Hughes
I've been pulling my hair out over this for a few days now.  I know I'm not
understanding something quite elementary, so I'd greatly appreciate any
insights offered.
I'm attempting to write a "game show"-like application.  My laptop would
display a window (the NSPanel) which controls what's going on on a projected
window.  The communication would be strictly one-way from the controlling
NSPanel (or NSWindow, whatever's more appropriate) to the game board's
window.

My difficulty seems to be with finding a bridge between the two windows
while still allowing the projected game board to have two different views.

When I wired the NSPanel and window with a single custom view in
MainMenu.xib through the AppDelegate, it worked.  Text entered on the
NSPanel was sent to the custom view with the appropriate button action.
 Other buttons would trigger animations on the projected game board.  When I
added the second view and tried to handle the views with a subclassed
NSViewController, it stopped working.

Am I at least on the right track?

Gordon
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: how to manage two nib files

2008-12-07 Thread Kiel Gillard





Hope this helps!

On 08/12/2008, at 1:47 PM, XiaoGang Li wrote:


Hi, List,

 I have a question about how to design my applicaiton in Cocoa.

 My applicaiton is not a normal application.  it is a utility  
for my
printer device. when user double-click the application icon, the  
application
first register an apple event before any UI being shown, he  
application will
receive a apple event from Mac OS later, which tells it that whether  
the
device is USB-connected or Network-connected, when the application  
get this
information, then it will launch the corresponding UI depend on the  
connect

mode. (there are two nib files, one for USB, another for Network.).

 I have no idea how to manage two nib files, or two window  
controller.

I hope soneone can give me some comments. thanks very much.

XiaogangLi
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Encrypted web services connections and pk12 certificates

2008-12-07 Thread Daniel Parnell

Hi All,

	I need to make some code to talk to a SOAP web service.   
Unfortunately I'm unable to get a connection to the service as it  
requires a SSL connection encrypted with a special certificate.  I've  
been given a pk12 certificate which when installed into my keychain  
allows me to access the SOAP service manually via Safari, but I'm  
unable to get a connection from the Cocoa web services stuff :(
Does anybody have any ideas on what I might have to do to get this to  
work?


Thanks :)

Daniel

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Unit Testing Frameworks

2008-12-07 Thread Thaddeus Cooper
Thanks. I finally got over the hump -- it turned out to be that the  
test cases were not in the right target.


Now that that's fixed I'm trying to get debugging of the framework  
working and I keep getting a launch path not accessible error. I added  
the executable target and set the arguments to


-SenTest All
Section Tests.octest

and my environment variables to:

DYLD_LIBRARY_PATH $(BUILT_PRODUCTS_DIR)
DYLD_FRAMEWORK_PATH $(BUILT_PRODUCTS_DIR)
OBJC_DISABLE_GC YES

otest runs but gives the following error:

objc[46258]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
Running…
objc[46258]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
2008-12-07 20:03:03.415 otest[46258:813] Usage: otest [-SenTest Self |  
All | None | ] tested>

2008-12-07 20:03:03.421 otest[46258:813] launch path not accessible

I've tried -SenTest All, -SenTest None, and a variety of things for  
Section Tests.octest including prefixing it with ${BUILT_PRODUCTS_DIR}  
and without, and even removing it altogether. All with the same  
result. I'm pretty sure that the problem is a dumb one but I can't see  
it.


Once again -- thanks to all who have responded and if anyone has any  
thoughts I'd be really appreciative.


Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



On Dec 7, 2008, at 4:48 PM, Rob Keniger wrote:



On 08/12/2008, at 8:25 AM, Thaddeus Cooper wrote:
The framework builds correctly -- no warnings or errors, but the  
test cases do not get built automatically. I then switch my active  
target to my test bundle (creatively named Tests), and do a build  
and get the following error dump (note I've highlighted the line I  
believe to be the major error):



2008-12-07 14:15:35.042 otest[42098:80f] The executable for the  
test bundle at /Users/cooper/src/Sections/build/Debug/Tests.octest  
could not be found.



It looks like you have not configured the BUNDLE_LOADER  
configuration directive in your Tests target's settings to point to  
your executable.


You need to make sure that the bundle loader is set to $ 
{BUILT_PRODUCTS_DIR}/YourAppName.app/Contents/MacOS/YourAppName for  
the test target to be able to launch your app and run the tests.


--
Rob Keniger



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/tcooper%40nomoreboxes.com

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Child Window issues

2008-12-07 Thread Damien Cooke

Hi All I resolved this by using:

[window setLevel: NSWindowLevel];

I hope this helps someone else out there.

Damien
On 06/12/2008, at 9:05 AM, Damien Cooke wrote:


Hi all,
In my application I have a main window with a few controls and 4  
child windows each contain an image.


When I  maximise one of the child windows to full screen (depending  
on which one) one or more of the other three stay in front.  This is  
clearly a window order issue.  Is there a way of creating them at  
the same level? I do not seem to be having any luck using orderFront  
or orderBack.  Can someone point me in the right direction?


I create the window like this:

oneOfFourWindow = [[DCOMediaViewer alloc]  
initWithContentRect:oneOfOneImageRectClosed  
styleMask:NSTitledWindowMask|NSResizableWindowMask  
backing:NSBackingStoreBuffered defer:YES];



and set the child status like this
[appWindow addChildWindow:oneOfFourWindow ordered:NSWindowAbove];

Regards
Damien

"We act as though comfort and luxury were the chief requirements of  
life, when all that we need to make us happy is something to be  
enthusiastic about."


-- Albert Einstein




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/damien.cooke%40internode.on.net

This email sent to [EMAIL PROTECTED]


If you can't be kind, at least have the decency to be vague.



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


PackageMaker installing into /Applications or ~/Applications depending on admin or not?

2008-12-07 Thread Chris Markle
We have an installer for our current app that use Vise. We'd like to
switch maybe to PackageMaker and its artifacts. One thing that the
Vise-created install does is get installed to /Applications if you're
and admin and to ~/Applications if you're a standard user. Does anyone
know if PackageMaker does the same thing? Or can it be motivated to do
so? I plan on trying this myself but I'm a PackageMaker newby and am
concerned about the influence of various settings on my experiments...

Chris
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


interact with users in a background app

2008-12-07 Thread BirdSong

Hi all,I want to add a window to a background application in order to interact 
with users sometimes. However, I found the window I added is not a keywindow or 
so because I can not type in the textField which located in the window... Does 
any one know how to solve this problem, I mean edit in the window which in a 
background application.Thanks a lot!
_
MSN资讯快递,帮助你第一时间了解最新资讯!
http://im.live.cn/safe/center/
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: interact with users in a background app

2008-12-07 Thread Chunk 1978
[NSApp activateIgnoringOtherApps:YES];

On Mon, Dec 8, 2008 at 2:14 AM, BirdSong <[EMAIL PROTECTED]> wrote:
>
> Hi all,I want to add a window to a background application in order to 
> interact with users sometimes. However, I found the window I added is not a 
> keywindow or so because I can not type in the textField which located in the 
> window... Does any one know how to solve this problem, I mean edit in the 
> window which in a background application.Thanks a lot!
> _
> MSN资讯快递,帮助你第一时间了解最新资讯!
> http://im.live.cn/safe/center/
> ___
>
> 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 Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

RE: interact with users in a background app

2008-12-07 Thread BirdSong

Thank you for your answer... But seems it doesn't work, the window still can 
not accept the key events...> Date: Mon, 8 Dec 2008 02:21:25 -0500> From: 
[EMAIL PROTECTED]> To: [EMAIL PROTECTED]> Subject: Re: interact with users in a 
background app> CC: cocoa-dev@lists.apple.com> > [NSApp 
activateIgnoringOtherApps:YES];> > On Mon, Dec 8, 2008 at 2:14 AM, BirdSong 
<[EMAIL PROTECTED]> wrote: Hi all,I want to add a window to a background 
application in order to interact with users sometimes. However, I found the 
window I added is not a keywindow or so because I can not type in the textField 
which located in the window... Does any one know how to solve this problem, I 
mean edit in the window which in a background application.Thanks a lot!>> 
_>> 
MSN资讯快递,帮助你第一时间了解最新资讯!>> http://im.live.cn/safe/center/>> 
___ 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 Subscription:>> 
 >>> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com 
 >>> This email sent to [EMAIL PROTECTED]>>
_
微软地图率先推出跨城市多点驾车路线查询!
http://ditu.live.com/?form=MRAHAB&rtp=pos.30.454167_116.308611_%E5%A4%AA%E6%B9%96__~pos.29.554046_115.983427_%E5%BA%90%E5%B1%B1__~pos.29.116111_110.478889_%E5%BC%A0%E5%AE%B6%E7%95%8C__&rtop=0~0~0&encType=1
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: interact with users in a background app

2008-12-07 Thread Benjamin Dobson


On 8 Dec 2008, at 07:28:29, BirdSong wrote:

Thank you for your answer... But seems it doesn't work, the window  
still can not accept the key events...


Have you told it to makeKeyAndOrderFront:?
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: interact with users in a background app

2008-12-07 Thread Kyle Sluder
On Mon, Dec 8, 2008 at 2:14 AM, BirdSong <[EMAIL PROTECTED]> wrote:
> Hi all,I want to add a window to a background application in order to 
> interact with users sometimes. However, I found the window I added is not a 
> keywindow or so because I can not type in the textField which located in the 
> window... Does any one know how to solve this problem, I mean edit in the 
> window which in a background application.Thanks a lot!

Background application?  Like something that launchd starts?

Have you read TN2083 (Daemons and Agents)?
http://developer.apple.com/technotes/tn2005/tn2083.html

--Kyle Sluder
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]