Re: Disable Sorting in NSTableView

2008-10-25 Thread Quincey Morris

On Oct 24, 2008, at 20:57, Grant Limberg wrote:

Is it possible to disable the user's ability to resort the rows in a  
table by clicking on the column header?  I have a table view that  
stores statistics in the order they are received by the program and  
shouldn't be resorted.  Is there a way to do this without removing  
the column headers?


It's not obvious, but the way to do it is to uncheck the creates sort  
descriptor binding of the column's Value binding.



___

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: Apple Developer Forums

2008-10-25 Thread Jean-Daniel Dupas


Le 25 oct. 08 à 05:04, Stefan Arentz a écrit :

On Fri, Oct 24, 2008 at 12:15 PM, Randall Meadows [EMAIL PROTECTED] 
 wrote:

It looks like we're legit to discuss now!

http://devforums.apple.com/


Personally I think this is a big joke.

You need to be signed up as a paying developer to access the forum.

The forum is closed. It is not indexed by Google. You need to be
logged in to even read articles. What is up with that? I thought the
NDA was lifted.

The forum is moderated by Apple. Bad. I want to discuss anything. Not
having to worry about Apple the dictator closing my account because I
am saying things they don't want people to discuss.


aren't all [EMAIL PROTECTED] moderated by Apple ? Does it make them  
jokes or useless ?




___

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]


[moderator] Re: Apple Developer Forums

2008-10-25 Thread Scott Anguish

Yes, they are.

Please keep them on topic.

This thread isn't.

scott
[moderator]


On 25-Oct-08, at 6:17 AM, Jean-Daniel Dupas wrote:

aren't all [EMAIL PROTECTED] moderated by Apple ? Does it make them  
jokes or useless ?


___

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 - row size

2008-10-25 Thread Chris Idou

Has anyone found a way to make a row in the NSPredicateEditor to have 
components taller than the standard height or a more complicated arrangement of 
components, or are you pretty much limited to  one row of buttons, and text 
fields and similar sized components?

Programs like Hazel are able to vary the height of rows at will, however it 
doesn't use the real NSPredicateEditor, it seems to simulate something similar 
with a table or something.




  
___

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: Can someone point me a Core Animation layer compositing example?

2008-10-25 Thread Scott Anguish


On 24-Oct-08, at 10:50 PM, Michael A. Crawford wrote:

I need to learn how to take three or four Core-Animation layers and  
composite them on onto one another while animating, in order to  
simulate a complex gauge.  I'm assuming this will be a lot easier  
than it is in Windows.


The different elements (needles and such) of the gauge will be on  
their own layer and will animate by rotating around the center.   
Additionally, I need for most of the layer to be transparent except  
for the gauge elements.  Any example code you can point to that will  
help me to assemble these different functional elements would be  
greatly appreciated.


I'm guessing you mean a gauge like the one shown in the doc in this  
article?



http://developer.apple.com/documentation/GraphicsImaging/Conceptual/Animation_Overview/MacOSXAnimTech/chapter_4_section_2.html#/ 
/apple_ref/doc/uid/TP40004952-CH6-SW4


This is the code I used to generate the movie that movie. It was  
written specifically to make that QuickTime movie, nothing more.


This hasn't been touched in more than a year except to add the  
disclaimer and to make sure it still compiles. It may leak. But it'll  
give you some ideas.


http://www.abandoninplace.com/blog/2008/10/simple-core-animation-meter-vi.html
___

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]


[Moderator] Re: Apple Developer Forums

2008-10-25 Thread Scott Anguish

This isn't appropriate for discussion here.

If you have complaints, take them to [EMAIL PROTECTED]

scott
[moderator]


On 24-Oct-08, at 11:04 PM, Stefan Arentz wrote:

On Fri, Oct 24, 2008 at 12:15 PM, Randall Meadows [EMAIL PROTECTED] 
 wrote:

It looks like we're legit to discuss now!

http://devforums.apple.com/


Personally I think this is a big joke.



___

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: Rotation in CAAnimation layers

2008-10-25 Thread DKJ

I do this with a CAAnimation layer myLayer:

myLayer.shadowOffset = CGSizeMake( 5.0, 5.0 );

and get a shadow on the upper and right edges. But when I rotate the  
layer 180 degrees, the shadow then appears on the lower and left  
edges. Real shadows don't do that.


If the object were circular, I'd just put another stationary layer  
underneath and attach the shadow to it. But with other shapes this  
won't work.


