Re: How do you get the OS X version number in C or C++?

2008-11-14 Thread Rob Keniger


On 15/11/2008, at 6:06 AM, Tom Fortmann wrote:

Is there a core foundation function for querying the Mac OS X  
operating
system name and version information?  The uname() API returns the  
Darwin
kernel version information, but I need to find the OS X 10.x.x  
information.



This is the way you should do it:

SInt32 majorVersion,minorVersion,bugFixVersion;

Gestalt(gestaltSystemVersionMajor, &majorVersion);
Gestalt(gestaltSystemVersionMinor, &minorVersion);
Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);

NSLog(@"Running on Mac OS X %d.%d. 
%d",majorVersion,minorVersion,bugFixVersion);


--
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: How do you get the OS X version number in C or C++?

2008-11-14 Thread Michael Ash
On Fri, Nov 14, 2008 at 3:27 PM, Sean McBride <[EMAIL PROTECTED]> wrote:
> On 11/15/08 1:48 AM, chaitanya pandit said:
>
>>+ (BOOL)MacOSTigerOrLower
>>{
>> UInt32 version;
>> return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==
>>noErr) && (version < 0x01050 );
>>}
>
> Gestalt() is a good approach, but never use gestaltSystemVersion.  See
> Gestalt.h for why.

I don't think you need to "never use" it. Its failure mode is fairly
benign and completely documented. If you're only interested in
checking for numbers under 9, such as in this case, then it works just
fine.

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]


Re: Unable to generate a PDF from textual data

2008-11-14 Thread Michael Ash
On Fri, Nov 14, 2008 at 3:34 PM, Lee, Frederick (Ric)
<[EMAIL PROTECTED]> wrote:
> Thanks from a neophyte.
> Yes...
> I had hoped that I could 'magically' create a PDF from a text string.
> I noticed that you can select 'text' from a PDF document.  I thought you
> could likewise create a PDF from text (NSString).

Well you certainly can create a PDF from text, just not with a single
text-to-PDF call like you were trying to do. The trick is that there's
not a single obvious way to convert text to PDF. PDF allows a lot of
choices in terms of page size, font, layout, and other decisions, and
you have to make those decisions when creating the PDF.

> BTW: My client wanted to render text as a PDF on his iPhone.

That seems like an odd choice. The nature of PDF (no ability to reflow
text, fixed page size) is such that it's a rather poor fit for the
iPhone. HTML would make a lot more sense to me, at least.

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]


Animation And Core Data

2008-11-14 Thread ChrisOutwin
I would like to use the persistence of Core Data to save animation  
properties associated with my model objects.  For instance, previously  
created layers would reappear in a table  along with their associated  
filter, Z-order, etc.


Is any example available?
Do I have to abandon Core Data to use NSCoder / NSCoding?

Thank you,
Chris Outwin
___

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, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Steve Steinitz

Hi Brad,

I couldn't grasp from a quick skim of your post whether types are
related to categories in your model, ie. category <-->> type.  
If so,

I'd say keep trying to do it with bindings -- it will work.

If not, I had a similar scenario where I ended up creating a custom
NSArrayController, to populate the popup, based on mmalc's Filtering
Controller sample.  Mine responded to a change of another 
popup.  In
your case, you need to respond to a changed selection in a list 
-- I

haven't worked out a good way to do that.

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]


Re: NSManagedObjectContextObjectsDidChangeNotification

2008-11-14 Thread Jerry Krinock


On 2008 Nov, 14, at 18:25, Jim Correia wrote:

That's hard to answer without knowing a bit more about what it is  
you are doing in response to the notification.


(For example, it might be that there is a more appropriate solution  
to the problem you are trying to solve.)


Thank you, Jim.  Indeed that's a good question.  So I've conjured up  
an easy-to-understand example:


I have an NSPersistentDocument representing a branch of a Public  
Library.  Its managed object context contains objects of class/entity  
Book.  Each Book has, among other attributes, an ISBN.


I sometimes need to know about duplicate books.  But most of the  
changes are just rearranging books on the shelves, and enumerating  
through all books looking for a duplicate is expensive.  So instead, I  
observe NSManagedObjectContextObjectsDidChangeNotification for any  
change that is either insertion or deletion of a Book, or a change to  
the ISBN attribute of a Book.  When such a change occurs, I set a flag  
indicating that either a new duplicate may be present, or a duplicate  
may have gone away.


But an NSPersistentDocument only has one managed object context.  So,  
along with the Books, this managed object context also contains a  
Configuration object which contains hours of operation, etc. and a  
Staff object which contains Employees, etc.


So, you see the first thing I need to do when I receive a  
NSManagedObjectContextObjectsDidChangeNotification is to enumerate  
through userInfo's insertedObjects and updatedObjects, and segregate  
out those objects which are of class/entity Book.


Similarly I might be watching the 'salary' attributes of Employee  
objects to determine, for example, if the Library might be over budget.


Since I wrote the original post I've completed and partially tested  
the necessary code and pasted it in below.  It's not horrendous, but  
it just seems odd to me that  
NSManagedObjectContextObjectsDidChangeNotification does not provide - 
userInfo in a more immediately useful package.


Jerry


/ NSArray+Segregate.h

#import 

@interface NSArray (Segregate)

/*!
 @brief   Copies each element of the receiver into an array containing
 other elements of the same class and assembles the resulting arrays
 into a dictionary.

 @detail  The keys in the dictionary are strings, class names obtained
 by using NSStringFromClass().

 This method is designed so that it may be invoked in succession upon
 different arrays with the same dictionary argument.  In
 the end, the dictionary will contain one key/value pair for each
 class of object found in all of the receiver arrays.

 @param   dic  A mutable dictionary to which the segregated objects  
will

 be added.
*/
- (void)segregateByClassIntoDictionary:(NSMutableDictionary*)dic ;

@end


/ NSArray+Segregate.m

#import "NSArray+Segregate.h"


@implementation NSArray (Segregate)

- (void)segregateByClassIntoDictionary:(NSMutableDictionary*)dic {
for (id object in self) {
Class class = [object class] ;
// Since a Class is not an object and does not conform to  
NSCopying,

// we cannot use it as a key.
NSString* key = NSStringFromClass(class) ;
NSMutableArray* bin = [dic objectForKey:key] ;
if (!bin) {
bin = [[NSMutableArray alloc] init] ;
[dic setObject:bin
forKey:key] ;
[bin release] ;
}
[bin addObject:object] ;
}
}

@end


/ SomeOtherFile.m



// Send NSManagedObjectContextObjectsDidChangeNotifications to this  
selector:


- (void)modelChanged:(NSNotification*)notification {
NSArray* insertedObjects = [[notification userInfo]  
objectForKey:NSInsertedObjectsKey] ;
NSArray* deletedObjects = [[notification userInfo]  
objectForKey:NSDeletedObjectsKey] ;
NSArray* updatedObjects = [[notification userInfo]  
objectForKey:NSUpdatedObjectsKey] ;


NSMutableDictionary* objectsByClass = [[NSMutableDictionary  
alloc] init] ;


[insertedObjects segregateByClassIntoDictionary:objectsByClass] ;
[deletedObjects segregateByClassIntoDictionary:objectsByClass] ;
[updatedObjects segregateByClassIntoDictionary:objectsByClass] ;


for (NSString* className in objectsByClass) {
if ([className isEqualToString:@"Book" {

}
else if ([className isEqualToString:@"Employee" {

}




___

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: NSDistantObject in Core Data

2008-11-14 Thread Bridger Maxwell
>
>
> One answer is to use a transient attribute to represent the relationship.
> Set the attribute's "kind" to Undefined, and use a custom NSManagedObject
> subclass. Define an instance variable in the subclass to hold the actual
> NSDistantObject pointer, and write custom accessors to get and manipulate
> its value:
>
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#/
> /apple_ref/doc/uid/TP40002154-SW14
>
>
That worked perfectly. Thanks!
___

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: NSManagedObjectContextObjectsDidChangeNotification

2008-11-14 Thread Jim Correia

On Nov 14, 2008, at 8:37 PM, Jerry Krinock wrote:

NSManagedObjectContextObjectsDidChangeNotification gives me a  
userInfo dictionary that segregates changes into the type of change:  
inserted, updated, deleted.


Well, in my app, and it seems that in any real-life app, the more  
important segregation, and the dependency in the first branching of  
my code, is the object class or entity, not the type of change.


For example, if there has been any type of change to an Employee, I  
need to do something completely different than if there is any type  
of change to a Fruit.


So, in my handler method for  
NSManagedObjectContextObjectsDidChangeNotification, I must first  
enumerate through the userInfo dictionaries and make a new  
dictionary where the keys are object class or entity instead.


Am I doing something wrong?


That's hard to answer without knowing a bit more about what it is you  
are doing in response to the notification.


(For example, it might be that there is a more appropriate solution to  
the problem you are trying to solve.)


Jim

___

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]


Calling a script with parameters failing with error -1708

2008-11-14 Thread Ken Tozier

Hi

I've been trying off and on for a couple of days to run a script that  
requires parameters. The first problem I found was that NSAppleScript  
has a bug that wipes out QuarkXPress's event dictionary when loading  
scripts containing Quark commands. Someone pointed me to the OSAScript  
framework which doesn't have this bug, but I'm getting -1708  
(errAEEventNotHandled) errors.


My code is running as a Quark XTension so I may be setting up the  
"targetAddress" incorrectly. Could someone take a look at the  
following snippet and point out where I'm messing up?


Thanks in advance

Here's what the NSLogs print to the console

> targetAddress: 
> event: [ 'utxt'("Thursday, November 20, 2008") ] }>
> subroutineDescriptor: 'utxt'("replacefoliodates")>
> argsDescriptor: November 20, 2008") ]>

> result: (null)
> error: {
   OSAScriptErrorNumber = -1708;
} running script: AA_01-05


And here's the code:
Note: the "aeDescriptor" method in the line [inArguments aeDescriptor]  
is a category that coerces common types like NSArray, NSDictionaries,  
NSNumbers etc... into AEDescriptors.


// NOTE this method is a category on OSAScript
- (NSAppleEventDescriptor *) executeHandler: (NSString *) inHandler
withArguments: (id) inArguments
errorInfo: (NSDictionary **) inErrorInfo
{
int pid 
= [[NSProcessInfo processInfo] 
processIdentifier];

	NSAppleEventDescriptor		*targetAddress			= [[NSAppleEventDescriptor  
alloc] initWithDescriptorType: typeKernelProcessID


bytes: &pid

length: sizeof(pid)];


	NSAppleEventDescriptor		*event	= [[NSAppleEventDescriptor alloc]  
initWithEventClass: typeAppleScript


eventID: keyASSubroutineName

targetDescriptor: targetAddress

returnID: kAutoGenerateReturnID

transactionID: 
kAnyTransactionID],
*subroutineDescriptor	= [NSAppleEventDescriptor  
descriptorWithString: [inHandler lowercaseString]],

*argsDescriptor 
= [inArguments aeDescriptor];

NSAppleEventDescriptor  *result;

NSLog(@"- targetAddress: %@", targetAddress);
NSLog(@"- event: %@", event);
NSLog(@"- subroutineDescriptor: %@", subroutineDescriptor);
NSLog(@"- argsDescriptor: %@", argsDescriptor);

	// Set up an AppleEvent descriptor containing the subroutine  
(handler) name

[event setParamDescriptor: subroutineDescriptor forKeyword: 'snam'];

// Add the provided arguments to the handler call
[event setParamDescriptor: argsDescriptor forKeyword: keyDirectObject];

// Execute the handler
result = [self executeAppleEvent: event error: inErrorInfo];

[targetAddress release];
[event release];

NSLog(@"- result: %@", result);


return result;
}
___

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]


NSManagedObjectContextObjectsDidChangeNotification

2008-11-14 Thread Jerry Krinock
NSManagedObjectContextObjectsDidChangeNotification gives me a userInfo  
dictionary that segregates changes into the type of change: inserted,  
updated, deleted.


Well, in my app, and it seems that in any real-life app, the more  
important segregation, and the dependency in the first branching of my  
code, is the object class or entity, not the type of change.


For example, if there has been any type of change to an Employee, I  
need to do something completely different than if there is any type of  
change to a Fruit.


So, in my handler method for  
NSManagedObjectContextObjectsDidChangeNotification, I must first  
enumerate through the userInfo dictionaries and make a new dictionary  
where the keys are object class or entity instead.


Am I doing something wrong?

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: NSDocument annoying warning

2008-11-14 Thread Mike Abdullah
I would suggest that you rearrange your code slightly to match how the  
document architecture expects it to operate.


Move your package-modification code to be part of the -writeToURL: or - 
saveToURL: method of your document subclass. Then, when opening a  
document, check if the upgrade needs doing, and if so, call the  
appropriate document -save method.


Mike.

On 14 Nov 2008, at 23:21, Randall Meadows wrote:


The NSDocument class reference contains this note:

"As of Mac OS X v10.5, this method checks to see if the document's  
file has been modified since the document was opened or most  
recently saved or reverted, in addition to the checking for file  
moving, renaming, and trashing that it has done since Mac OS X  
v10.1. When it senses file modification it presents an alert telling  
the user "This document’s file has been changed by another  
application since you opened or saved it,” giving them the choice of  
saving or not saving. For backward binary compatibility this is only  
done in applications linked against Mac OS X v10.5 or later."


I am getting that alert, since when I now open a document (which is  
actually a bundle) in this application, I create a new file in the  
document's bundle, indicating that it is a "new and improved"  
version of the file; this new file is a modified version of another  
file in the bundle, which I leave in place so as to maintain  
backward compatibility for older versions of this application  
(deployment at the client's site will not be 100%, and people using  
both old and new versions will be opening documents, and I want them  
both to continue working).


Now, that alert is actually a lie, since it isn't "another  
application" that made the change.  My application did it on  
purpose, and I want those changes to stick.


In addition, when the app opens the document, it changes the  
extension to indicate that this particular document is in use (since  
it's typically opened from a server, and multiple users could be  
working in the same folder, and we use this as an alert to the 2nd  
user that someone's already working on this particular file.  As of  
10.5, we now get a warning dialog upon a save attempt that "This  
document has been renamed to foobar.newextension".  Yes, I know, the  
app did that.


Is there something I can do to tell NSDocument (or whomever) that  
these changes that it thinks are made by another application are on  
purpose, and that it needs to keep its opinions regarding them to  
itself?  If  ends up marking the file as "dirty", that's  
fine by me.  I'll go continue scouring the docs, but if someone has  
a pointer, I'd appreciate it.



Thanks!
randy___

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: Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread Joel Norvell
On Nov 14, 2008, at 12:18 PM, Joel Norvell wrote:

> > I want to modify the PDF Annotation Editor so that it will tab from  
> > annotation-to-annotation in "edit mode," just like it does in "test  
> > mode."
> > 
> > And since PDFAnnotation isn't an NSView subclass, I'll have to  
> > create a mechanism that "hears" tab events and then updates the  
> > current annotation "by hand."

On Nov 14, 2008, at 12:28 PM, John Calhoun wrote:

> My first thought would be to go a different route ... grab keyDown's  
> in your PDFView subclass and keep track of the current annotation with  
> "focus".  Manually advance the focus by going round-robin threough the  
> annotaions on the page.  If you can do something more sophisticated  
> though, go for it. :-)

John,

I'd wrongly convinced myself that your approach was problematic; 
but it is exactly the right one!

Thank you very much! 

Joel




  
___

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, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Quincey Morris

On Nov 14, 2008, at 15:21, Brad Gibbs wrote:

My categories Popup Button (categoriesPUB) is bound to the  
categories array controller as follows:

Content.arrangedObjects
ContentValues.arrangedObjects.displayName
I've tried a variety of bindings for the popup button's  
selectedObject binding, but I'm not sure how to bind it in this  
instance.


If you care what the category categoriesPUB shows initially, you're  
going to have to have a "currentCategory" property on File's Owner and  
bind the buttons's Selected Object to that. You would change  
currentCategory yourself (KVO-compliantly, of course) whenever the  
user chooses a new product, and let the popup button binding change it  
when the user chooses a new category.


If you're going to have a "currentCategory" property, then you can  
bind typesPUB's content to File's Owner.currentCategory.children and  
everything should work. :)


I tried binding the typesAC's contentSet to File's  
Owner.categoriesPUB.selectedItem.representedObject.children

but nothing showed up in the typesPUB.


Was anything actually selected in categoriesPUB when you looked at  
typesPUB?


To debug something like that, you just have to go key by key, perhaps  
writing a line of code to fetch values so that you check them in the  
debugger to make sure what you expect.


Also, make sure you check the log for error messages. Mysterious lack  
of working is often accompanied by a useful message.



___

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: NSDocument annoying warning

2008-11-14 Thread Quincey Morris

On Nov 14, 2008, at 15:21, Randall Meadows wrote:

Is there something I can do to tell NSDocument (or whomever) that  
these changes that it thinks are made by another application are on  
purpose, and that it needs to keep its opinions regarding them to  
itself?  If  ends up marking the file as "dirty", that's  
fine by me.  I'll go continue scouring the docs, but if someone has  
a pointer, I'd appreciate it.


I think you can just call -[NSDocument setFileModificationDate:] after  
you've modified the file yourself, and that warning will go away.


For changing the extension, you could try -[NSDocument setFileURL:]  
after you change the extension (both to and from the temporary one).  
You might also have to override -[NSDocument displayName] if you don't  
want to show the temporary extension in the window title, but that's  
purely cosmetic.




___

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: NSDocument annoying warning

2008-11-14 Thread Randall Meadows

On Nov 14, 2008, at 4:21 PM, Randall Meadows wrote:

In addition, when the app opens the document, it changes the  
extension to indicate that this particular document is in use (since  
it's typically opened from a server, and multiple users could be  
working in the same folder, and we use this as an alert to the 2nd  
user that someone's already working on this particular file.  As of  
10.5, we now get a warning dialog upon a save attempt that "This  
document has been renamed to foobar.newextension".  Yes, I know, the  
app did that.


I guess I should point out that we've been living with this for a  
while now, and it's not that big a deal (unlike the other problem,  
which is causing data loss), but since I was asking about the other  
anyway, if there's a way around it, that'd be nice, too.



randy

___

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, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Brad Gibbs

Thanks for the thoughts, Quincey, but I couldn't make that work.
I have a categoriesAC which is bound to File's Owner's MOC and set to  
Entity mode for Category.


My categories Popup Button (categoriesPUB) is bound to the categories  
array controller as follows:

Content.arrangedObjects
ContentValues.arrangedObjects.displayName
I've tried a variety of bindings for the popup button's selectedObject  
binding, but I'm not sure how to bind it in this instance.
I tried binding the typesAC's contentSet to File's  
Owner.categoriesPUB.selectedItem.representedObject.children

but nothing showed up in the typesPUB.




Re: Core Data, Filtering by PopUps & Bindings Confusion
FROM : Quincey Morris
DATE : Fri Nov 14 22:31:26 2008

On Nov 14, 2008, at 12:06, Brad Gibbs wrote:

> I've been using Jonathan Dann's excellent Core Data Sorted sample
> code to create an outline view consisting of two concrete entities
> -- Categories and Types (each parent Category can have an unlimited
> number of children types).  The only real adjustment I've made to
> his code is to put the parent relationship in the Category entity
> and the children relationship in the Type entity.  I've also
> modified the indexPath of the addGroup method so that categories are
> always root objects.
>
> The outline view seems to be working fine.  I'm using the addGroup
> method to add categories and addLeaf to add types.  This outline
> view is in a preferences window in my app.
>
> This section of the app is meant to be a product library.  Users
> will be able to sort and search by category or type.  When adding a
> new product, a type is assigned to the product, using the selected
> value of a popup button.  I'd like to limit the number of types in
> that popup button by using a category popup button.  In other words:
>
> 1.  User indicated s/he wants to add a new product
> 2.  User selects a category from a popbutton menu
> 3.  App loads the selected category's types in the the types popup
> button
> 4.  User selects a type and the type is assigned to the type
> relationship for the product being created or edited.
>
> I've got two array controllers in my nib file -- one for categories
> and another for types.  I've tried just about every combination of
> bindings I can imagine, but I can't get the types popup button to
> limit itself to the types associated with the selected category --
> at best it either displays all types of every category or it
> populates the types popup menu for a selected category but doesn't
> update itself when a different category is selected.
>
> Should I be using a fetch request or a filter predicate instead?  If
> bindings is the right approach, could someone describe the bindings
> that need to be made?


I haven't tried this, but if I understand the setup, the current
Category would be available from the popup button as
button.selectedItem.representedObject, assuming the button was bound
to a Categories NSArrayController which itself was bound to the
categories.

Therefore, your Types array controller would be need to be bound to
button.selectedItem.representedObject.types, and the only way I know
to do that is to add the button as an outlet on the file's owner, so
the actual binding is to File's
Owner.button.selectedItem.representedObject.types (or if there's a
more direct way, I'd be interested to know what it is).

HTH
___

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]


NSDocument annoying warning

2008-11-14 Thread Randall Meadows

The NSDocument class reference contains this note:

"As of Mac OS X v10.5, this method checks to see if the document's  
file has been modified since the document was opened or most recently  
saved or reverted, in addition to the checking for file moving,  
renaming, and trashing that it has done since Mac OS X v10.1. When it  
senses file modification it presents an alert telling the user "This  
document’s file has been changed by another application since you  
opened or saved it,” giving them the choice of saving or not saving.  
For backward binary compatibility this is only done in applications  
linked against Mac OS X v10.5 or later."


I am getting that alert, since when I now open a document (which is  
actually a bundle) in this application, I create a new file in the  
document's bundle, indicating that it is a "new and improved" version  
of the file; this new file is a modified version of another file in  
the bundle, which I leave in place so as to maintain backward  
compatibility for older versions of this application (deployment at  
the client's site will not be 100%, and people using both old and new  
versions will be opening documents, and I want them both to continue  
working).


Now, that alert is actually a lie, since it isn't "another  
application" that made the change.  My application did it on purpose,  
and I want those changes to stick.


In addition, when the app opens the document, it changes the extension  
to indicate that this particular document is in use (since it's  
typically opened from a server, and multiple users could be working in  
the same folder, and we use this as an alert to the 2nd user that  
someone's already working on this particular file.  As of 10.5, we now  
get a warning dialog upon a save attempt that "This document has been  
renamed to foobar.newextension".  Yes, I know, the app did that.


Is there something I can do to tell NSDocument (or whomever) that  
these changes that it thinks are made by another application are on  
purpose, and that it needs to keep its opinions regarding them to  
itself?  If  ends up marking the file as "dirty", that's  
fine by me.  I'll go continue scouring the docs, but if someone has a  
pointer, I'd appreciate it.



Thanks!
randy___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Tom Fortmann
I'm an idiot!  I was trying to include gestalt.h directly.  Simply including
the  header works like a champ.


-Original Message-
From: Sean McBride [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 14, 2008 3:17 PM
To: Tom Fortmann; 'chaitanya pandit'
Cc: cocoa-dev@lists.apple.com
Subject: Re: How do you get the OS X version number in C or C++?

On 11/14/08 2:53 PM, Tom Fortmann said:

>What framework do I include in my Xcode project to pull in Gestalt?  I've
>tries CoreServices, Carbon and Cocoa.

In Xcode, option-double-click the word "Gestalt" (or any API), this will
open the docs for that API.  Scroll to the very top, you'll see:

Framework CoreServices/CoreServices.h

That's what you need to include, and that's which framework you should
link to.

-- 

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


___

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, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Quincey Morris

On Nov 14, 2008, at 12:06, Brad Gibbs wrote:

I've been using Jonathan Dann's excellent Core Data Sorted sample  
code to create an outline view consisting of two concrete entities  
-- Categories and Types (each parent Category can have an unlimited  
number of children types).  The only real adjustment I've made to  
his code is to put the parent relationship in the Category entity  
and the children relationship in the Type entity.  I've also  
modified the indexPath of the addGroup method so that categories are  
always root objects.


The outline view seems to be working fine.  I'm using the addGroup  
method to add categories and addLeaf to add types.  This outline  
view is in a preferences window in my app.


This section of the app is meant to be a product library.  Users  
will be able to sort and search by category or type.  When adding a  
new product, a type is assigned to the product, using the selected  
value of a popup button.  I'd like to limit the number of types in  
that popup button by using a category popup button.  In other words:


1.  User indicated s/he wants to add a new product
2.  User selects a category from a popbutton menu
3.  App loads the selected category's types in the the types popup  
button
4.  User selects a type and the type is assigned to the type  
relationship for the product being created or edited.


I've got two array controllers in my nib file -- one for categories  
and another for types.  I've tried just about every combination of  
bindings I can imagine, but I can't get the types popup button to  
limit itself to the types associated with the selected category --  
at best it either displays all types of every category or it  
populates the types popup menu for a selected category but doesn't  
update itself when a different category is selected.


Should I be using a fetch request or a filter predicate instead?  If  
bindings is the right approach, could someone describe the bindings  
that need to be made?


I haven't tried this, but if I understand the setup, the current  
Category would be available from the popup button as  
button.selectedItem.representedObject, assuming the button was bound  
to a Categories NSArrayController which itself was bound to the  
categories.


Therefore, your Types array controller would be need to be bound to  
button.selectedItem.representedObject.types, and the only way I know  
to do that is to add the button as an outlet on the file's owner, so  
the actual binding is to File's  
Owner.button.selectedItem.representedObject.types (or if there's a  
more direct way, I'd be interested to know what it is).


HTH



___

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: Distributed Objects Performance

2008-11-14 Thread Seth Willits

On Nov 14, 2008, at 2:40 AM, Jean-Daniel Dupas wrote:

I would be curious to know how you reached 50MB/sec on a LAN that  
has a theorical limit of 12.5MB/sec.




That's a good question, now that I think about it. :-p

Apparently I *am* plugged into the gigabit switch...

Either way, any self-respecting computer network is gigabit these  
day ;-)



--
Seth Willits



___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Sean McBride
On 11/14/08 2:53 PM, Tom Fortmann said:

>What framework do I include in my Xcode project to pull in Gestalt?  I've
>tries CoreServices, Carbon and Cocoa.

In Xcode, option-double-click the word "Gestalt" (or any API), this will
open the docs for that API.  Scroll to the very top, you'll see:

Framework CoreServices/CoreServices.h

That's what you need to include, and that's which framework you should
link to.

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Nick Zitzmann


On Nov 14, 2008, at 1:53 PM, Tom Fortmann wrote:

What framework do I include in my Xcode project to pull in Gestalt?   
I've

tries CoreServices, Carbon and Cocoa.



It's in the CoreServices umbrella framework, but just linking to the  
Cocoa or Carbon frameworks and importing their master header ought to  
be enough... Are you having trouble getting it to build?


Nick Zitzmann


___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Tom Fortmann
What framework do I include in my Xcode project to pull in Gestalt?  I've
tries CoreServices, Carbon and Cocoa.


-Original Message-
From: Sean McBride [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 14, 2008 2:27 PM
To: chaitanya pandit; Tom Fortmann
Cc: cocoa-dev@lists.apple.com
Subject: Re: How do you get the OS X version number in C or C++?

On 11/15/08 1:48 AM, chaitanya pandit said:

>+ (BOOL)MacOSTigerOrLower
>{
> UInt32 version;
> return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==  
>noErr) && (version < 0x01050 );
>}

Gestalt() is a good approach, but never use gestaltSystemVersion.  See
Gestalt.h for why.

-- 

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


___

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: Where does stdout go in an ordinary Cocoa application?

2008-11-14 Thread Karan, Cem (Civ, ARL/CISD)
I like this method the best; there is (potentially) a lot of output, and
this is probably the cleanest method.  Thanks!

Thanks,
Cem Karan 

> -Original Message-
> From: Scott Ribe [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 14, 2008 11:23 AM
> To: Karan, Cem (Civ, ARL/CISD); cocoa-dev@lists.apple.com
> Subject: Re: Where does stdout go in an ordinary Cocoa application?
> 
> Open Console.app. You should see your log messages, mixed in 
> with others...
> 
> Or close stdout and reopen to wherever you want. (See fclose 
> & fdup...)
> 
> --
> Scott Ribe
> [EMAIL PROTECTED]
> http://www.killerbytes.com/
> (303) 722-0567 voice
> 
> 
> 
___

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: Cocoa and NSLog

2008-11-14 Thread Tommy Nordgren


On 10 nov 2008, at 07.16, Marcus wrote:



9 nov 2008 kl. 23.03 skrev Tommy Nordgren:


Is it possible to open an Additional file for use by logging in Cocoa
(I want it to contain ONLY the info logged from my App)


You can do that by just redirect standard error to a file. Since  
each process has their own set of file descriptors it will only  
affect your application.


int fd = creat ("/Users/marcus/my_log", S_IRUSR | S_IWUSR | S_IRGRP  
| S_IROTH);

close (STDERR_FILENO);
dup (fd);
close (fd);
NSLog(@"this will be written to my_log");

Marcus


	The specified method don't work. The default console log don't get a  
copy this way.
	A similar methods works if I forks, and pipes standard error into the  
tee command.
	I had really hoped there would be a method to set up the standard  
error fd to

echo it's data to multiple file descriptors in my process.

--
Skinheads are so tired of immigration, that they are going to move to  
a country that don't accept immigrants!

Tommy Nordgren
[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: Notifying that a TextView's content has been changed?

2008-11-14 Thread Jean-Nicolas Jolivet

Thanks a lot, that did the trick!


On 14-Nov-08, at 3:29 PM, Douglas Davidson wrote:



On Nov 14, 2008, at 12:22 PM, chaitanya pandit wrote:

Try posting a NSTextDidChangeNotification with your text view as  
the object, after you do setString:


That's probably not the best idea.  If you want to fully integrate  
your programmatic changes with user text changes, including undo and  
notifications, call -shouldChangeTextInRange:replacementString:  
before making the change, and if the value is YES, make the change,  
then call -didChangeText.


Douglas Davidson



Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.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: Unable to generate a PDF from textual data

2008-11-14 Thread Lee, Frederick (Ric)
Thanks from a neophyte.
Yes...
I had hoped that I could 'magically' create a PDF from a text string.
I noticed that you can select 'text' from a PDF document.  I thought you
could likewise create a PDF from text (NSString).

BTW: My client wanted to render text as a PDF on his iPhone.

Ric.

-Original Message-
From: David Duncan [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 14, 2008 1:05 PM
To: Lee, Frederick (Ric)
Cc: cocoa-dev@lists.apple.com
Subject: Re: Unable to generate a PDF from textual data

On Nov 14, 2008, at 10:16 AM, Lee, Frederick (Ric) wrote:

>CFDataRef faxMsgData = (CFDataRef)[[self.faxHistoryItemDict  
> objectForKey:@"msg"] dataUsingEncoding: NSUTF8StringEncoding];


This is not PDF data, this is just text.  
CGPDFDocumentCreateWithProvider() expects valid PDF data to be pulled  
from the data provider (and thus from the data object your passing).

If you need to create PDF data, then you will need to use PDFKit or  
Core Graphics to create valid PDF data by drawing the text strings  
into a pdf context. Then you can get PDF data to do additional work  
with (including creating a CGPDFDocument with the PDF data in it).
--
David Duncan
Apple DTS Animation and Printing

___

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: Notifying that a TextView's content has been changed?

2008-11-14 Thread Jean-Nicolas Jolivet

Hmm I tried, unfortunately it is not working

I also tried [self willChangeValueForKey:@"myTextView"];

it was a random guess but it didn't work either...


On 14-Nov-08, at 3:22 PM, chaitanya pandit wrote:

Try posting a NSTextDidChangeNotification with your text view as the  
object, after you do setString:


On 15-Nov-08, at 1:23 AM, Jean-Nicolas Jolivet wrote:

I have a TextView set up so its data is bound to my User Defaults  
controller so that its content is saved when I press a button...


If I enter some text manually and click on my "Save" button (the  
one that saves the preference) everything goes well, however, if I  
set some text to my TextView programatically, via its outlet like  
this:


[myTextView setString:@"Some text"];

and then click save... the User Default are not saved...

somehow it seems that the text view isn't "aware" that its content  
has changed because, if I set its text programatically, and then  
actually go in the text view and insert some more text THEN click  
save, it works...


It only fails when the textview's content has been set  
programatically only but not been touched by the user...


Any help would be appreciated


Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.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/chaitanya%40expersis.com

This email sent to [EMAIL PROTECTED]




Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.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: Notifying that a TextView's content has been changed?

2008-11-14 Thread Douglas Davidson


On Nov 14, 2008, at 12:22 PM, chaitanya pandit wrote:

Try posting a NSTextDidChangeNotification with your text view as the  
object, after you do setString:


That's probably not the best idea.  If you want to fully integrate  
your programmatic changes with user text changes, including undo and  
notifications, call -shouldChangeTextInRange:replacementString: before  
making the change, and if the value is YES, make the change, then call  
-didChangeText.


Douglas Davidson

___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Jesper Storm Bache
gestaltSystemVersion is not the best way to do it (and it caused  
problems in 10.4.10 and up).

As the documentation in Gestalt.h states:
"... A better way to get version information on Mac OS X would be to  
use the new gestaltSystemVersionMajor, gestaltSystemVersionMinor, and  
gestaltSystemVersionBugFix selectors..."

Jesper

On Nov 14, 2008, at 12:18 PM, chaitanya pandit wrote:


+ (BOOL)MacOSTigerOrLower
{
UInt32 version;
return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==
noErr) && (version < 0x01050 );
}


On 15-Nov-08, at 1:36 AM, Tom Fortmann wrote:


Is there a core foundation function for querying the Mac OS X
operating
system name and version information?  The uname() API returns the
Darwin
kernel version information, but I need to find the OS X 10.x.x
information.



Tom Fortmann

Xcape Solutions

___

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/chaitanya%40expersis.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/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: Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread John Calhoun

On Nov 14, 2008, at 12:18 PM, Joel Norvell wrote:
I want to modify the PDF Annotation Editor so that it will tab from  
annotation-to-annotation in "edit mode," just like it does in "test  
mode."

:
And since PDFAnnotation isn't an NSView subclass, I'll have to  
create a mechanism that "hears" tab events and then updates the  
current annotation "by hand."


My first thought would be to go a different route ... grab keyDown's  
in your PDFView subclass and keep track of the current annotation with  
"focus".  Manually advance the focus by going round-robin threough the  
annotaions on the page.  If you can do something more sophisticated  
though, go for it. :-)


John Calhoun—___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Sean McBride
On 11/15/08 1:48 AM, chaitanya pandit said:

>+ (BOOL)MacOSTigerOrLower
>{
> UInt32 version;
> return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==
>noErr) && (version < 0x01050 );
>}

Gestalt() is a good approach, but never use gestaltSystemVersion.  See
Gestalt.h for why.

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Randall Meadows

On Nov 14, 2008, at 1:06 PM, Tom Fortmann wrote:

Is there a core foundation function for querying the Mac OS X  
operating
system name and version information?  The uname() API returns the  
Darwin
kernel version information, but I need to find the OS X 10.x.x  
information.


If nothing else, you can use an NSTask to execute "sw_vers" with the  
appropriate option (which, in this case is -productVersion I think;  
see 'man sw_vers' for details).

___

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: Notifying that a TextView's content has been changed?

2008-11-14 Thread chaitanya pandit
Try posting a NSTextDidChangeNotification with your text view as the  
object, after you do setString:


On 15-Nov-08, at 1:23 AM, Jean-Nicolas Jolivet wrote:

I have a TextView set up so its data is bound to my User Defaults  
controller so that its content is saved when I press a button...


If I enter some text manually and click on my "Save" button (the one  
that saves the preference) everything goes well, however, if I set  
some text to my TextView programatically, via its outlet like this:


[myTextView setString:@"Some text"];

and then click save... the User Default are not saved...

somehow it seems that the text view isn't "aware" that its content  
has changed because, if I set its text programatically, and then  
actually go in the text view and insert some more text THEN click  
save, it works...


It only fails when the textview's content has been set  
programatically only but not been touched by the user...


Any help would be appreciated


Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.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/chaitanya%40expersis.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: How do you get the OS X version number in C or C++?

2008-11-14 Thread chaitanya pandit

+ (BOOL)MacOSTigerOrLower
{
UInt32 version;
return (Gestalt(gestaltSystemVersion,(SInt32 *) &version) ==  
noErr) && (version < 0x01050 );

}


On 15-Nov-08, at 1:36 AM, Tom Fortmann wrote:

Is there a core foundation function for querying the Mac OS X  
operating
system name and version information?  The uname() API returns the  
Darwin
kernel version information, but I need to find the OS X 10.x.x  
information.




Tom Fortmann

Xcape Solutions

___

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/chaitanya%40expersis.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]


Tabbing PDF Annotation Editor between annotations in "edit mode"?

2008-11-14 Thread Joel Norvell
Dear Cocoa-dev People,

I've been tangling with this question most of the morning and was hoping for 
some guidance on how to proceed.

I want to modify the PDF Annotation Editor so that it will tab from 
annotation-to-annotation in "edit mode," just like it does in "test mode." 

What is the key to accomplishing this?  Is there something simple I've 
overlooked?

I'm thinking that I'll need to build something like a keyView chain (responder 
chain), procedurally, on a per-annotation basis.

And since PDFAnnotation isn't an NSView subclass, I'll have to create a 
mechanism that "hears" tab events and then updates the current annotation "by 
hand."

Since this approach is a bit complicated, I wanted to ask the group for 
confirmation first, lest I proceed down a rabbit hole. 

Yours sincerely,
Joel




  
___

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 do you get the OS X version number in C or C++?

2008-11-14 Thread Tom Fortmann
Is there a core foundation function for querying the Mac OS X operating
system name and version information?  The uname() API returns the Darwin
kernel version information, but I need to find the OS X 10.x.x information.

 

Tom Fortmann

Xcape Solutions

___

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, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Brad Gibbs
I've been using Jonathan Dann's excellent Core Data Sorted sample code  
to create an outline view consisting of two concrete entities --  
Categories and Types (each parent Category can have an unlimited  
number of children types).  The only real adjustment I've made to his  
code is to put the parent relationship in the Category entity and the  
children relationship in the Type entity.  I've also modified the  
indexPath of the addGroup method so that categories are always root  
objects.


The outline view seems to be working fine.  I'm using the addGroup  
method to add categories and addLeaf to add types.  This outline view  
is in a preferences window in my app.


This section of the app is meant to be a product library.  Users will  
be able to sort and search by category or type.  When adding a new  
product, a type is assigned to the product, using the selected value  
of a popup button.  I'd like to limit the number of types in that  
popup button by using a category popup button.  In other words:


1.  User indicated s/he wants to add a new product
2.  User selects a category from a popbutton menu
3.  App loads the selected category's types in the the types popup  
button
4.  User selects a type and the type is assigned to the type  
relationship for the product being created or edited.


I've got two array controllers in my nib file -- one for categories  
and another for types.  I've tried just about every combination of  
bindings I can imagine, but I can't get the types popup button to  
limit itself to the types associated with the selected category -- at  
best it either displays all types of every category or it populates  
the types popup menu for a selected category but doesn't update itself  
when a different category is selected.


Should I be using a fetch request or a filter predicate instead?  If  
bindings is the right approach, could someone describe the bindings  
that need to be made?


Also, if there's a website, or something other than Apple's  
documentation on Core Data, bindings, fetch requests and filter  
predicates, I'd really appreciate the pointer.  I've Googled and read  
through Pragmatic Programmer's Core Data beta book, but the section on  
bindings hasn't been released, yet.


Thanks in advance.

Brad
___

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]


Notifying that a TextView's content has been changed?

2008-11-14 Thread Jean-Nicolas Jolivet
I have a TextView set up so its data is bound to my User Defaults  
controller so that its content is saved when I press a button...


If I enter some text manually and click on my "Save" button (the one  
that saves the preference) everything goes well, however, if I set  
some text to my TextView programatically, via its outlet like this:


[myTextView setString:@"Some text"];

and then click save... the User Default are not saved...

somehow it seems that the text view isn't "aware" that its content has  
changed because, if I set its text programatically, and then actually  
go in the text view and insert some more text THEN click save, it  
works...


It only fails when the textview's content has been set programatically  
only but not been touched by the user...


Any help would be appreciated


Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.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: Determining GUI ivar assignments in IB

2008-11-14 Thread Quincey Morris

On Nov 14, 2008, at 11:09, Brian Stern wrote:


On Nov 14, 2008, at 1:58 PM, Jonathon Kuo wrote:


Okay, let me rephrase the question...

I have an NSButton in my MainMenu.nib, and I've connected it to my  
controller class's "myButton" ivar by control-drag. Repeat this  
many times. Now, is there any way in Interface Builder to determine  
what IBOutlet/ivar a particular button has been connected to? If I  
control-drag from myButton to my controller instantiation, I get a  
little black menu showing all of the IBOutlets, but none of them  
are selected or indicated in any way. So far as I can tell, there's  
*no way* to know or find out what, if any, assignments have been  
made. Surely I'm overlooking something!


Set the xib/nib window to list view mode.  Control-click on the  
file's owner and a little black window will appear that shows the  
connections.  You can click on all the views in the list as well.


Also, this same information *is* shown in the Connections pane of the  
Inspector, for the currently selected object. Maybe the OP didn't  
select File's Owner before looking for the information in the Inspector.



___

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: Unable to generate a PDF from textual data

2008-11-14 Thread Michael Ash
On Fri, Nov 14, 2008 at 1:16 PM, Lee, Frederick (Ric)
<[EMAIL PROTECTED]> wrote:
> Greetings:
>
>   I'm trying to create a PDF from a NSString; but I'm not getting anything.
>
> What am I doing wrong?

Are you thinking that your code will build a PDF which contains a
visual representation of the text contained in the NSString? If so,
this isn't right, it's barely even wrong.
CGPDFDocumentCreateWithProvider expects raw PDF data. In other words,
it expects you to already have a PDF from somewhere, and all it does
is read that PDF into memory so you can work with it. It's not going
to magically realize that you're giving it human-readable text,
perform rendering and layout on that text, and produce a PDF document
from it.

If your goal is to create a new PDF which visually contains a string,
your best approach is probably to put that string into an NSTextView,
and then use the Cocoa printing system to generate a PDF from it.

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]


Re: Unable to generate a PDF from textual data

2008-11-14 Thread Charles Steinman
Are you certain that faxMsgData is valid PDF data? It sounds like it isn't 
being recognized as a PDF.

Cheers,
Chuck

--- On Fri, 11/14/08, Lee, Frederick (Ric) <[EMAIL PROTECTED]> wrote:

> From: Lee, Frederick (Ric) <[EMAIL PROTECTED]>
> Subject: Unable to generate a PDF from textual data
> To: cocoa-dev@lists.apple.com
> Date: Friday, November 14, 2008, 10:16 AM
> Greetings:
> 
>I'm trying to create a PDF from a NSString; but
> I'm not getting anything.
> 
> What am I doing wrong?
> 
>  
> 
> - (id)initWithData:(NSDictionary *)inData {
> 
> self = [super init];
> 
> if (self != nil) {
> 
> self.faxHistoryItemDict = inData;
> 
> // 1) Create the PDF Data Source:
> 
> CFDataRef faxMsgData =
> (CFDataRef)[[self.faxHistoryItemDict
> objectForKey:@"msg"] dataUsingEncoding:
> NSUTF8StringEncoding];
> 
> CGDataProviderRef faxMsgDataRef =
> CGDataProviderCreateWithCFData(faxMsgData);  
> 
> // 2) Create the PDF doc:
> 
> self.faxPDFDoc =
> CGPDFDocumentCreateWithProvider(faxMsgDataRef); // I
> don't get a PDF here. 
> 
> 
> 
> CGDataProviderRelease(faxMsgDataRef);
> 
> }
> 
> return self;
> 
> } // end initWithData().
> 
>  
> 
> (gdb) po faxPDFDoc
> 
> Cannot access memory at address 0x0  ß ???
> 
>  
> 
> Here's the header:
> 
> @interface PDFDrawing : NSObject
> {
> 
> CGPDFDocumentRef pdf;
> 
> NSDictionary*faxHistoryItemDict;
> 
> 
> 
> @private
> 
> CGPDFDocumentRef faxPDFDoc;
> 
> 
> 
> }
> 
>  
> 
> @property(nonatomic, retain) NSDictionary   
> *faxHistoryItemDict;
> 
> @property(nonatomic, assign) CGPDFDocumentRef faxPDFDoc;
> 
>  
> 
> - (id)initWithData:(NSDictionary *)inData;
> 
> -(void)drawView:(QuartzView*)view
> inContext:(CGContextRef)context bounds:(CGRect)bounds;
> 
>  
> 
> @end
> 
>  
> 
> Regards,
> 
> Ric.
> 
>  
> 
>  
> 
> ___
> 
> 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/acharlieblue%40yahoo.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: Unable to generate a PDF from textual data

2008-11-14 Thread David Duncan

On Nov 14, 2008, at 10:16 AM, Lee, Frederick (Ric) wrote:

   CFDataRef faxMsgData = (CFDataRef)[[self.faxHistoryItemDict  
objectForKey:@"msg"] dataUsingEncoding: NSUTF8StringEncoding];



This is not PDF data, this is just text.  
CGPDFDocumentCreateWithProvider() expects valid PDF data to be pulled  
from the data provider (and thus from the data object your passing).


If you need to create PDF data, then you will need to use PDFKit or  
Core Graphics to create valid PDF data by drawing the text strings  
into a pdf context. Then you can get PDF data to do additional work  
with (including creating a CGPDFDocument with the PDF data in it).

--
David Duncan
Apple DTS Animation and Printing

___

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: Adding an NSButton to a layer-hosted view

2008-11-14 Thread David Duncan

On Nov 14, 2008, at 10:33 AM, Michel Schinz wrote:


Le 14 nov. 08 à 18:04, David Duncan a écrit :

AppKit doesn't do hit testing via the layer tree, so by moving the  
button's layer, you've desynchronized the graphical location of the  
button with the hit test location of the button. If you want to use  
layer-backed AppKit views, you always need to move them via AppKit  
for the graphical and logical locations to match.


That was the problem indeed, thanks a lot David! Moving the button  
using setFrameOrigin: makes it behave correctly.


I'll also conclude from your answer that putting these NSControl  
instances in my layer-hosted view is legal. Please correct me if I'm  
wrong.



It is legal, and AppKit tries to make sure that nothing bad will  
happen (i.e. you shouldn't crash). In general however, its an easier  
programming model if you either work entirely with Views or entirely  
with Layers. You can mix them, but you have to be careful about what  
your doing. Graphical attributes usually aren't a problem, but  
geometrical ones can be (as you've already found out).

--
David Duncan
Apple DTS Animation and Printing

___

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: Unable to generate a PDF from textual data

2008-11-14 Thread I. Savant
On Fri, Nov 14, 2008 at 1:16 PM, Lee, Frederick (Ric)
<[EMAIL PROTECTED]> wrote:

>// 1) Create the PDF Data Source:
>
>CFDataRef faxMsgData = (CFDataRef)[[self.faxHistoryItemDict 
> objectForKey:@"msg"] dataUsingEncoding: NSUTF8StringEncoding];
>
>CGDataProviderRef faxMsgDataRef = 
> CGDataProviderCreateWithCFData(faxMsgData);
>
>// 2) Create the PDF doc:
>
>self.faxPDFDoc = CGPDFDocumentCreateWithProvider(faxMsgDataRef); // I 
> don't get a PDF here.

  Is faxMsgData valid? Does CGDataProviderCreateWithCFData() give you
a valid CGDataProviderRef?

--
I.S.
___

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: Adding an NSButton to a layer-hosted view

2008-11-14 Thread Michel Schinz

Le 14 nov. 08 à 18:04, David Duncan a écrit :

AppKit doesn't do hit testing via the layer tree, so by moving the  
button's layer, you've desynchronized the graphical location of the  
button with the hit test location of the button. If you want to use  
layer-backed AppKit views, you always need to move them via AppKit  
for the graphical and logical locations to match.


That was the problem indeed, thanks a lot David! Moving the button  
using setFrameOrigin: makes it behave correctly.


I'll also conclude from your answer that putting these NSControl  
instances in my layer-hosted view is legal. Please correct me if I'm  
wrong.


Michel.___

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]


Unable to generate a PDF from textual data

2008-11-14 Thread Lee, Frederick (Ric)
Greetings:

   I'm trying to create a PDF from a NSString; but I'm not getting anything.

What am I doing wrong?

 

- (id)initWithData:(NSDictionary *)inData {

self = [super init];

if (self != nil) {

self.faxHistoryItemDict = inData;

// 1) Create the PDF Data Source:

CFDataRef faxMsgData = (CFDataRef)[[self.faxHistoryItemDict 
objectForKey:@"msg"] dataUsingEncoding: NSUTF8StringEncoding];

CGDataProviderRef faxMsgDataRef = 
CGDataProviderCreateWithCFData(faxMsgData);  

// 2) Create the PDF doc:

self.faxPDFDoc = CGPDFDocumentCreateWithProvider(faxMsgDataRef); // I 
don't get a PDF here. 



CGDataProviderRelease(faxMsgDataRef);

}

return self;

} // end initWithData().

 

(gdb) po faxPDFDoc

Cannot access memory at address 0x0  ß ???

 

Here's the header:

@interface PDFDrawing : NSObject {

CGPDFDocumentRef pdf;

NSDictionary*faxHistoryItemDict;



@private

CGPDFDocumentRef faxPDFDoc;



}

 

@property(nonatomic, retain) NSDictionary*faxHistoryItemDict;

@property(nonatomic, assign) CGPDFDocumentRef faxPDFDoc;

 

- (id)initWithData:(NSDictionary *)inData;

-(void)drawView:(QuartzView*)view inContext:(CGContextRef)context 
bounds:(CGRect)bounds;

 

@end

 

Regards,

Ric.

 

 

___

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]


[ANN] VirtualEarthKit - Microsoft Virtual Earth for Mac and iPhone

2008-11-14 Thread Colin Cornaby
I've been working with Microsoft recently in bringing their Virtual  
Earth services to the Mac and iPhone. The result is VirtualEarthKit, a  
BSD licensed Cocoa framework, managed completely independently of  
Microsoft. VirtualEarthKit provides several services to Mac and iPhone  
programmers, such as geocoding (place name/address -> latitude/ 
longitude), international reverse geocode (latitude/longitude -> place  
name), static maps, and fetching of individual map tiles. Later  
releases will include yellow pages searching, and turn by turn route  
guidance.


In addition, I'm also working on a fully native OpenGL based map view  
for both Mac OS X and the iPhone. The iPhone map view is already  
working and shipping in a iPhone product, but is awaiting some cleanup  
before it's added to the svn archive.


On desktop Mac OS X, VirtualEarthKit uses Philippe Casgrain's  
excellent CoreLocation implementation:

http://developer.casgrain.com/?p=9

Use of VirtualEarthKit requires an account with Microsoft. Use of  
VirtualEarthKit in a shipping application (without watermarks)  
requires a contract with Microsoft.


Here's a link to the VirtualEarthKit site:
http://consonancesw.com/developers/virtualearthkit/

Here's a link to a VirtualEarthKit tutorial:
http://consonancesw.com/blog/?p=64

Disclaimer: I don't work for Microsoft, and they don't pay me  
anything. This project was designed completely outside of Microsoft,  
but with their full blessing and support. Microsoft was even were cool  
to link to it in a recent blog post:

http://blogs.msdn.com/virtualearth/archive/2008/11/13/developing-virtual-earth-iphone-applications-with-objective-c.aspx

Disclaimer 2: This API is a work in progress, but I'm hoping the  
community can start to build some cools apps with this. Any  
contributions are welcome.

___

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: CALayer and View controls

2008-11-14 Thread David Duncan

On Nov 14, 2008, at 9:12 AM, Fabrizio Guglielmino wrote:


Sorry but I forgot to say my application is for iPhone so I don't need
setWantsLayer:YES, I don't think this make the difference, right?


Layers are always on on iPhone, so yes it makes no difference here.


So, if I understand, I can make a second view outside the first
view/layer with the button (and eventually other controls) and this
will not affected of any animations? If it's true I had not understood
the relation between layer and view, now it's clear.



Right, a layer can only affect itself and its sublayers.
--
David Duncan
Apple DTS Animation and Printing

___

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: CALayer and View controls

2008-11-14 Thread Fabrizio Guglielmino
2008/11/14 David Duncan <[EMAIL PROTECTED]>:
> On Nov 14, 2008, at 8:10 AM, Fabrizio Guglielmino wrote:
>
>> in some previous posts I was looking for information about CALayer
>> rotation and now I can rotate layer using core animation.
>> This mail it's about a strange behaviour, in my simple test I have a
>> single View and a little image loaded as content of main layer.
>> in the bottom of View there is a button and when I press this button
>> rotation starts. The strange behaviour is that also the button rotate
>> but I set bounds and position of CALafer to be in the middle of the
>> view and half size of it.
>
>
> When you configure a view to be layer backed (setWantsLayer:YES) all
> subviews of that view become layer backed as well. Any transforms (in this
> case rotation) that you apply to that layer also affect all sublayers (which
> the layer for your button is).
>
> If you don't want the button to rotation, then you need to place it outside
> of the view/layer that is being rotated.
> --
> David Duncan
> Apple DTS Animation and Printing
>
>

Thanks for the reply.
Sorry but I forgot to say my application is for iPhone so I don't need
setWantsLayer:YES, I don't think this make the difference, right?

So, if I understand, I can make a second view outside the first
view/layer with the button (and eventually other controls) and this
will not affected of any animations? If it's true I had not understood
the relation between layer and view, now it's clear.

Thank You again
Fabrizio
___

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: Adding an NSButton to a layer-hosted view

2008-11-14 Thread David Duncan

On Nov 14, 2008, at 8:22 AM, Michel Schinz wrote:

This seems to work relatively well, except that the NSButton  
instance does not react to mouse events. For example, it does not  
perform the action or toggle its state when I click on it. Instead,  
my layer-hosted view gets the event (i.e. its mouseDown: method gets  
invoked). I found a partial work-around, which consists in calling  
"performClick:" on the button whenever its layer is the one under  
the mouse when the click happens, but this is not satisfactory (e.g.  
the button does not highlight when the mouse hovers over it, even  
though it should, given how it's configured).



AppKit doesn't do hit testing via the layer tree, so by moving the  
button's layer, you've desynchronized the graphical location of the  
button with the hit test location of the button. If you want to use  
layer-backed AppKit views, you always need to move them via AppKit for  
the graphical and logical locations to match.

--
David Duncan
Apple DTS Animation and Printing

___

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: CALayer and View controls

2008-11-14 Thread David Duncan

On Nov 14, 2008, at 8:10 AM, Fabrizio Guglielmino wrote:


in some previous posts I was looking for information about CALayer
rotation and now I can rotate layer using core animation.
This mail it's about a strange behaviour, in my simple test I have a
single View and a little image loaded as content of main layer.
in the bottom of View there is a button and when I press this button
rotation starts. The strange behaviour is that also the button rotate
but I set bounds and position of CALafer to be in the middle of the
view and half size of it.



When you configure a view to be layer backed (setWantsLayer:YES) all  
subviews of that view become layer backed as well. Any transforms (in  
this case rotation) that you apply to that layer also affect all  
sublayers (which the layer for your button is).


If you don't want the button to rotation, then you need to place it  
outside of the view/layer that is being rotated.

--
David Duncan
Apple DTS Animation and Printing

___

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 and View

2008-11-14 Thread Fabrizio Guglielmino
Hi all,
in some previous posts I was looking for information about CALayer
rotation and now I can rotate layer using core animation.
This mail it's about a strange behaviour, in my simple test I have a
single View and a little image loaded as content of main layer.
in the bottom of View there is a button and when I press this button
rotation starts. The strange behaviour is that also the button rotate
but I set bounds and position of CALafer to be in the middle of the
view and half size of it.

Can someone explain to me this behaviour, also the button it's drawn
attached to the image but in Interface builder I put it on bottom of
the view.

many thanks
Fabrizio
___

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: Where does stdout go in an ordinary Cocoa application?

2008-11-14 Thread Scott Ribe
Open Console.app. You should see your log messages, mixed in with others...

Or close stdout and reopen to wherever you want. (See fclose & fdup...)

-- 
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

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]


Adding an NSButton to a layer-hosted view

2008-11-14 Thread Michel Schinz

Hi,

I have a layer-hosted view containing several layers making up the UI  
of my application. In a few cases, I would actually like to use  
standard controls *inside* of this layer-hosted view. For example, I'd  
like to have a standard NSButton in one location, and use an  
NSTextField to edit some text in another location.


What I've done until now is to create the NSButton/NSTextField in the  
standard way, then add them as sub-views of my main view. Once this is  
done, I obtain the "layer" property of those objects and manipulate  
this layer like the other ones, to position them, set their z- 
position, hide or show them, and so on.


This seems to work relatively well, except that the NSButton instance  
does not react to mouse events. For example, it does not perform the  
action or toggle its state when I click on it. Instead, my layer- 
hosted view gets the event (i.e. its mouseDown: method gets invoked).  
I found a partial work-around, which consists in calling  
"performClick:" on the button whenever its layer is the one under the  
mouse when the click happens, but this is not satisfactory (e.g. the  
button does not highlight when the mouse hovers over it, even though  
it should, given how it's configured).


So I have two questions:

1. Is it actually valid to add an NSButton or NSTextField as a sub- 
view of a layer-hosted view?


2a. If it is, then how do I make sure the NSButton I add reacts to  
mouse events as it should?


2b. If it isn't, then is there a better way to do what I'm trying to  
do, i.e. have a view containing many many layers managed directly by  
my application, with a few standard controls mixed in?


Thanks,
Michel.
___

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: Where does stdout go in an ordinary Cocoa application?

2008-11-14 Thread Nick Zitzmann


On Nov 14, 2008, at 6:02 AM, Karan, Cem (Civ, ARL/CISD) wrote:

So where does the output of fprintf(stdout,…) go to in a Cocoa  
application?



If there's no tty attached, I'm pretty sure it goes straight to the  
console, just as stderr does. So you can read it by launching  
Console.app.


Nick Zitzmann


___

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 and View controls

2008-11-14 Thread Fabrizio Guglielmino
Hi all,
in some previous posts I was looking for information about CALayer
rotation and now I can rotate layer using core animation.
This mail it's about a strange behaviour, in my simple test I have a
single View and a little image loaded as content of main layer.
in the bottom of View there is a button and when I press this button
rotation starts. The strange behaviour is that also the button rotate
but I set bounds and position of CALafer to be in the middle of the
view and half size of it.

Can someone explain to me this behaviour, also the button it's drawn
attached to the image but in Interface builder I put it on bottom of
the view.

many thanks
Fabrizio
___

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]


[ANN] SArchiveKit: A XAR Cocoa library

2008-11-14 Thread Jean-Daniel Dupas

Hi,

The SArchiveKit is a Cocoa framework to create and extract XAR archives.
It supports archive signature, background file extraction,  
subdocument, and more.


http://code.google.com/p/sarchivekit/

And it is released under MIT license.

___

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]