So finally, my question: Is there an easy way of calculating the  
position and appearance of the shadow for non-circular shapes? (By  
easy I mean one that I can just copy from somewhere.) If not I'll  
try to figure it out myself; but I don't want to re-invent the wheel.


dkj



On 24 Oct, 2008, at 18:11, douglas welton wrote:


On Oct 24, 2008, at 6:50 PM, DKJ wrote:

Is there an easy way to provide a realistic shadow for a (non- 
circular) layer rotating round the z-axis? (I know  
layer.rotateShadow = YES is too much to hope for.)


To get a realistic answer, it might help if you provide a little  
more specific information about 1) what you are trying to do, 2)  
what is not working and 3) what you have tried. (consult: http://www.catb.org/~esr/faqs/smart-questions.html 
)


regards,

douglas





Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.com

___

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: Rotation in CAAnimation layers

2008-10-25 Thread Ricky Sharp


On Oct 25, 2008, at 8:31 AM, DKJ wrote:


I do this with a CAAnimation layer myLayer:

myLayer.shadowOffset = CGSizeMake( 5.0, 5.0 );

and get a shadow on the upper and right edges. But when I rotate the  
layer 180 degrees, the shadow then appears on the lower and left  
edges. Real shadows don't do that.


If the object were circular, I'd just put another stationary layer  
underneath and attach the shadow to it. But with other shapes this  
won't work.


So finally, my question: Is there an easy way of calculating the  
position and appearance of the shadow for non-circular shapes? (By  
easy I mean one that I can just copy from somewhere.) If not I'll  
try to figure it out myself; but I don't want to re-invent the wheel.



It sounds like you want a fixed shadow position regardless of  
rotation.  Note that whenever you apply a rotation (or transformation  
for that matter), shadow offsets are also adjusted accordingly.


Whenever you rotate your layers, you'll need to re-calculate your  
shadow offsets accordingly.


Also, there may exist an API to allow for shadows to be fixed? Not  
sure about that.  Wouldn't be a bad enhancement to file though.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.com



___

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]


Controlling Preference Panel Installation

2008-10-25 Thread Antonio Ferraioli

Hello,

I've built a preference panel that will be installed in System  
Preferences,


I'd like to let the user install the panel by double clicking it,
doing this the System Prenferences application asks
how the panel will be installed
-  Install for this user only
-  Install for all users of this computer

I'd like to limit the panel installation to the curent user ( Install  
for this user only)

avoiding the Install for all users of this computer option

do you know if it is possible to do this ?
does it exist some property that I can assign to the Info.plist file  
of my preference panel


thank you for you help
Antonio Ferraioli
___

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]


NSPersistentDocument: Settings (DepartmentsAndEmployees)

2008-10-25 Thread Jerry Krinock
In Apple's DepartmentsAndEmployees Sample Code project, the document  
(MyDocument) has this instance variable:


 NSManagedObject* department ;

I view this 'department' as special Document Settings Ivar.  There  
is always one and only one of them in each document.  As a matter of  
fact, from the user's viewpoint, each document is a Deparment; the  
document is the Department and vice versa.  It seems to me that most  
Core Data Document-Based Applications will have such a Document  
Settings Ivar in their Document.  If the project were a word  
processor, for example, the Document Settings Ivar would store page  
size, margins, etc.


In DepartmentsAndEmployees, initWithType:error: is overridden to  
customize creation of new documents.  I've copied the code here...


- (id)initWithType:(NSString *)type error:(NSError **)error
{
self = [super initWithType:type error:error];
if (self != nil)
{
NSManagedObjectContext *managedObjectContext = [self  
managedObjectContext];
[self setDepartment:[NSEntityDescription  
insertNewObjectForEntityForName:@Department
   
inManagedObjectContext:managedObjectContext]];


// To avoid undo registration for this insertion,  
removeAllActions on the undoManager.
// First call processPendingChanges on the managed object  
context to force the undo registration

// for this insertion, then call removeAllActions.
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] removeAllActions];
[self updateChangeCount:NSChangeCleared];
}
return self;
}

Documentation for -processPendingChanges says causes changes to  
registered managed objects to be recorded with the undo manager.   
Well, since the intent is to avoid undo registration for this  
insertion, should not the -processPendingChanges message be sent  
^before^ -setDepartment:?  I made this change in the code, built,  
tested a new document with Undo and all seems to still work fine.


Actually, it seems that the -processPendingChanges message could  
simply be deleted because how could there be any other pending changes  
before -init anyhow?


Thanks,

Jerry Krinock
___

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: Creating icons and other resources

2008-10-25 Thread Benjamin Dobson

On 25 Oct 2008, at 17:03:54, [EMAIL PROTECTED] wrote:

I hope this is appropriate the list, if not, my apologies. I was  
wondering how people go about creating the artwork that goes into  
their applications. I don't have a professional budget, and do  
things myself, but I'm not an artist, so my creative skills are  
limited. I see many of the apps listed on sites like Version Tracker  
and Mac-Update have pretty 3D icons for the app and nicely done  
artwork for windows and preference panes. So, I'm wondering how do  
folks get your ideas and what tools do you use to bring them to life.

Thanks, and apologies again if this question was not appropriate.


This discussion came up quite recently.

http://www.cocoabuilder.com/archive/message/cocoa/2008/10/19/220489
___

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: Consola application

2008-10-25 Thread parag vibhute
Hi Marcus,

Many thanks for source code of Consola.

Thanks,
Palav

On 10/25/08, Marcus [EMAIL PROTECTED] wrote:

 Hello all,

 I have an open source application Consola (which I received from
 one of my
 friend). But I do not have its source code.

 FYI, there was an Open Source *Bluetooth* Proximity Media Server
 application
 Consola. This application  its source code were available around
 Year
 2005.

 If anybody has source code of that application, then please send it.
 I need
 to make certain enhancements to that applicatiion.

 Thanks,
 Palav


 Hello Palav.

 I have a copy of that application's source code.
 http://www.acc.umu.se/~mk/archive/Consola_v1.1_src.zip

 Cheers.
 Marcus





-- 

There are many things in your life that will catch your eye but only a
few will catch your heartpursue those'.
___

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: NSPersistentDocument: Settings (DepartmentsAndEmployees)

2008-10-25 Thread Quincey Morris

On Oct 25, 2008, at 08:15, Jerry Krinock wrote:


- (id)initWithType:(NSString *)type error:(NSError **)error
{
   self = [super initWithType:type error:error];
   if (self != nil)
   {
   NSManagedObjectContext *managedObjectContext = [self  
managedObjectContext];
   [self setDepartment:[NSEntityDescription  
insertNewObjectForEntityForName:@Department
  
inManagedObjectContext:managedObjectContext]];


   // To avoid undo registration for this insertion,  
removeAllActions on the undoManager.
   // First call processPendingChanges on the managed object  
context to force the undo registration

   // for this insertion, then call removeAllActions.
   [managedObjectContext processPendingChanges];
   [[managedObjectContext undoManager] removeAllActions];
   [self updateChangeCount:NSChangeCleared];
   }
   return self;
}

Documentation for -processPendingChanges says causes changes to  
registered managed objects to be recorded with the undo manager.   
Well, since the intent is to avoid undo registration for this  
insertion, should not the -processPendingChanges message be sent  
^before^ -setDepartment:?  I made this change in the code, built,  
tested a new document with Undo and all seems to still work fine.



The processPendingChanges method deals with changes that have already  
been made, not changes that will be made.


The setDepartment call *may* register an undo action with the undo  
manager, *or* create a pending change that the undo manager isn't  
told about yet. It's an implementation detail which of the two  
happens, so we don't know in any given case. If the change is  
registered with the undo manager, you can just tell it to remove the  
change. If the change is pending, there's no way to remove it  
directly, so you must force it to be registered  
(processPendingChanges) and then you can tell the undo manager to  
remove it (removeAllActions).


Therefore the documented order of the calls is both correct and  
required. If it seemed to work in the order you did it, it may be that  
the change was registered immediately in your case, and there were no  
pending changes to be taken care of.


BTW, if you want to make some changes that you don't want to be  
recorded, you can also do it this way:


[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] disableUndoRegistration];
... make changes to the managed object context ...
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];

But this seems less desirable in your case, IMO, because it's only  
correct if you can be certain that the managed object context was not  
dirtied (by some part of Core Data's internal housekeeping resulting  
from opening the persistent store) before you got to initWithType.  
That's not an assumption I'd like to rely on.



___

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: Rotation in CAAnimation layers

2008-10-25 Thread douglas welton

do the following:

grab your polaroid camera (I'm old school).  go outside.  find a  
sundial.  take a picture. note the direction/appearance of the real  
shadow.  turn the photograph upside down.*


shadows belong to the layer, so if you rotate the layer, you also  
rotate the shadow - you do not change the position of the light  
source.  The shape of your drawing in the layer is not relevant!


If you want the shadow to simulate your light source staying in the  
same place, then animate the shadow offset at the same time as you  
rotate the layer.


something like this might work:

targetLayer.shadowOffset = normalOffset;
targetLayer.affineTransform = normalAffineTransform;
...
[CATransaction begin];

targetLayer.shadowOffset = newOffsetBy180Degrees;
targetLayer.affineTransform = 
newAffineTransformRotatedBy180Degrees;

[CATransactioncommit];

Note:  typed in e-mail... ymmv

regards,

douglas

*sell camera on ebay for $20.  sell upside-down polaroid at Christie's  
for millions and retire ;^}



On Oct 25, 2008, at 9:31 AM, DKJ wrote:


I do this with a CAAnimation layer myLayer:

myLayer.shadowOffset = CGSizeMake( 5.0, 5.0 );

and get a shadow on the upper and right edges. But when I rotate the  
layer 180 degrees, the shadow then appears on the lower and left  
edges. Real shadows don't do that.


If the object were circular, I'd just put another stationary layer  
underneath and attach the shadow to it. But with other shapes this  
won't work.


So finally, my question: Is there an easy way of calculating the  
position and appearance of the shadow for non-circular shapes? (By  
easy I mean one that I can just copy from somewhere.) If not I'll  
try to figure it out myself; but I don't want to re-invent the wheel.


dkj



On 24 Oct, 2008, at 18:11, douglas welton wrote:


On Oct 24, 2008, at 6:50 PM, DKJ wrote:

Is there an easy way to provide a realistic shadow for a (non- 
circular) layer rotating round the z-axis? (I know  
layer.rotateShadow = YES is too much to hope for.)


To get a realistic answer, it might help if you provide a little  
more specific information about 1) what you are trying to do, 2)  
what is not working and 3) what you have tried. (consult: http://www.catb.org/~esr/faqs/smart-questions.html 
)


regards,

douglas





Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.com



___

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 exit a thread help...

2008-10-25 Thread Tom Jones

Hello,
I'm writing a Foundation tool and I need to run a NSTask in a separate  
thread. I have it working but when the task completes the thread is  
still running. I tried issuing a [NSThread exit] but that did nothing.


What am I missing?

Thanks,
tom


This my main code

#import Foundation/Foundation.h
#import Threader.h
#import RunTask.h

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

Threader *oo = [[Threader alloc] init]; //Second Thread
RunTask *newRunTask = [[RunTask alloc] init]; // Thrid Thread

// Start second thread
[NSThread detachNewThreadSelector:@selector(entryPoint:) toTarget:oo
		   withObject:[NSArray  
arrayWithObjects:@SecondThread,@10,nil]];


	[NSThread detachNewThreadSelector:@selector(runSysProfiler:)  
toTarget:newRunTask withObject:nil];


for (;;) {
NSLog(@Main Thread is running...);
sleep(5);
}

[pool drain];
return 0;
}

@implementation RunTask

-(void) runSysProfiler:(id *)obj {

NSAutoreleasePool *newpool = [[NSAutoreleasePool alloc] init];

NSLog(@System Profiler Started, going to delay 10 seconds);
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]];
NSLog(@Thread delay done.);

NSTask *sysProfiler = [[NSTask alloc] init];
[swUpdate setLaunchPath:@/usr/sbin/system_profiler];
	[swUpdate setArguments:[NSArray  
arrayWithObjects:@SPHardwareDataType,nil]];


NSPipe *pipe;
pipe = [NSPipe pipe];
[swUpdate setStandardOutput: pipe];

NSFileHandle *file;
file = [pipe fileHandleForReading];

[sysProfiler launch];

NSData *data;
 data = [file readDataToEndOfFile];

NSString *string;
	string = [[NSString alloc] initWithData:data  
encoding:NSUTF8StringEncoding];


NSLog (@Hey, we got it...\n%@, string);
[newpool release];
}

@end
___

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: Controlling Preference Panel Installation

2008-10-25 Thread Nick Zitzmann


On Oct 25, 2008, at 8:48 AM, Antonio Ferraioli wrote:

I'd like to limit the panel installation to the curent user  
( Install for this user only)

avoiding the Install for all users of this computer option

do you know if it is possible to do this ?



It isn't. You'll have to use an alternate deployment method, such as a  
package, to do that.