Where does stdout go in an ordinary Cocoa application?

2008-11-14 Thread Karan, Cem (Civ, ARL/CISD)
I'm using a library that has been ported over from Linux that uses fprintf() 
and a global variable to determine where to dump a bunch of logging 
information.  I don't really have the option of converting all of this to 
syslog() or NSLog(), and I don't want to waste a bunch of time on this library 
in any case, but I would like to see what the output is.  The problem is that 
I'm creating an ordinary Cocoa application, not a command line application.  So 
where does the output of fprintf(stdout,…) go to in a Cocoa application?

Thanks,
Cem Karan
___

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: Distributed Objects Performance

2008-11-14 Thread Jean-Daniel Dupas


Le 14 nov. 08 à 10:47, Seth Willits a écrit :


On Nov 13, 2008, at 11:33 PM, Bridger Maxwell wrote:

How often? 60 times per second often? Once per second often? Every  
minute,

often?

You'll need to calculate the amount of data you're expecting to  
transfer,

worst case.


I would say about every five seconds often, max.


My gut instinct says you'll be fine.




The problem is, once I have
a worst case scenario calculated (which would be very difficult to
calculate, and would be little more than a bad guess), I wouldn't  
know if

that is reasonable or not.


Well, even if it's 30 stations, and the data is 1 MB, that's 30 MB.  
A quick little test showed me getting over 50 MB/sec on a 100-T LAN.