Nick Zitzmann
http://www.chronosnet.com/



___

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: Controlling Preference Panel Installation

2008-10-25 Thread Clark Cox
On Sat, Oct 25, 2008 at 7:48 AM, Antonio Ferraioli
[EMAIL PROTECTED] wrote:
 Hello,

 I've built a preference panel that will be installed in System Preferences,

 I'd like to let the user install the panel by double clicking it,
 doing this the System Prenferences application asks
 how the panel will be installed
 -  Install for this user only
 -  Install for all users of this computer

 I'd like to limit the panel installation to the curent user ( Install for
 this user only)
 avoiding the Install for all users of this computer option

 do you know if it is possible to do this ?
 does it exist some property that I can assign to the Info.plist file of my
 preference panel

No, it isn't possible. Additionally, even if it were, there is nothing
to stop a user with admin rights from putting the preference pane in
/Library/PreferencePanes/, which is equivalent to the Install for all
users of this computer option.

-- 
Clark S. Cox III
[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: NSPersistentDocument: Settings (DepartmentsAndEmployees)

2008-10-25 Thread Jerry Krinock


On 2008 Oct, 25, at 9:51, Quincey Morris wrote:

you must force it to be registered (processPendingChanges) and then  
you can tell the undo manager to remove it (removeAllActions).


Thank you, Quincey, that makes sense.

I also have a more fundamental question.  Why must we override - 
initWithError:type: to initialize the 'department' ivar for new  
documents?  It seems like we're faking it.  Generally, best practice  
is to allocate objects on-demand.  And since good Cocoa citizens  
should be using getters, I propose instead alloc-init-setting it at  
the end of the getter -document implementation, after accessing the  
ivar and fetching it from the store have failed.


But when I tried that, a newly-created document didn't work (user  
could not type anything into any fields).  NSLogging tells me that my  
getter -document is not invoked during initialization and therefore  
the -department ivar does not get set.


Apparently, sometime after initializing a new document, Core Data's  
internal magic is directly accessing my 'document' ivar under the  
table (and finding nil), instead of using the getter.  How can I  
change my thinking to understand that this is expected behavior I need  
to design for?


Jerry

___

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]


CFPreferences and init.

2008-10-25 Thread Adam Penny

Hi there,

It's been a few days, actually been able to make some progress on my  
own for a change!


I've set up my initWithBundle method like this:

- (id)initWithBundle:(NSBundle *)bundle
{
if (![super initWithBundle:bundle]) return nil;
appID = CFSTR(uk.co.pennynet.Wopol);
	servers= (NSMutableArray *)  
CFPreferencesCopyAppValue( CFSTR(servers), appID);
	printers= (NSMutableArray *)  
CFPreferencesCopyAppValue( CFSTR(printers), appID);

broadcastIP= @255.255.255.255;
return self;
}
Happily, it's getting my preferences as expected and the bindings are  
filling them in in my table.


However, I was a bit concerned because if it can't find the servers or  
printers keys in the plist then my NSMutableArray servers and printers  
won't be allocated and initialized and it'll knacker everything else up.


I was thinking of doing something like this:
servers=[[NSMutableArray alloc]init];
if ('servers' key is in the plist and it's an array)
 {
 NSArray *serversInPlist=(NSArray *)  
CFPreferencesCopyAppValue( CFSTR(servers), appID);

 [servers addObjectsFromArray: serversInPlist];
 [serversInPlist release];
 }

My question is how do I do the checks for the if clause?

Thanks,

Adam
 
   
___


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: CFPreferences and init.

2008-10-25 Thread Kyle Sluder
On Sat, Oct 25, 2008 at 6:11 PM, Adam Penny [EMAIL PROTECTED] wrote:
 My question is how do I do the checks for the if clause?

The documentation says that if the key doesn't exist, the function
returns NULL.  So then you just check to see if your servers variable
is null.  The documentation also mentions using CFGetTypeID to
determine if a CFPropertyListRef is an array or some other type.  And
NSMutableArray is toll-free bridged to CFMutableArrayRef.  So:

servers = CFPreferencesCopyAppValue( CFSTR(servers), appID);
if(servers  CFGetTypeID(servers) == CFArrayGetTypeID())
{
  // woohoo!
}

--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]


Re: Disable Sorting in NSTableView

2008-10-25 Thread Grant Limberg

That did the trick!  Thanks!

On Oct 25, 2008, at 1:33 AM, Quincey Morris wrote:


On Oct 24, 2008, at 20:57, Grant Limberg wrote:

Is it possible to disable the user's ability to resort the rows in  
a table by clicking on the column header?  I have a table view that  
stores statistics in the order they are received by the program and  
shouldn't be resorted.  Is there a way to do this without removing  
the column headers?


It's not obvious, but the way to do it is to uncheck the creates  
sort descriptor binding of the column's Value binding.



___

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/grant 
%40glsoftware.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]


Debugging NSDistributedNotificationCenter

2008-10-25 Thread Jeff Johnson
I'm using NSDistributedNotificationCenter to deliver notifications  
from a helper application to the main application. I followed the  
instructions from http://developer.apple.com/technotes/tn2004/tn2124.html#SECFILES 
, i.e., sudo touch /var/log/do_dnserver_log and restart, but this  
doesn't seem to do anything. No file /var/log/dnserver.log ever gets  
created, and /var/log/do_dnserver_log remains empty. I tried  
creating /var/log/dnserver.log myself, but that doesn't help either.


Does distnoted debugging still work in Leopard? Or am I  
misunderstanding the relationship between this debugging facility and  
NSDistributedNotificationCenter?


-Jeff

___

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 do you use to make icons and similar?

2008-10-25 Thread Andrew Merenbach

On Oct 19, 2008, at 2:32 AM, Andy Lee wrote:


On Oct 19, 2008, at 5:20 AM, Roland King wrote:
I need a make a few icons and other graphics for my app, simple  
stuff like a small yellow triangle with an invisible background.  
I'm totally and completely graphically challenged which never  
helps. I can't find a simple (preferably free!) drawing program  
which will let me make stuff like this. What does everyone use for  
these things?


When the time comes to replace the ugly icons in my app, I plan to  
try NodeBox (I doubt I'll have the money to pay someone).  Daniel  
Jalkut got very nice results with it for his blog and for his  
FlexTime app, and it looks like a really fun way to learn Python  
while I'm at it:


http://www.red-sweater.com/blog/146/blog-redesign

--Andy



After reading the article, I decided the same thing and downloaded a  
copy of NodeBox.  Like Daniel Jalkut, I think that, while NodeBox has  
a way to go, it's very sophisticated and polished as-is.  I've never  
really used Python before -- no knowledge of syntax or the like --  
but, with some fiddling, have already come up with some cool icon  
ideas using it.  If anyone wants some bezier path rounded rectangle  
code I can provide it -- for some reason, although I'm using Leopard,  
I'm having trouble getting Leopard's rounded rectangle bezier path  
methods to work with it (I suspect that it was linked to an earlier  
SDK, although it's equally probably that I'm making a Python-newbie  
mistake of some sort).


Cheers,
Andrew


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]

Sizing strangeness in the land of NSDrawer

2008-10-25 Thread Luke Evans

Hello list denizens.

I've just created some UI with an NSDrawer attached to a regular  
window.  I've done this before a while back and everything worked  
fine.  I thought everything was fine this time too: the drawer opens  
on command, has the correct initial size, and behaves mostly normally  
except when I try to resize the main window (with the drawer open).   
The main window resizes just fine, but leaves the drawer exactly where  
is was (i.e. no effect on its size or position - i.e. because it is on  
the RHS of the window, it is left as an island if the window is made  
smaller horizontally, and covered up if the window is made bigger.   
When the window is resized (for instance, leaving the drawer  
isolated), it will move the drawer (as an island at a fixed offset)  
around with it when subsequently moved.  If you grab the draw to  
resize it (i.e. pull it 'out' further by the right hand edge), it will  
suddenly snap back to where it should be on the right side of the  
window.


The NSDrawer appears to have everything it needs, but there most be  
something internally preventing the parent window's resizing from  
getting propagated (... or something).


I have no delegate set on the NSDrawer, only contentView and  
parentView outlets are connected and working.  I just want default  
sizing behaviour, so don't have a need for the delegate notification  
(and assume everything should default without it).  I do have some  
minimum size constraints set on the NSDrawer object (set in IB 3), and  
these are reasonable and correctly adhered to when the drawer is  
opened and used.


My Main Window is not (to my knowledge) special.  There ought to be  
nothing that prevents normal messages going about their business -  
it's just a regular NSView hierachy.  I am using Core Animation layers  
in the hierarchy, and have a few sibling views therein deliberately  
overlapping others (causing a warning in IB).  Could it be that some  
issue propagating subview resizing in the Main Window would somehow  
prevent continuous resize messages from reaching the drawer's outer  
window?  That seems like a non-sequitur as the main window ought to be  
able to separately indicate its outer frame size changes to the  
drawer, irrespective of what is going on within its bounds.


Anyway, I'm stumped (for the moment) and thought I'd fish on the list  
for ideas!


-- Lwe

___

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: Sizing strangeness in the land of NSDrawer

2008-10-25 Thread Steven Riggs

Turn on garbage collection and see if it starts working.

-Steve

On Oct 25, 2008, at 9:06 PM, Luke Evans wrote:


Hello list denizens.

I've just created some UI with an NSDrawer attached to a regular  
window.  I've done this before a while back and everything worked  
fine.  I thought everything was fine this time too: the drawer opens  
on command, has the correct initial size, and behaves mostly  
normally except when I try to resize the main window (with the  
drawer open).  The main window resizes just fine, but leaves the  
drawer exactly where is was (i.e. no effect on its size or position  
- i.e. because it is on the RHS of the window, it is left as an  
island if the window is made smaller horizontally, and covered up if  
the window is made bigger.  When the window is resized (for  
instance, leaving the drawer isolated), it will move the drawer (as  
an island at a fixed offset) around with it when subsequently  
moved.  If you grab the draw to resize it (i.e. pull it 'out'  
further by the right hand edge), it will suddenly snap back to where  
it should be on the right side of the window.


The NSDrawer appears to have everything it needs, but there most be  
something internally preventing the parent window's resizing from  
getting propagated (... or something).


I have no delegate set on the NSDrawer, only contentView and  
parentView outlets are connected and working.  I just want default  
sizing behaviour, so don't have a need for the delegate notification  
(and assume everything should default without it).  I do have some  
minimum size constraints set on the NSDrawer object (set in IB 3),  
and these are reasonable and correctly adhered to when the drawer is  
opened and used.


My Main Window is not (to my knowledge) special.  There ought to be  
nothing that prevents normal messages going about their business -  
it's just a regular NSView hierachy.  I am using Core Animation  
layers in the hierarchy, and have a few sibling views therein  
deliberately overlapping others (causing a warning in IB).  Could it  
be that some issue propagating subview resizing in the Main Window  
would somehow prevent continuous resize messages from reaching the  
drawer's outer window?  That seems like a non-sequitur as the main  
window ought to be able to separately indicate its outer frame size  
changes to the drawer, irrespective of what is going on within its  
bounds.


Anyway, I'm stumped (for the moment) and thought I'd fish on the  
list for ideas!


-- Lwe

___

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/steven.riggs%40me.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: Sizing strangeness in the land of NSDrawer

2008-10-25 Thread Steven Riggs
Typo,  I meant  turn off garbage collection and see if it starts  
working.


 oops
-Steve

On Oct 25, 2008, at 9:06 PM, Luke Evans wrote:


Hello list denizens.

I've just created some UI with an NSDrawer attached to a regular  
window.  I've done this before a while back and everything worked  
fine.  I thought everything was fine this time too: the drawer opens  
on command, has the correct initial size, and behaves mostly  
normally except when I try to resize the main window (with the  
drawer open).  The main window resizes just fine, but leaves the  
drawer exactly where is was (i.e. no effect on its size or position  
- i.e. because it is on the RHS of the window, it is left as an  
island if the window is made smaller horizontally, and covered up if  
the window is made bigger.  When the window is resized (for  
instance, leaving the drawer isolated), it will move the drawer (as  
an island at a fixed offset) around with it when subsequently  
moved.  If you grab the draw to resize it (i.e. pull it 'out'  
further by the right hand edge), it will suddenly snap back to where  
it should be on the right side of the window.


The NSDrawer appears to have everything it needs, but there most be  
something internally preventing the parent window's resizing from  
getting propagated (... or something).


I have no delegate set on the NSDrawer, only contentView and  
parentView outlets are connected and working.  I just want default  
sizing behaviour, so don't have a need for the delegate notification  
(and assume everything should default without it).  I do have some  
minimum size constraints set on the NSDrawer object (set in IB 3),  
and these are reasonable and correctly adhered to when the drawer is  
opened and used.


My Main Window is not (to my knowledge) special.  There ought to be  
nothing that prevents normal messages going about their business -  
it's just a regular NSView hierachy.  I am using Core Animation  
layers in the hierarchy, and have a few sibling views therein  
deliberately overlapping others (causing a warning in IB).  Could it  
be that some issue propagating subview resizing in the Main Window  
would somehow prevent continuous resize messages from reaching the  
drawer's outer window?  That seems like a non-sequitur as the main  
window ought to be able to separately indicate its outer frame size  
changes to the drawer, irrespective of what is going on within its  
bounds.


Anyway, I'm stumped (for the moment) and thought I'd fish on the  
list for ideas!


-- Lwe

___

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/steven.riggs%40me.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: NSPersistentDocument: Settings (DepartmentsAndEmployees)

2008-10-25 Thread Jerry Krinock


On 2008 Oct, 25, at 13:01, Quincey Morris wrote:

Well, it's not clear what class your -document getter belongs to, or  
why you're expecting it to be referenced by code you didn't write.


Core Data knows nothing about documents. NSPersistentDocument  
merely wraps document behavior around Core Data.


I was assuming that Core Data would wrap around the document, not  
the other way around as you stated.


Probably one thing which misled me to this wrong idea was that the  
data model is named MyDocument.xcdatamodel.  But now I realize  
that's just a decoration and does not tie it to the MyDocument class  
in any way.  I changed the name to MyProject.xcdatamodel and  
everything still works.


For a new document, the Core Data object graph is empty, and there's  
no automatic hook in either Core Data to add objects to the initial  
object graph (i.e. the department object in your case). Normally,  
it's either done in initWithType: or by using prepares content  
automatically in an object/array/etc controller in the nib file.


Well, I did another experiment, which I shall not describe in detail.   
However, the results proved that no one is directly accessing the  
instance variable 'department' as I had assumed.  Indeed, it is the  
act of inserting a Department entity managed object into the managed  
object context (or, as you said, add objects to the initial object  
graph) that is necessary the new-document UI to work.


Thanks again, Quincey.

___

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: NSPersistentDocument: Settings (DepartmentsAndEmployees)

2008-10-25 Thread Jerry Krinock
I started wondering:  Since 'department' is in fact a managed object  
and can be fetched, why does MyDocument need it as an instance variable?


Answer: It doesn't!  I eliminated the declaration

NSManagedObject *department ;

and also I eliminated the -setDepartment: setter and all invocations  
of it.  Build, run, and everything works just fine! Whenever - 
[MyDocument department] is invoked (which does not happen very often,  
only when a document is saved), it fetches it from its managed object  
context.


Possibly, the 'department' ivar was introduced for efficiency, to  
avoid fetches.  That seems pretty silly in this case, since it only  
gets accessed when the document is saved, and only once.  Or maybe  
Apple just put it in there to make me think real hard and teach me a  
lesson.


So, in addition to Quincey's explanations, my lessons are:

1.  Filenames of data models are meaningless; if same name as a class,  
that is purely coincidental.  No connection between the two.


2.  Managed objects are supposed to be managed by Core Data.  Whenever  
you see an instance variable declared as a class based on  
NSManagedObject*, say Huh and ask Why?


___

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]


When does Cocoa get No more! from malloc?

2008-10-25 Thread Jerry Krinock
One of my users recently found conditions under the memory allocated  
by my app would become huge.  I fixed the problem, but I'm wondering  
why it behaved differently for he and I.


On his MacBook Pro with Intel Core 2 Duo, 2 GB RAM, and 250 GB hard  
drive with 160 GB free, it would crash after 4 minutes with this:


malloc: *** mmap(size=2097152) failed (error code=12)
*** error: can't allocate region

This crash occured within Cocoa's -[NSDictionary setObject:forKey:]  
method.


But on my Mac Mini with Intel Core 2 Duo, 2 GB RAM, and 120 GB hard  
drive with 25 GB free, all other apps became very slow after a few  
minutes, but my app would not crash, even after even after my app's VM  
had run up to 1.7 GB.


We're both running Mac OS 10.5.5.  Why did malloc say No more! on  
his Mac, but not on mine?


Jerry Krinock

___

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: When does Cocoa get No more! from malloc?

2008-10-25 Thread Ken Thomases

On Oct 25, 2008, at 11:48 PM, Jerry Krinock wrote:


Why did malloc say No more! on his Mac, but not on mine?


Because you didn't let yours run amok for long enough.

If your app is leaking memory on a (more or less) continuous basis, it  
will eventually get an error like your user got.  You just have to let  
it keep at it.


Of course, the precise method that fails will differ, depending on the  
precise sequence of events and allocations, etc.


Regards,
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]