I would be curious to know how you reached 50MB/sec on a LAN that has  
a theorical limit of 12.5MB/sec.



___

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]


Changing cursor in NSTextView's Subview

2008-11-14 Thread chaitanya pandit


Hi, List
I have a NSTextView with some subviews, i want to implement tracking  
areas for the subViews so that whenever the mouse enters a subview the  
cursor changes to open hand cursor.
I referred the Trackit example (http://developer.apple.com/samplecode/TrackIt/index.html#/ 
/apple_ref/doc/uid/DTS10004139) and implemented the tracking areas  
such that the owner is the subview and the rectangle is it's bounds.


I get called at the subview's - (void)cursorUpdate:(NSEvent*)event,  
but in this method even if i set the cursor to the open hand cursor  
([[NSCursor openHandCursor] set];) the cursor is still an I beam cursor.

Any idea what i'm missing here?

I'd appreciate any help as this is really driving me crazy
Thanks,
Chaitanya





___

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: Distributed Objects Performance

2008-11-14 Thread Seth Willits

On Nov 13, 2008, at 11:33 PM, Bridger Maxwell wrote:

How often? 60 times per second often? Once per second often? Every  
minute,

often?

You'll need to calculate the amount of data you're expecting to  
transfer,

worst case.


I would say about every five seconds often, max.


My gut instinct says you'll be fine.




The problem is, once I have
a worst case scenario calculated (which would be very difficult to
calculate, and would be little more than a bad guess), I wouldn't  
know if

that is reasonable or not.


Well, even if it's 30 stations, and the data is 1 MB, that's 30 MB. A  
quick little test showed me getting over 50 MB/sec on a 100-T LAN. I  
wouldn't expect the overhead of DO to add up so much as to make it  
useless for a 5 second+ refresh. Especially if your data is  
significantly smaller, like "a page of apple docs."





Perhaps there is an example of what DO is well
suited for, and what it is not?


Perhaps, but none that I'm aware of. I've really only fiddled with it  
for IPC.





Then, as we design these stations we can
either strive for absolute efficiency, or know there is a little  
breathing
room if it makes the programming easier. I have absolutely no  
experience

here (in network efficiency) so I feel like I am shooting in the dark.



You could certainly use some lower-level form of communication, to  
handle the exchange, but if the vast majority of the communication is  
just the raw data in one big package, they'll probably be roughly  
equivalent. If you're actually sending a lot of little objects  
separately, DO might not be up to the task.


If you're as close to being done as it sounds like you are, might as  
well finish and see how well it works. :)




--
Seth Willits



___

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]