@class causing grief

2008-03-18 Thread Scott Squires


I'm starting to go in circles at this point.
I know I've got a number of interconnecting files.
Since I was getting errors I replaced the #import as much as possible  
with @class defines


I'm still getting the following error:
error: syntax error before 'AT_NAME' token

This indicates @class myClass; in the following examples.
Most of these work fine but if I end up swapping #import instead then  
other areas break the compiler.


Any suggestions on areas to look at (missing @end or something else?)

Thanks.

example:

#import 
@class myClass;

@interface anotherClass : NSObject
{

myClass *theMyClassObject;

}

@end



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


CoreData code working on Tiger - not on Leopard

2008-03-18 Thread Steve Cronin

Folks;

I am now testing a Tiger application on Leopard and learning the new  
Leopard way at the same time.

I admit I have a lot of Leoparding to do!

I use Core Data (SQLite) pretty extensively on Tiger - life is good.

I take the project and run it without any changes to the model or the  
code and Core Date won't save to disk.


I load a set of data on initial launch and at the end of that process  
I have Core Data 'save'.

The data loading all appears to run fine:
			recX = [NSEntityDescription insertNewObjectForEntityForName:@"XYZ"  
inManagedObjectContext:moc];

[recX setValue:@"123" forKey:@"source"];
...

5 different entities and 1,000s of records..

I've looked over the 'Core Data - Release Notes' but I don't see  
anything that seems to indicate a model conversion or persistant  
store conversions I have not made any changes (no versioning...)


Here's the 'save' code:
- (void) updateCoreData {
NSManagedObject *moc = [self managedObjectContext];
[moc processPendingChanges];
if ([moc commitEditing]) {
NSError *error;
if ([moc save:&error])  {
if (error!=nil) {

On Leopard in the 'processPendingChanges' invocation I get the  
following:


0   0x900ef0f4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1  0x93d680fb in objc_exception_throw
#2	0x9649a2a5 in -[NSManagedObjectContext 
(_NSInternalChangeProcessing) _processRecentChanges:]

#3  0x964adbea in -[NSManagedObjectContext processPendingChanges]
#4  0x0002032e in -[AppDelegate updateCoreData] at AppDelegate.m:700

BTW:  I also get a similar error if, during the loading, I try to get  
a 'count' using a FetchTemplate with a null predicate (works on Tiger)

It appears the fetch also causes a 'processRecentChanges)

What am I missing?

Thanks for your help!
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: @class causing grief

2008-03-18 Thread Ron Fleckner


On 18/03/2008, at 6:32 PM, Scott Squires wrote:



I'm starting to go in circles at this point.
I know I've got a number of interconnecting files.
Since I was getting errors I replaced the #import as much as  
possible with @class defines


I'm still getting the following error:
error: syntax error before 'AT_NAME' token

This indicates @class myClass; in the following examples.
Most of these work fine but if I end up swapping #import instead  
then other areas break the compiler.


Any suggestions on areas to look at (missing @end or something else?)

Thanks.

example:

#import 
@class myClass;

@interface anotherClass : NSObject
{

myClass *theMyClassObject;

}

@end


Hi Scott,

The @class MyClass; declaration is a forward declaration to tell the  
compiler that MyClass is, in fact, a valid type that you define  
elsewhere (ie, in it's .h and .m files).  You only need to do it in a  
header file of another class which makes use of your MyClass as an  
instance variable.


The #import "MyClass.h" is a preprocessor macro which will, as it's  
name suggests, import the contents of that file into whatever file in  
which it appears.


So, make sure you only have @MyClass declarations in header files of  
classes in which you need a MyClass type instance variable, and then  
#import "MyClass.h" into that class's implementation (.m) file.  You  
would do this for every class which requires an instance of MyClass  
in it.  Do this and you should be sweet.


By the way, it's the convention to name classes with an initial  
capital.  Otherwise they are easy to confuse with instance variables.


MyClass *myClassIvar = [[MyClass alloc] init];

HTH,

Ron
___

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: CoreData code working on Tiger - not on Leopard

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 00:33, Steve Cronin wrote:

On Leopard in the 'processPendingChanges' invocation I get the  
following:


0   0x900ef0f4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1  0x93d680fb in objc_exception_throw
#2	0x9649a2a5 in - 
[NSManagedObjectContext(_NSInternalChangeProcessing)  
_processRecentChanges:]

#3  0x964adbea in -[NSManagedObjectContext processPendingChanges]
#4  0x0002032e in -[AppDelegate updateCoreData] at AppDelegate.m:700

BTW:  I also get a similar error if, during the loading, I try to  
get a 'count' using a FetchTemplate with a null predicate (works on  
Tiger)

It appears the fetch also causes a 'processRecentChanges)


Don't neglect the obvious. In general, the frameworks log an error  
message when they throw an exception. You don't say if you checked the  
log for messages.


Is there a custom uncaught exception handler at work here? If so, it  
might be that it's terminating the application before the message is  
actually logged, since logging seems to be asynchronous with  
exceptions in Leopard. (Setting a breakpoint on objc_exception_throw  
almost always enters the debugger before the corresponding message is  
logged in the console window.)



___

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]


Setting Web Proxy programmatically

2008-03-18 Thread parag vibhute
Hi all,

My requirement is to set Web Proxy & Secure Web proxy which appears in
Network pane of System Preferences. I want to achieve this programmatically.

Is this possible? Which framework should I use?

Thanks,
Palav


-- 

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

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: @class causing grief

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 00:32, Scott Squires wrote:


I'm still getting the following error:
error: syntax error before 'AT_NAME' token

This indicates @class myClass; in the following examples.
Most of these work fine but if I end up swapping #import instead  
then other areas break the compiler.


Any suggestions on areas to look at (missing @end or something else?)

Thanks.

example:

#import 
@class myClass;

@interface anotherClass : NSObject
{

myClass *theMyClassObject;

}

@end


Don't neglect the obvious. #1 candidate (from personal experience)  
would be a missing ";" or "@end" or "}" near the end of stdStuff.h.  
Another candidate might be a "class SomeClass;" where you meant  
"@class SomeClass;".


You could try compiling something that just #imports stdStuff.h and  
see what happens, too.



___

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: Setting Web Proxy programmatically

2008-03-18 Thread Cocoa Developer
Hi Palav,
Yes it is possible.

You need to use SystemConfiguration framework. You can get all proxy
information except authentication. So don't try to get proxy information
from network pane. Its useless.
If you want to use network pane in system preference then use CFSocket.
(Best option)

CFSocket will take care of proxy handling before setting up a new
connection.

For BSD sockets you need to have all information and need to work on proxy
manually.
If u have to use BSD sockets, then have ur own proxy settings in your
application preference pane and use them.

Regards,
Basavaraj



On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED]>
wrote:

> Hi all,
>
> My requirement is to set Web Proxy & Secure Web proxy which appears in
> Network pane of System Preferences. I want to achieve this
> programmatically.
>
> Is this possible? Which framework should I use?
>
> Thanks,
> Palav
>
>
> --
>
> There are many things in your life that will catch your eye but only a few
> will catch your heartpursue those'.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> http://lists.apple.com/mailman/options/cocoa-dev/imcocoadeveloper%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSAppleScript returning wrong error info

2008-03-18 Thread Vinay Prabhu

I am trying to create a NSAppleScript object using a applescript file.
The code is as follows,

NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc] initWithContentsOfURL:  
scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a  
dictionary containing error messages.


But strangely, on return, 'errorInfo' is not pointing to object of  
NSDictionary, instead it is

pointing to '_NSRepresentationInfo' object.

I have used the following code to find the class of 'errorInfo',
Class temp = [errorInfo class];
NSLog(@"%@", temp);

I can see the class type as _NSRepresentationInfo in console, on  
running the code.


Because of this, my application crashes, when I use NSDictionary API's  
like objectForKey, count etc on errorInfo.

The crash log shows,
[_NSRepresentationInfo count] selector not recognized

This happens when I run my application in Japanese language.
Any idea, why NSAppleScript is not returning NSDictionary object, when  
error occurs?


Any help is greatly appreciated.
Thanks and Regards
-Vinay
___

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: NSAppleScript returning wrong error info

2008-03-18 Thread Jean-Daniel Dupas


Le 18 mars 08 à 10:47, Vinay Prabhu a écrit :


I am trying to create a NSAppleScript object using a applescript file.
The code is as follows,

NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc] initWithContentsOfURL:  
scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a  
dictionary containing error messages.


But strangely, on return, 'errorInfo' is not pointing to object of  
NSDictionary, instead it is

pointing to '_NSRepresentationInfo' object.

I have used the following code to find the class of 'errorInfo',
Class temp = [errorInfo class];
NSLog(@"%@", temp);

I can see the class type as _NSRepresentationInfo in console, on  
running the code.


Because of this, my application crashes, when I use NSDictionary  
API's like objectForKey, count etc on errorInfo.

The crash log shows,
[_NSRepresentationInfo count] selector not recognized

This happens when I run my application in Japanese language.
Any idea, why NSAppleScript is not returning NSDictionary object,  
when error occurs?


Any help is greatly appreciated.
Thanks and Regards
-Vinay


Are you sure an error occured? Try to initialize your error to nil  
before creating your script. I think initWithContentsOfURL: error: do  
not touch your errorInfo object and as it is not initialized, is point  
to a random memory adress that contains an _NSRepresentationInfo.


___

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: NSAppleScript returning wrong error info

2008-03-18 Thread Vinay Prabhu

Thanks for the help. Initializing the error to nil did the trick.

-Vinay

On Mar 18, 2008, at 3:50 PM, Jean-Daniel Dupas wrote:



Le 18 mars 08 à 10:47, Vinay Prabhu a écrit :

I am trying to create a NSAppleScript object using a applescript  
file.

The code is as follows,

NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc]  
initWithContentsOfURL: scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a  
dictionary containing error messages.


But strangely, on return, 'errorInfo' is not pointing to object of  
NSDictionary, instead it is

pointing to '_NSRepresentationInfo' object.

I have used the following code to find the class of 'errorInfo',
Class temp = [errorInfo class];
NSLog(@"%@", temp);

I can see the class type as _NSRepresentationInfo in console, on  
running the code.


Because of this, my application crashes, when I use NSDictionary  
API's like objectForKey, count etc on errorInfo.

The crash log shows,
[_NSRepresentationInfo count] selector not recognized

This happens when I run my application in Japanese language.
Any idea, why NSAppleScript is not returning NSDictionary object,  
when error occurs?


Any help is greatly appreciated.
Thanks and Regards
-Vinay


Are you sure an error occured? Try to initialize your error to nil  
before creating your script. I think initWithContentsOfURL: error:  
do not touch your errorInfo object and as it is not initialized, is  
point to a random memory adress that contains an  
_NSRepresentationInfo.






___

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: Setting Web Proxy programmatically

2008-03-18 Thread parag vibhute
My requirement is to set proxy via selecting "Using a PAC file" in Configure
proxy drop-down button of Network pane of system preferences.

I have to achieve this programmatically. How to do this?

Thanks,
Palav

On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <[EMAIL PROTECTED]>
wrote:

>
> Hi Palav,
> Yes it is possible.
>
> You need to use SystemConfiguration framework. You can get all proxy
> information except authentication. So don't try to get proxy information
> from network pane. Its useless.
> If you want to use network pane in system preference then use CFSocket.
> (Best option)
>
> CFSocket will take care of proxy handling before setting up a new
> connection.
>
> For BSD sockets you need to have all information and need to work on proxy
> manually.
> If u have to use BSD sockets, then have ur own proxy settings in your
> application preference pane and use them.
>
> Regards,
> Basavaraj
>
>
>
> On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED]>
> wrote:
>
> > Hi all,
> >
> > My requirement is to set Web Proxy & Secure Web proxy which appears in
> > Network pane of System Preferences. I want to achieve this
> > programmatically.
> >
> > Is this possible? Which framework should I use?
> >
> > Thanks,
> > Palav
> >
> >
> > --
> >
> > There are many things in your life that will catch your eye but only a
> > few
> > will catch your heartpursue those'.
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> > http://lists.apple.com/mailman/options/cocoa-dev/imcocoadeveloper%40gmail.com
> >
> > This email sent to [EMAIL PROTECTED]
> >
>
>


-- 

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

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas
As already said by Basavaraj, all proxy settings are accessible using  
the "SystemConfiguration" Framework.



Le 18 mars 08 à 13:37, parag vibhute a écrit :

My requirement is to set proxy via selecting "Using a PAC file" in  
Configure

proxy drop-down button of Network pane of system preferences.

I have to achieve this programmatically. How to do this?

Thanks,
Palav

On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <[EMAIL PROTECTED] 
>

wrote:



Hi Palav,
Yes it is possible.

You need to use SystemConfiguration framework. You can get all proxy
information except authentication. So don't try to get proxy  
information

from network pane. Its useless.
If you want to use network pane in system preference then use  
CFSocket.

(Best option)

CFSocket will take care of proxy handling before setting up a new
connection.

For BSD sockets you need to have all information and need to work  
on proxy

manually.
If u have to use BSD sockets, then have ur own proxy settings in your
application preference pane and use them.

Regards,
Basavaraj



On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED] 
>

wrote:





___

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: NSTreeController & NSOutlineView bindings w/ Core Data

2008-03-18 Thread Steven Huey

Ian,

Check out http://tinyurl.com/2txz6o , it's the section of the "Core  
Data Programming Guide" titled "Managed Object Accessor Methods", it  
shows what methods you need to implement for working with multi-value  
relationships.


Also take a look at the methods generated by selecting your "sections"  
relationship in the data modeler, and then choose one of the following  
pairs of items from the Design > Data Model menu:


= For Obj-C 1.0 =
Copy Method Declarations to Clipboard
Copy Method Implementations to Clipboard

= For Obj-C 2.0 =
Copy Obj-C 2.0 Method Declarations to Clipboard
Copy Obj-C 2.0 Method Implementations to Clipboard

Hope this helps.

Best regards,
Steven Huey

On Mar 17, 2008, at 1:48 PM, Ian Kennedy wrote:

I'm hoping this is simple, but everything I read makes it seem much  
more complicated than I think it should be.


I have this simple model: 
http://img.skitch.com/20080317-8wxj68njnsek652bnwaahm3t5b.png

In IB I instantiated an NSTreeController bound to the application  
delegate with a path of managedObjectContext. I set the entity to  
Course, checked 'Prepares Content' and added a key path for Children  
to 'sections'.


I can add courses, sections, and coursefiles, and the outlineview  
seems to recognize that the Course contains a Section, but it tells  
me that the entity Section is not kvc compliant for the key  
sections: http://img.skitch.com/20080317-qkmratwtpkfqx47rhqrtey4nqy.png


I've noted in the docs that:
"All child objects for the tree must be key-value-coding compliant  
for the same child key path. If necessary you should implement  
accessor methods in your model classes, or categories on those  
classes, that map the child key to the appropriate class-specific  
method name."


I have set up NSManagedObject subclasses for each of my model  
objects. However, I am not able to find an example of which accessor  
methods I should add to map the children


Any help would be much appreciated, I've been struggling with this  
for days.


Thanks in advance,
Ian Kennedy


--
Steven Huey
[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: Prevent application activation after dragging items to the Dock icon?

2008-03-18 Thread Peter Maurer
[applicationShouldHandleReopen:hasVisibleWindows:] means "clicked on  
its icon in the Dock". I.e the actions that are used to launch an  
app with no documents. It does not apply to opening documents, even  
if the Dock is involved.



Indeed. And I think this one is more about "What happens when my  
application becomes active?" -- rather than "Should my application  
activate?"


Anyway, another thing I tried was overriding [NSApp  
activateIgnoringOtherApps:], depending on whether there was an [[NSApp  
delegate] openFile(s):] message before. That didn't help either.  
Activation doesn't seem to be something the application decides on in  
these cases.


So if I understand Jens's response correctly, it seems all I'm left  
with is monitoring the frontmost application, and re-activating that  
application after my application has become active. But that's so ugly  
I don't even want to think about it.


Peter.
___

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: Setting Web Proxy programmatically

2008-03-18 Thread parag vibhute
Thank for reply.

As you said, they are accessible but are they writable? Through search, I
think they are only readable or for getting notification. But my requirement
is to change it.

Thanks,
Palav

On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED]>
wrote:

> As already said by Basavaraj, all proxy settings are accessible using
> the "SystemConfiguration" Framework.
>
>
> Le 18 mars 08 à 13:37, parag vibhute a écrit :
>
> > My requirement is to set proxy via selecting "Using a PAC file" in
> > Configure
> > proxy drop-down button of Network pane of system preferences.
> >
> > I have to achieve this programmatically. How to do this?
> >
> > Thanks,
> > Palav
> >
> > On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <
> [EMAIL PROTECTED]
> > >
> > wrote:
> >
> >>
> >> Hi Palav,
> >> Yes it is possible.
> >>
> >> You need to use SystemConfiguration framework. You can get all proxy
> >> information except authentication. So don't try to get proxy
> >> information
> >> from network pane. Its useless.
> >> If you want to use network pane in system preference then use
> >> CFSocket.
> >> (Best option)
> >>
> >> CFSocket will take care of proxy handling before setting up a new
> >> connection.
> >>
> >> For BSD sockets you need to have all information and need to work
> >> on proxy
> >> manually.
> >> If u have to use BSD sockets, then have ur own proxy settings in your
> >> application preference pane and use them.
> >>
> >> Regards,
> >> Basavaraj
> >>
> >>
> >>
> >> On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED]
> >> >
> >> wrote:
> >>
> >>>
>
>


-- 

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

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Confused about CFRunLoop

2008-03-18 Thread Brian Greenstone
Yay, I knew there was a way to do this, and I finally figured it out!   
Ok, so I'm able to emulate the Carbon calls exactly how I wanted by  
doing this:


Step 1:  Create the CF Timer...

CFRunLoopTimerRef timer = CFRunLoopTimerCreate(...);
	CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer,  
kCFRunLoopDefaultMode);	


Step 2:  Reenter the existing Main Loop with NS...

[[NSApplication sharedApplication] run];


Step 3:  When it's time to exit our loop we call this from the Timer  
callback...


	[[NSApplication sharedApplication] stop:[NSApplication  
sharedApplication]];



Step 4:  The code returns to the line we started things in Step 2, so  
now we just do some cleanup..


CFRunLoopTimerInvalidate(timer);
CFRelease(timer);


Works perfectly!  It inserts my timer into the main run loop and  
processes everything as it should.  Now I just need to figure out the  
CF equivalent of thos NSApplication calls and then I can be Obj-C  
free ;)



-B


__
Brian Greenstone
President & CEO[EMAIL PROTECTED]
Pangea Software, Inc.  http://www.pangeasoft.net
12405 John Simpson Ct. voice/fax:  (512)266-9991
Austin, TX 78732
__




___

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: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas
have a look at the MoreSCF sample on ADC site (http://developer.apple.com/samplecode/MoreSCF/ 
).

There is a bunch of helper to retreive and change configuration.


Le 18 mars 08 à 14:38, parag vibhute a écrit :


Thank for reply.

As you said, they are accessible but are they writable? Through  
search, I think they are only readable or for getting notification.  
But my requirement is to change it.


Thanks,
Palav

On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED] 
> wrote:

As already said by Basavaraj, all proxy settings are accessible using
the "SystemConfiguration" Framework.


Le 18 mars 08 à 13:37, parag vibhute a écrit :

> My requirement is to set proxy via selecting "Using a PAC file" in
> Configure
> proxy drop-down button of Network pane of system preferences.
>
> I have to achieve this programmatically. How to do this?
>
> Thanks,
> Palav
>
> On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <[EMAIL PROTECTED]
> >
> wrote:
>
>>
>> Hi Palav,
>> Yes it is possible.
>>
>> You need to use SystemConfiguration framework. You can get all  
proxy

>> information except authentication. So don't try to get proxy
>> information
>> from network pane. Its useless.
>> If you want to use network pane in system preference then use
>> CFSocket.
>> (Best option)
>>
>> CFSocket will take care of proxy handling before setting up a new
>> connection.
>>
>> For BSD sockets you need to have all information and need to work
>> on proxy
>> manually.
>> If u have to use BSD sockets, then have ur own proxy settings in  
your

>> application preference pane and use them.
>>
>> Regards,
>> Basavaraj
>>
>>
>>
>> On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED]
>> >
>> wrote:
>>
>>>




--

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


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: @class causing grief

2008-03-18 Thread Scott Squires

Thanks for the feedback.

Turns out 'error: syntax error before 'AT_NAME' token' was actually  
caused by a having a cut/paste accident where a word was placed at the  
very start of
another file (before the standard block of disclaimers, etc)  I just  
ahppened to scroll up and spot it in the far left.


wrongword// This code is to test something
// and more comments
// even more file info here

Still not sure why the compiler didn't choke on the word itself.

___

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: NSView enterFullScreenMode:withOptions: woes; window levels

2008-03-18 Thread Sean McBride
On 3/18/08 12:05 AM, Brian Christensen said:

>> NSDictionary* options = [NSDictionary
>>  dictionaryWithObjectsAndKeys:
>>[NSNumber numberWithInt:kCGNormalWindowLevel],
>>NSFullScreenModeWindowLevel, nil];
>> [groupView enterFullScreenMode:[NSScreen mainScreen]
>>  withOptions:options];
>> NSLog (@"level %d", [[groupView window] level]);
>>
>> Then it does go fullscreen, but the window level is
>> kCGMaximumWindowLevel-1, not kCGNormalWindowLevel.  As such, my panel
>> (at kCGFloatingWindowLevel) is invisible.
>>
>> Am I doing something wrong here?  Shouldn't the window level be what I
>> told it to be?
>
>I am unsure why this is even presented as an option for the mode
>dictionary. To my knowledge the CGDirectDisplay API (which is what the
>enterFullScreenMode: method is using under the hood) does not support
>specifying your own shielding window level. The result is that the
>window hosting your NSView is going to have to be promoted to a window
>level that is equal to or higher than the result of
>CGShieldingWindowLevel(). Otherwise it would be covered by the
>blanking window created by the display API.

Thanks Brian for confirming my fears. :)  For anyone reading the
archives, I recommend staying away from NSView's enterFullScreenMode (in
10.5.2 at least) for all but the most trivial cases.
 - there seems to be no way to change window level 
 - you can't allow the menu bar nor dock to auto unhide when moused over

 - it interferes with the usual way of unbinding
(viewWillMoveToSuperview:) 
 - you can't specify an animated transition to/from full screen

This all seems to be due to capturing the screen instead of using using
SetSystemUIMode().  Pity.

>You might alternately try to set the window level on your floating
>palette instead, ie. [paletteWindow setLevel:kCGMaximumWindowLevel].

Yes, that is my current workaround.

Thanks,

--

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: NSAppleScript returning wrong error info

2008-03-18 Thread Nir Soffer


On Mar 18, 2008, at 11:47, Vinay Prabhu wrote:


I am trying to create a NSAppleScript object using a applescript file.
The code is as follows,

NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc]  
initWithContentsOfURL: scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a  
dictionary containing error messages.


No, the docs say:

	"On return, if an error occurs, a pointer to an error information  
dictionary."


If an no error occurs, the value is undefined. Check for errors by  
testing the return value, not the error dictionary.



Best Regards,

Nir Soffer

___

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

2008-03-18 Thread Jens Alfke


On 17 Mar '08, at 7:55 PM, Matthew Miller wrote:


I am a complete and total new person to coca and I need to create a
horizontal Matrix of cells to house icons of applicationp URLs from  
a table.

I totally don't know how to do this.


Start with something simpler, then. Take one of the many example apps  
and add a feature to it.



If you would like to help me, please
put what I have to do in full detailed steps. Thank you very much.


I think it's asking a bit much to expect us to explain the entire task  
to you. If you run into a specific problem it's fine to ask about  
that. But we are not here to teach you Cocoa programming. (At least  
not for free; maybe some people here would consider tutoring you for  
pay.)


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

NSTableViewnot reflecting data changes

2008-03-18 Thread Valentin Dan
Hi,

 

I have a NSTableView for witch I implemented a custom DataSource class.

 

When I create & set the dataSource for the first time, the NSTableView lists 
correctly the information; but when I change the data in the DataSource object 
the table view no longer updates to reflect the added data.

 

Can someone tell me where the problem could be ? 

 

Thank you!

 

___

Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   

Email: HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED] 
Office: +40 356-710158

Masstech Group Inc.  Fax:+40 256-220912

HYPERLINK "http://www.masstechgroup.com/"http://www.masstechgroup.com 

 

THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date: 17.03.2008 
10:48
 
___

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: NSTableViewnot reflecting data changes

2008-03-18 Thread Stéphane


Am Mar 18, 2008 um 4:14 PM schrieb Valentin Dan:


Hi,



I have a NSTableView for witch I implemented a custom DataSource  
class.




When I create & set the dataSource for the first time, the  
NSTableView lists correctly the information; but when I change the  
data in the DataSource object the table view no longer updates to  
reflect the added data.




Can someone tell me where the problem could be ?


- [NSTableView reloadData];

?
___

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: NSTableViewnot reflecting data changes

2008-03-18 Thread Valentin Dan

That was too easy; I'll try to come up with harder problems from now one :) 

All kidding aside ... it works (of course) 

Thanks !

___
Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   
Email: [EMAIL PROTECTED] Office: +40 356-710158
Masstech Group Inc.  Fax:+40 256-220912
http://www.masstechgroup.com 
 
THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.
 
 
-Original Message-
From: Stéphane [mailto:[EMAIL PROTECTED] 
Sent: 18 martie 2008 17:23
To: Valentin Dan
Cc: Cocoa Developers
Subject: Re: NSTableViewnot reflecting data changes


Am Mar 18, 2008 um 4:14 PM schrieb Valentin Dan:

> Hi,
>
>
>
> I have a NSTableView for witch I implemented a custom DataSource  
> class.
>
>
>
> When I create & set the dataSource for the first time, the  
> NSTableView lists correctly the information; but when I change the  
> data in the DataSource object the table view no longer updates to  
> reflect the added data.
>
>
>
> Can someone tell me where the problem could be ?

- [NSTableView reloadData];

?

No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date: 17.03.2008 
10:48
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date: 17.03.2008 
10:48
 
___

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: NSTableViewnot reflecting data changes

2008-03-18 Thread Keary Suska
on 3/18/08 9:14 AM, [EMAIL PROTECTED] purportedly said:

> When I create & set the dataSource for the first time, the NSTableView lists
> correctly the information; but when I change the data in the DataSource object
> the table view no longer updates to reflect the added data.
> 
> Can someone tell me where the problem could be ?

Data source isn't automatic like bindings, so the table doesn't know about
any changes unless you tell it. Did you call -reloadData on your table after
making changes?

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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: Setting Web Proxy programmatically

2008-03-18 Thread parag vibhute
Thanks for URL.

I went through code & system configuation framework. There I found that you
can set HTTP(HTTPS etc.) proxy and also PAC file URL (using
kSCPropNetProxiesProxyAutoConfigURLString key) but I want to configure
proxies using PAC file. When I analyzed network pane of system preferences &
preferences.plist (path is
/Library/Preferences/SystemConfiguration/preferences.plist), I noticed that
in order to set PAC file, there is a key "AppleProxyConfigurationSelected"
in plist which should be 1. I have not found equivalent key for this in
SystemConfiguration framework.

Thanks again,
Palav


There is a bunch of helper to retreive and change configuration.
>
>
> Le 18 mars 08 à 14:38, parag vibhute a écrit :
>
> Thank for reply.
>
> As you said, they are accessible but are they writable? Through search, I
> think they are only readable or for getting notification. But my requirement
> is to change it.
>
> Thanks,
> Palav
>
> On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED]>
> wrote:
>
> > As already said by Basavaraj, all proxy settings are accessible using
> > the "SystemConfiguration" Framework.
> >
> >
> > Le 18 mars 08 à 13:37, parag vibhute a écrit :
> >
> > > My requirement is to set proxy via selecting "Using a PAC file" in
> > > Configure
> > > proxy drop-down button of Network pane of system preferences.
> > >
> > > I have to achieve this programmatically. How to do this?
> > >
> > > Thanks,
> > > Palav
> > >
> > > On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <
> > [EMAIL PROTECTED]
> > > >
> > > wrote:
> > >
> > >>
> > >> Hi Palav,
> > >> Yes it is possible.
> > >>
> > >> You need to use SystemConfiguration framework. You can get all proxy
> > >> information except authentication. So don't try to get proxy
> > >> information
> > >> from network pane. Its useless.
> > >> If you want to use network pane in system preference then use
> > >> CFSocket.
> > >> (Best option)
> > >>
> > >> CFSocket will take care of proxy handling before setting up a new
> > >> connection.
> > >>
> > >> For BSD sockets you need to have all information and need to work
> > >> on proxy
> > >> manually.
> > >> If u have to use BSD sockets, then have ur own proxy settings in your
> > >> application preference pane and use them.
> > >>
> > >> Regards,
> > >> Basavaraj
> > >>
> > >>
> > >>
> > >> On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <
> > [EMAIL PROTECTED]
> > >> >
> > >> wrote:
> > >>
> > >>>
> >
> >
>
>
> --
>
> There are many things in your life that will catch your eye but only a few
> will catch your heartpursue those'.
>
>
>


-- 

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

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: @class causing grief

2008-03-18 Thread Jens Alfke


On 18 Mar '08, at 12:32 AM, Scott Squires wrote:


I'm still getting the following error:
error: syntax error before 'AT_NAME' token

...

#import 
@class myClass;


(1) Does "stdStuff.h" include the AppKit, Foundation or Cocoa  
framework headers? If not, then NSObject itself hasn't been declared.


(2) Inexplicable syntax errors reported on the line following an  
#import or #include are often caused by a mistake on the _previous_  
statement seen by the compiler, i.e. at the end of the imported  
headers. A missing ";" at the end of a declaration is a common source  
of these. So have a look at the bottom of stdStuff.h.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Setting Web Proxy programmatically

2008-03-18 Thread Jean-Daniel Dupas

And the kSCPropNetProxiesProxyAutoConfigEnable key does not do that?

Le 18 mars 08 à 16:50, parag vibhute a écrit :

Thanks for URL.

I went through code & system configuation framework. There I found  
that you can set HTTP(HTTPS etc.) proxy and also PAC file URL (using  
kSCPropNetProxiesProxyAutoConfigURLString key) but I want to  
configure proxies using PAC file. When I analyzed network pane of  
system preferences & preferences.plist (path is /Library/Preferences/ 
SystemConfiguration/preferences.plist), I noticed that in order to  
set PAC file, there is a key "AppleProxyConfigurationSelected" in  
plist which should be 1. I have not found equivalent key for this in  
SystemConfiguration framework.


Thanks again,
Palav


There is a bunch of helper to retreive and change configuration.


Le 18 mars 08 à 14:38, parag vibhute a écrit :


Thank for reply.

As you said, they are accessible but are they writable? Through  
search, I think they are only readable or for getting notification.  
But my requirement is to change it.


Thanks,
Palav

On Tue, Mar 18, 2008 at 6:29 PM, Jean-Daniel Dupas <[EMAIL PROTECTED] 
> wrote:

As already said by Basavaraj, all proxy settings are accessible using
the "SystemConfiguration" Framework.


Le 18 mars 08 à 13:37, parag vibhute a écrit :

> My requirement is to set proxy via selecting "Using a PAC file" in
> Configure
> proxy drop-down button of Network pane of system preferences.
>
> I have to achieve this programmatically. How to do this?
>
> Thanks,
> Palav
>
> On Tue, Mar 18, 2008 at 2:39 PM, Cocoa Developer <[EMAIL PROTECTED]
> >
> wrote:
>
>>
>> Hi Palav,
>> Yes it is possible.
>>
>> You need to use SystemConfiguration framework. You can get all  
proxy

>> information except authentication. So don't try to get proxy
>> information
>> from network pane. Its useless.
>> If you want to use network pane in system preference then use
>> CFSocket.
>> (Best option)
>>
>> CFSocket will take care of proxy handling before setting up a new
>> connection.
>>
>> For BSD sockets you need to have all information and need to work
>> on proxy
>> manually.
>> If u have to use BSD sockets, then have ur own proxy settings in  
your

>> application preference pane and use them.
>>
>> Regards,
>> Basavaraj
>>
>>
>>
>> On Tue, Mar 18, 2008 at 2:22 PM, parag vibhute <[EMAIL PROTECTED]
>> >
>> wrote:
>>
>>>




--

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





--

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


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: reading data from a UDP port - questions

2008-03-18 Thread Rob Napier
Your NSLog() is giving unexpected results because you are using %s.
This is a cstring (not NSString), which is null-terminated. What you
probably mean is this (at least for testing purposes):

   NSLog (@"socketCallback (DMX event). >%@< %i bytes", msg, [msg length]);

This will print the hex codes for the data in msg (so you don't get
garbage in your output). If you want an NSString of the actual bytes,
you can do that with NSString's initWithData:encoding. This *might* be
useful for handing to an NSScanner, but I suspect you'll be happier
hand-rolling the parser.

You either want to stay in NSData for this, or go to raw C. You
probably don't want to mess with NSString. NSData will let you pull
any bytes out you want in order to create a parser.

As mentioned before, using [note object] will get this back out of
your notification.

-Rob


On Sun, Mar 16, 2008 at 3:25 AM, Jason Ellemor <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I have a device which basically outputs a UDP data stream.  FYI the
>  protocol specs are at : http://www.enttec.com/docs/enttec_protocol.pdf
>
>  I found a really helpful post on the forum here titled : Re: Listen
>  on a UDP Port(  http://lists.apple.com/archives/cocoa-dev/2008/Feb/
>  msg01180.html ) which has really helped me build the framework.
>
>  However, I am stuck in 2 ways now - being pretty new to Cocoa also
>  doesn't help.
>
>  I guess, I don't fully understand the code posted enough because I
>  can't seem to access the dictionary object created and posted to the
>  notifications with the previous example.  (FYI my actual code is in
>  appendix 1 below)
>[[NSNotificationCenter defaultCenter]
>  postNotificationName:@"NSFileHandleReadCompletionNotification"
>object:[NSDictionary dictionaryWithObject:[NSData dataWithBytes:&msg
>length:(n * sizeof(u_char))]
>
>  Secondly, the device has "Null" bytes in the output stream and I am
>  guessing if I get the data into a NSString object, when trying to
>  parse the string, it will terminate because of the Null.  And I know
>  that the start of the UDP message (based on the protocol) is
>  ESDD<> and confirmed with a packet sniffer app
>  too (appendix 3), so I can see that when treating as a string, the
>  data will be truncated at the first "Null".
>
>  So if anyone could also help with an idea on how to work with such a
>  data stream, I'd be really grateful.
>
>  many thanks
>
>
>  Jason
>
>
>  1.  SocketCall Back Code
>  static void socketCallback(CFSocketRef cfSocket, CFSocketCallBackType
>  type, CFDataRef address, const void *data, void *userInfo)
>  {
>u_char msg[MAX_UDP_DATAGRAM_SIZE];
>struct sockaddr_in from_addr;
>socklen_t addr_len = sizeof(struct sockaddr_in);
>size_t n = recvfrom(CFSocketGetNative(cfSocket), (void *)&msg,
>  MAX_UDP_DATAGRAM_SIZE, 0, (struct sockaddr *)&from_addr, &addr_len);
>
> NSLog (@"socketCallback (DMX event). >%s< %i bytes", &msg, (n *
>  sizeof(u_char)));
>
>[[NSNotificationCenter defaultCenter]
>  postNotificationName:@"NSFileHandleReadCompletionNotification"
>   
> object:[NSDictionary
>  dictionaryWithObject:[NSData dataWithBytes:&msg
>
> length:(n * sizeof(u_char))]
>
> forKey:@"NSFileHandleNotificationDataItem"]];
>  // How do I retrieve the data from this object in my notification
>  subscription code?
>  }
>
>
>  2. NS Log output of the above:
>  2008-03-16 18:12:08.214 lightapp[10014] socketCallback (DMX event).
>   >ESDD< 521 bytes
>
>  3. Packet Sniffer output is:
>  Headerlength: 522 bytes, Data follows:
>
>  0   45 53 44 44 00 00 01 02  00 00 03 05 00 00 05 05
>  ESDD
>  00010   00 00 03 03 c6 39 00 00  00 00 02 02 04 04 00 05.
>  9..
>
___

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: interface builder 3 question

2008-03-18 Thread Jack Repenning

On Mar 17, 2008, at 11:44 PM, [EMAIL PROTECTED] wrote:
Starting with Interface Builder 3, it is suggested that you don't  
define
your class in IB and have it generate the code.  Instead you define  
it in

XCode and IB will stay in sync with those changes.


I've been getting a sense of surprise over this, like it's not always  
working.  Can anyone explain to me exactly when this synchronization  
happens?  I feel it happens sometimes, and not others, and rather than  
be surprised I've gone back to reading the headers manually.  Maybe if  
I understood the timing of this "stay in sync" thing, I wouldn't feel  
so timorous.


-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning




___

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]


NSTableView solution feedback and questions

2008-03-18 Thread Jay Martin

All,

I'm new to Cocoa (surprise) and I'm now working on a little app, and  
I've come up with a solution to an issue and I'd like some feedback on  
that solution. Here's the problem description:


I have an NSTableView, bound to an NSArrayController, which is bound  
to my custom object. So far so good. I can change attributes, add,  
remove, all that good stuff. Now, my custom object can have one  
property changed programmatically by an NSTimer. Of course, when the  
change happens, the object is updated but not the NSTableView.


So, I implemented a notification in the set method for that property,  
and registered a notification listener in my app controller. Now, when  
the app controller sees the update to that property, it calls  
reloadData method on the NSTableView. That seems to work nicely.


Except one thing: if I'm in the middle of editing a different row when  
the NSTableView:reloadData method is called, the editing is ended. One  
obvious way around this is to not allow in-line editing of the data in  
the table, but rather in a separate set of controls for the object for  
the selected row. That's where I am currently.


So, my first question is, am I missing something fundamental here? Is  
this the "right" way of doing it, or is there a better way? I thought  
maybe KVO might be a solution, but it didn't really seem appropriate  
to this situation. I suppose you could try to manually update just the  
cell, right?


My second question is more general. I've basically just completed the  
Cocoa Programming book by Hillegass. Is there a "next" logical book/ 
document to read, or is it just time to write lots of experimental  
code and ask questions?


Thanks!

jay
___

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]


@class causing grief

2008-03-18 Thread Stuart Malin

Scott,

I notice that I get the AT_NAME compiler error when I've forgotten or  
mistyped a semicolon _prior_ to the place where an @ symbol is used.  
For instance, in the following code:


@class  SomeClassA
@class  SomeClassB;

@interface test : NSObject {

SomeClassA  *someClassA;
SomeClassB  *someClassB;
}


The compiler will report "parse error before 'AT_NAME' token for the  
line

@class  SomeClassB;
yet the problem is on the _prior_ line -- the missing semicolon at  
the end -- and so the token "SomeClassA" ends up not being defined  
(which is why the compiler will also report "parse error before  
'SomeClassA'" for the line

SomeClassA  *someClassA;

HTH,
--Stuart


On Mar 17, 2008, at 11:48 PM, Scott Squireswrote:


I'm starting to go in circles at this point.
I know I've got a number of interconnecting files.
Since I was getting errors I replaced the #import as much as possible
with @class defines

I'm still getting the following error:
error: syntax error before 'AT_NAME' token

This indicates @class myClass; in the following examples.
Most of these work fine but if I end up swapping #import instead then
other areas break the compiler.

Any suggestions on areas to look at (missing @end or something else?)

Thanks.

example:

#import 
@class myClass;

@interface anotherClass : NSObject
{

myClass *theMyClassObject;

}

@end


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSTableView solution feedback and questions

2008-03-18 Thread Jeff LaMarche

Jay:

Well, I've never had this particular situation, but you could try  
registering for textDidBeginEditing) notification from the table view,  
then your code will have a way of knowing when the user is editing a  
table. If it's currently being edited when your timer method starts to  
do an update, you could use the editedColumn and editedRow methods to  
determine if the cell being edited is the one you need to update and  
hold off on doing the reloadData method until after they finish  
editing (you can use the textDidEndEditing for that one).


If the update is in the row they are editing, then you need to figure  
out how to deal with that, it's going to be specific to your  
application. You might present them with a sheet that tells them what  
the update is and let them choose which one to keep.


Hope this helps.
Jeff


On Mar 18, 2008, at 1:17 PM, Jay Martin wrote:


All,

I'm new to Cocoa (surprise) and I'm now working on a little app, and  
I've come up with a solution to an issue and I'd like some feedback  
on that solution. Here's the problem description:


I have an NSTableView, bound to an NSArrayController, which is bound  
to my custom object. So far so good. I can change attributes, add,  
remove, all that good stuff. Now, my custom object can have one  
property changed programmatically by an NSTimer. Of course, when the  
change happens, the object is updated but not the NSTableView.


So, I implemented a notification in the set method for that  
property, and registered a notification listener in my app  
controller. Now, when the app controller sees the update to that  
property, it calls reloadData method on the NSTableView. That seems  
to work nicely.


Except one thing: if I'm in the middle of editing a different row  
when the NSTableView:reloadData method is called, the editing is  
ended. One obvious way around this is to not allow in-line editing  
of the data in the table, but rather in a separate set of controls  
for the object for the selected row. That's where I am currently.


So, my first question is, am I missing something fundamental here?  
Is this the "right" way of doing it, or is there a better way? I  
thought maybe KVO might be a solution, but it didn't really seem  
appropriate to this situation. I suppose you could try to manually  
update just the cell, right?


My second question is more general. I've basically just completed  
the Cocoa Programming book by Hillegass. Is there a "next" logical  
book/document to read, or is it just time to write lots of  
experimental code and ask questions?


Thanks!

jay
___

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/jeff_lamarche%40mac.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Python/Ruby for Cocoa (was: Simple question)

2008-03-18 Thread Scott Thompson
I completely agree - and I wrote CamelBones, the Cocoa/Perl bridge.  
It is,
and always has been, my opinion that language bridges are not an  
adequate
substitute for learning Cocoa's native language, Objective-C. What  
they are

*great* for is giving additional options to a skilled programmer who's
already familiar with both Cocoa and a scripting language. Someone  
who tries
to use them as a means to avoid Objective-C is just setting  
themselves up

for a lot of frustration.


I also find that (if you're already familiar with Cocoa, and if you're  
willing to put up with the corner cases) languages bridges like the  
Ruby, Python, and Perl bridges are really great tools for prototyping  
things quickly, and learning new APIs.For example, with Leopard  
I've used Ruby to learn more about the RSS handling of the Publish and  
Subscribe APIs, as well as to explore some of the functionality found  
in the scripting bridge.  YMMV.


Someday I should try using F-Script for that kind of thing too...

Scott

___

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]


XCode3 errors on startup

2008-03-18 Thread Steve Cronin

Folks;

When I start XCode3 in Leopard I am seeing the following in Console.app.

Any ideas on what is going on?
Steve


3/18/08 8:27:39 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x2963030, has non-zero refcount = 1
3/18/08 8:27:39 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x2963d90, has non-zero refcount = 1
3/18/08 8:27:39 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x2963030, has  
non-zero refcount = 1
3/18/08 8:27:39 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x2963d90, has  
non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x31cfed0, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3725640, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x30ed7e0, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x31a9610, has non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x31cfed0, has  
non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3725640, has  
non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x30ed7e0, has  
non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x31a9610, has  
non-zero refcount = 1
3/18/08 8:33:18 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x318bda0, has non-zero refcount = 1
3/18/08 8:33:18 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3245320, has non-zero refcount = 1
3/18/08 8:33:26 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3047dc0, has non-zero refcount = 1
3/18/08 8:33:26 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x308a7c0, has non-zero refcount = 1
3/18/08 8:33:18 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x318bda0, has  
non-zero refcount = 1
3/18/08 8:33:18 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3245320, has  
non-zero refcount = 1
3/18/08 8:33:26 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3047dc0, has  
non-zero refcount = 1
3/18/08 8:33:26 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x308a7c0, has  
non-zero refcount = 1
3/18/08 8:34:05 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x34d2750, has non-zero refcount = 1
3/18/08 8:34:05 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x34ef4d0, has non-zero refcount = 1
3/18/08 8:34:05 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x34d2750, has  
non-zero refcount = 1
3/18/08 8:34:05 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x34ef4d0, has  
non-zero refcount = 1
3/18/08 8:34:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3292dd0, has non-zero refcount = 1
3/18/08 8:34:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3295380, has non-zero refcount = 1
3/18/08 8:34:50 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3292dd0, has  
non-zero refcount = 1
3/18/08 8:34:50 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3295380, has  
non-zero refcount = 1

3/18/08 8:35:12 AM momc[685] momc compiling for 10.4 target
3/18/08 8:35:22 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x35848b0, has non-zero refcount = 1
3/18/08 8:35:22 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x358bc40, has non-zero refcount = 1
3/18/08 8:35:22 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x35848b0, has  
non-zero refcount = 1
3/18/08 8:35:22 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x358bc40, has  
non-zero refcount = 1
3/18/08 8:35:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3432ea0, has non-zero refcount = 1
3/18/08 8:35:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x345e130, has non-zero refcount = 1
3/18/08 8:35:50 AM [0x0-0xd00d].com.apple.Xcode[110] Xcode 
(110,0xb0103000) malloc: free_garbage:

Carbon Menu in Cocoa app

2008-03-18 Thread cai qin
Hi all,
I've searched the list and googled this problem , but I still don't get the
exact solution.
I have a cocoa app developed in Tiger . Is it possible that Using a carbon
menuRef to get App 's mainMenu?
I have tried the MenuRef _NSGetCarbonMenu(NSMenu* aMenu); but my menuRef
always gets 0x0.
Is this private API still available  ?

I also downloaded MenuViews examples , it gets 5 errors said that it lacks
TCarbonEvent.cp ,TObject.cp , TRect.cp , TView.cp in the HIToolbox.
Is this MenuViews example expired in Tiger?
___

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: XCode3 errors on startup

2008-03-18 Thread Nick Zitzmann


On Mar 18, 2008, at 11:29 AM, Steve Cronin wrote:
When I start XCode3 in Leopard I am seeing the following in  
Console.app.


Any ideas on what is going on?



1. IANTM, but the xcode-users list is the place where Xcode discussion  
should go.


2. Are you actually having problems running Xcode? I think you're just  
seeing some debug logging.


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: XCode3 errors on startup

2008-03-18 Thread j o a r


On Mar 18, 2008, at 10:29 AM, Steve Cronin wrote:

When I start XCode3 in Leopard I am seeing the following in  
Console.app.

Any ideas on what is going on?



This question belongs, and has been answered, on Xcode-Users:



j o a r


___

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: CoreData code working on Tiger - not on Leopard

2008-03-18 Thread Steve Cronin

Folks;

I have a little more data on this issue:

After I have done any insert, if I subsequently call - 
processPendingChanges  I get an error in CoreData.
There are no pending messages in the log and no custom catch blocks  
(other than what is show below).

The debugger halts on the @try command

The Code:
@try { [moc processPendingChanges]; }
@catch ( NSException *e ) {
		NSLog(@"%@: Caught %@: %@", NSStringFromSelector(_cmd), [e name],  
[e  reason]);

}

The Log:
Program received signal:  “EXC_BAD_ACCESS”.

The Stack:
#0  0x93d736ec in objc_msgSend
#1	0x9649aed1 in -[NSManagedObjectContext 
(_NSInternalChangeProcessing)  
_registerUndoForOperation:withObjects:withExtraArguments:]
#2	0x9649adef in -[NSManagedObjectContext 
(_NSInternalChangeProcessing) _registerUndoForInsertedObjects:]
#3	0x9649a038 in -[NSManagedObjectContext 
(_NSInternalChangeProcessing) _processRecentChanges:]

#4  0x964adbea in -[NSManagedObjectContext processPendingChanges]
#5	0x00089636 in +[DataImporter importSuppotDataInContext:] at  
DataImporter.m:75


The Maddening Part:
All of the code works like a charm on Tiger.

I know I must be missing something pretty basic in the Leopard world  
but I sure would appreciate a pointer to what that might be!


Thanks!
Steve

On Mar 18, 2008, at 2:33 AM, Steve Cronin wrote:


Folks;

I am now testing a Tiger application on Leopard and learning the  
new Leopard way at the same time.

I admit I have a lot of Leoparding to do!

I use Core Data (SQLite) pretty extensively on Tiger - life is good.

I take the project and run it without any changes to the model or  
the code and Core Date won't save to disk.


I load a set of data on initial launch and at the end of that  
process I have Core Data 'save'.

The data loading all appears to run fine:
			recX = [NSEntityDescription  
insertNewObjectForEntityForName:@"XYZ" inManagedObjectContext:moc];

[recX setValue:@"123" forKey:@"source"];
...

5 different entities and 1,000s of records..

I've looked over the 'Core Data - Release Notes' but I don't see  
anything that seems to indicate a model conversion or persistant  
store conversions I have not made any changes (no versioning...)


Here's the 'save' code:
- (void) updateCoreData {
NSManagedObject *moc = [self managedObjectContext];
[moc processPendingChanges];
if ([moc commitEditing]) {
NSError *error;
if ([moc save:&error])  {
if (error!=nil) {

On Leopard in the 'processPendingChanges' invocation I get the  
following:


0   0x900ef0f4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1  0x93d680fb in objc_exception_throw
#2	0x9649a2a5 in -[NSManagedObjectContext 
(_NSInternalChangeProcessing) _processRecentChanges:]

#3  0x964adbea in -[NSManagedObjectContext processPendingChanges]
#4  0x0002032e in -[AppDelegate updateCoreData] at AppDelegate.m:700

BTW:  I also get a similar error if, during the loading, I try to  
get a 'count' using a FetchTemplate with a null predicate (works on  
Tiger)

It appears the fetch also causes a 'processRecentChanges)

What am I missing?

Thanks for your help!
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: Carbon Menu in Cocoa app

2008-03-18 Thread Nick Zitzmann


On Mar 18, 2008, at 11:32 AM, cai qin wrote:
I have a cocoa app developed in Tiger . Is it possible that Using a  
carbon

menuRef to get App 's mainMenu?
I have tried the MenuRef _NSGetCarbonMenu(NSMenu* aMenu); but my  
menuRef

always gets 0x0.
Is this private API still available  ?



I don't think so; at least not anymore. What are you trying to  
accomplish?


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: NSTableView solution feedback and questions

2008-03-18 Thread Laurent Cerveau


On Mar 18, 2008, at 6:17 PM, Jay Martin <[EMAIL PROTECTED]> wrote:


All,

I'm new to Cocoa (surprise) and I'm now working on a little app, and  
I've come up with a solution to an issue and I'd like some feedback  
on that solution. Here's the problem description:


I have an NSTableView, bound to an NSArrayController, which is bound  
to my custom object. So far so good. I can change attributes, add,  
remove, all that good stuff. Now, my custom object can have one  
property changed programmatically by an NSTimer. Of course, when the  
change happens, the object is updated but not the NSTableView.


So, I implemented a notification in the set method for that  
property, and registered a notification listener in my app  
controller. Now, when the app controller sees the update to that  
property, it calls reloadData method on the NSTableView. That seems  
to work nicely.


If your data model is updated but not the Table View simply calling  
setNeedsDisplay on the tv should be enough and less expensive (you can  
even simply call it for rects of cells to be updated)


Laurent


Except one thing: if I'm in the middle of editing a different row  
when the NSTableView:reloadData method is called, the editing is  
ended. One obvious way around this is to not allow in-line editing  
of the data in the table, but rather in a separate set of controls  
for the object for the selected row. That's where I am currently.


So, my first question is, am I missing something fundamental here?  
Is this the "right" way of doing it, or is there a better way? I  
thought maybe KVO might be a solution, but it didn't really seem  
appropriate to this situation. I suppose you could try to manually  
update just the cell, right?


My second question is more general. I've basically just completed  
the Cocoa Programming book by Hillegass. Is there a "next" logical  
book/document to read, or is it just time to write lots of  
experimental code and ask questions?


Thanks!

jay
___

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/lcerveau%40mac.com

This email sent to [EMAIL PROTECTED]

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: interface builder 3 question

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 10:15, Jack Repenning wrote:

I've been getting a sense of surprise over this, like it's not  
always working.  Can anyone explain to me exactly when this  
synchronization happens?  I feel it happens sometimes, and not  
others, and rather than be surprised I've gone back to reading the  
headers manually.  Maybe if I understood the timing of this "stay in  
sync" thing, I wouldn't feel so timorous.


It happens at least as often as you activate the IB application (i.e.  
bring it frontmost), but probably oftener.


You can watch the synchronization happen -- change something in Xcode  
that affects the file that IB has open (e.g. a @interface) and you'll  
see the green synchronization indicator at the bottom of the IB window  
turn yellow. At some point, it will turn green again. (Though perhaps  
this may happen quickly enough on your Mac that you won't see it.)



___

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: XCode3 errors on startup

2008-03-18 Thread Jean-Daniel Dupas
Yes, Xcode love to tell you what it does, but it's not really  
important. All those warning are a side effect of garbage collection  
in software that use to leak nad should be ignored.



Le 18 mars 08 à 18:29, Steve Cronin a écrit :


Folks;

When I start XCode3 in Leopard I am seeing the following in  
Console.app.


Any ideas on what is going on?
Steve


3/18/08 8:27:39 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x2963030, has non-zero refcount = 1
3/18/08 8:27:39 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x2963d90, has non-zero refcount = 1
3/18/08 8:27:39 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x2963030,  
has non-zero refcount = 1
3/18/08 8:27:39 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x2963d90,  
has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x31cfed0, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3725640, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x30ed7e0, has non-zero refcount = 1
3/18/08 8:33:16 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x31a9610, has non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x31cfed0,  
has non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3725640,  
has non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x30ed7e0,  
has non-zero refcount = 1
3/18/08 8:33:16 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x31a9610,  
has non-zero refcount = 1
3/18/08 8:33:18 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x318bda0, has non-zero refcount = 1
3/18/08 8:33:18 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3245320, has non-zero refcount = 1
3/18/08 8:33:26 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3047dc0, has non-zero refcount = 1
3/18/08 8:33:26 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x308a7c0, has non-zero refcount = 1
3/18/08 8:33:18 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x318bda0,  
has non-zero refcount = 1
3/18/08 8:33:18 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3245320,  
has non-zero refcount = 1
3/18/08 8:33:26 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3047dc0,  
has non-zero refcount = 1
3/18/08 8:33:26 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x308a7c0,  
has non-zero refcount = 1
3/18/08 8:34:05 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x34d2750, has non-zero refcount = 1
3/18/08 8:34:05 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x34ef4d0, has non-zero refcount = 1
3/18/08 8:34:05 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x34d2750,  
has non-zero refcount = 1
3/18/08 8:34:05 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x34ef4d0,  
has non-zero refcount = 1
3/18/08 8:34:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3292dd0, has non-zero refcount = 1
3/18/08 8:34:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3295380, has non-zero refcount = 1
3/18/08 8:34:50 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3292dd0,  
has non-zero refcount = 1
3/18/08 8:34:50 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x3295380,  
has non-zero refcount = 1

3/18/08 8:35:12 AM momc[685] momc compiling for 10.4 target
3/18/08 8:35:22 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x35848b0, has non-zero refcount = 1
3/18/08 8:35:22 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x358bc40, has non-zero refcount = 1
3/18/08 8:35:22 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x35848b0,  
has non-zero refcount = 1
3/18/08 8:35:22 AM [0x0-0xd00d].com.apple.Xcode[110]  
Xcode(110,0xb0103000) malloc: free_garbage: garbage ptr = 0x358bc40,  
has non-zero refcount = 1
3/18/08 8:35:50 AM Xcode[110] Xcode(110,0xb0103000) malloc:  
free_garbage: garbage ptr = 0x3432ea0, has non-zer

Getting notifications when any file in a folder change

2008-03-18 Thread Mr. Gecko
Hello I am wondering how to get my program to notice when a file  
changes in a folder.
For an example I have a bundle with files in it that gets opened with  
another program and I want my program to know when the other program  
saves and what file it saved in that bundle so that my program can  
update the view with the saved file that changed in the bundle. How  
would I get notified when something like that happens.  I don't want  
to do a loop updating all the time.  that would cause bad things to  
happen.


Thanks for tips and help.

Mr. Gecko
___

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: @class causing grief

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 10:18, Stuart Malin wrote:

The compiler will report "parse error before 'AT_NAME' token for the  
line

@class  SomeClassB;
yet the problem is on the _prior_ line -- the missing semicolon at  
the end -- and so the token "SomeClassA" ends up not being defined  
(which is why the compiler will also report "parse error before  
'SomeClassA'" for the line

SomeClassA  *someClassA;



To be even blunter about it, the gcc is striking in its dogged  
reporting of the point at which the error was detected, not the point  
at which the error occurred. (The latter is harder to do of course. I  
think I've never seen a commercial-grade compiler before gcc that made  
*no* attempt to find the point of occurrence, at least in the easy  
cases.)


Consequently, gcc doesn't attempt much in the way of error recovery,  
such as the common case of assuming a missed semi-colon so as not to  
mess up the following statement or declaration.


In most cases, none of this matters for a fast-turn-around compiler,  
but there will always be some simple errors like the one in this  
thread that cause some wasteful head scratching.


But I've gone OT. Sorry.

___

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]


Best way to execute a shell script from a cocoa application

2008-03-18 Thread Ryan Chapman


What is the best way to execute a shell script from a Cocoa application?  
I need to be able to specify arguments, like what execv() provides.


-Ryan



___

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: Getting notifications when any file in a folder change

2008-03-18 Thread j o a r


On Mar 18, 2008, at 11:07 AM, Mr. Gecko wrote:

Hello I am wondering how to get my program to notice when a file  
changes in a folder.



See:





j o a r


___

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: Carbon Menu in Cocoa app

2008-03-18 Thread Daniel zeilMal
I have a custom view . And I have drew something on this view . I want to
add a custom view to a menuItem . But this is not supported before Leopard .So
I'm going to ask help to carbon.
The main idea is that I get the menuRef from the [NSApp mainMenu] ,and then
draw something on that specific menuItem .
I want to keep the other menuitems handled by cocoa .Cause I have already
written a lot of menu responder message handling staff in cocoa.


2008/3/18, Nick Zitzmann <[EMAIL PROTECTED]>:
>
>
> On Mar 18, 2008, at 11:32 AM, cai qin wrote:
> > I have a cocoa app developed in Tiger . Is it possible that Using a
> > carbon
> > menuRef to get App 's mainMenu?
> > I have tried the MenuRef _NSGetCarbonMenu(NSMenu* aMenu); but my
> > menuRef
> > always gets 0x0.
> > Is this private API still available  ?
>
>
>
> I don't think so; at least not anymore. What are you trying to
> accomplish?
>
>
> 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: Best way to execute a shell script from a cocoa application

2008-03-18 Thread Jean-Daniel Dupas


Le 18 mars 08 à 19:14, Ryan Chapman a écrit :




What is the best way to execute a shell script from a Cocoa  
application?

I need to be able to specify arguments, like what execv() provides.


-Ryan


NSTask  is able to launch an executable with arguments.


___

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: NSTableView solution feedback and questions

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 10:17, Jay Martin wrote:

I have an NSTableView, bound to an NSArrayController, which is bound  
to my custom object. So far so good. I can change attributes, add,  
remove, all that good stuff. Now, my custom object can have one  
property changed programmatically by an NSTimer. Of course, when the  
change happens, the object is updated but not the NSTableView.


So, I implemented a notification in the set method for that  
property, and registered a notification listener in my app  
controller. Now, when the app controller sees the update to that  
property, it calls reloadData method on the NSTableView. That seems  
to work nicely.


Except one thing: if I'm in the middle of editing a different row  
when the NSTableView:reloadData method is called, the editing is  
ended. One obvious way around this is to not allow in-line editing  
of the data in the table, but rather in a separate set of controls  
for the object for the selected row. That's where I am currently.


So, my first question is, am I missing something fundamental here?  
Is this the "right" way of doing it, or is there a better way? I  
thought maybe KVO might be a solution, but it didn't really seem  
appropriate to this situation. I suppose you could try to manually  
update just the cell, right?


If I understand this right, you shouldn't be calling reloadData at all.

The array controller "watches" the table column properties for free.  
That's what it's for. Or rather, the table view watches the array  
controller, and the array controller watches the object it's bound to.  
So long as that object is KVC-compliant for the property, it should  
show up in the table automatically whenever it is set, from whatever  
source.


What are the specific bindings you're using here?

Presumably the table column is bound to the array controller's  
selection with key propertyName.


Presumably the array controller is bound to the app controller as  
File's Owner with key ... what? No key, or customObject?


My guess is you've bound the array controller to the app controller,  
and the app controller isn't KVC-compliant for its key, even though  
the custom object is for its key.

___

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: Carbon Menu in Cocoa app

2008-03-18 Thread Kyle Sluder
On Tue, Mar 18, 2008 at 2:25 PM, Daniel zeilMal <[EMAIL PROTECTED]> wrote:
> I have a custom view . And I have drew something on this view . I want to
>  add a custom view to a menuItem . But this is not supported before Leopard 
> .So

Are you trying to use _NSGetCarbonMenu on Leopard?  If so, just go
with the NSView in NSMenu approach.  Leave _NSGetCarbonMenu for Tiger
only.  Since the symbol is still defined on Leopard (even though it's
giving you NULL) a simple if statement should suffice.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSTableView solution feedback and questions

2008-03-18 Thread Jay Martin
If your data model is updated but not the Table View simply calling  
setNeedsDisplay on the tv should be enough and less expensive (you  
can even simply call it for rects of cells to be updated)


Laurent


That's it! Using setNeedsDisplay (instead of reloadData) on the  
TableView while another cell is being edited causes the TableView to  
update but not to interrupt to the editing process.


Thanks!!
jay
___

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: Carbon Menu in Cocoa app

2008-03-18 Thread Daniel zeilMal
NO , I'm not going to use it on leopard . Cause in leopard , NSMenuItem
support setting custom views using API setView:.What I want , just using it
in Tiger .



extern MenuRef _NSGetCarbonMenu( NSMenu *menu);


@implementation MyController


OSStatus PictureHandler( EventHandlerCallRef caller, EventRef event,

 void* refcon )

{

OSStatuserr = eventNotHandledErr;

WindowRef   owner;

 GetEventParameter( event, kEventParamControlCurrentOwningWindow,

   typeWindowRef, NULL, sizeof( owner ), NULL, &owner );

 if ( owner != NULL )

{

// find the content view

HIViewRef content;

HIViewFindByID( HIViewGetRoot( owner ), kHIViewWindowContentID,

&content );

 // create a data provider for our image

CFURLRef url = CFBundleCopyResourceURL( CFBundleGetMainBundle(),

CFSTR("NSApplication"), CFSTR(".icns"), NULL );

CGDataProviderRef data = CGDataProviderCreateWithURL( url );

CFRelease( url );

 // create our image

CGImageRef image = CGImageCreateWithJPEGDataProvider( data, NULL,

  true, kCGRenderingIntentDefault );

CFRelease( data );

 // create our image view

HIViewRef imageView;

HIImageViewCreate( image, &imageView );

HIImageViewSetOpaque( imageView, false );

HIImageViewSetAlpha( imageView, 0.3 );

CFRelease( image );

 // position our image view below the content view's children

HIViewAddSubview( content, imageView );

HIViewSetZOrder( imageView, kHIViewZOrderBelow, NULL );

HIViewSetVisible( imageView, true );

 // size our image view to match the content view

HIRect bounds;

HIViewGetBounds( content, &bounds );

HIViewSetFrame( imageView, &bounds );

}

return err;

}


-(void) awakeFromNib

{

CFBundleRef bundleRef;

IBNibRef nibRef;

MenuRef myMenuRef;

HIViewRef theView;

EventTypeSpec myEvent;

 OSStatus err;

 //bundleRef = CFBundleGetMainBundle();

//err = CreateNibReferenceWithCFBundle(bundleRef,CFSTR("MainMenu"),
&nibRef);

//if(err)

// NSLog(@"load menu nib failed");

//CreateMenuFromNib(nibRef,CFSTR("myMain"),&myMenuRef);

//InsertMenu(myMenuRef,0);

 NSMenu *menu = [NSApp mainMenu];

myMenuRef = _NSGetCarbonMenu(menu);

 HIMenuGetContentView(myMenuRef,kThemeMenuTypePullDown,&theView);

myEvent.eventClass = kEventClassControl;

myEvent.eventKind  = kEventControlOwningWindowChanged;

//

EventHandlerUPP handlerUPP;

handlerUPP = NewEventHandlerUPP(PictureHandler);

InstallControlEventHandler(theView,handlerUPP,2,&myEvent,0,NULL);

}

@end

this is the piece of code . I take the example of HIView Programming Guide
- Manipulating menu views
http://developer.apple.com/documentation/Carbon/Conceptual/HIViewDoc/HIView_tasks/chapter_3_section_12.html#//apple_ref/doc/uid/TP3923-CH205-BAJIDJDH


so After I call _NSGetCarbonMenu(menu); myMenuRef is always 0x0 .
Must I create the carbon menu in the NIb instead of cocoa menu if I want to
get the correct menuRef?

2008/3/18, Kyle Sluder <[EMAIL PROTECTED]>:
>
> On Tue, Mar 18, 2008 at 2:25 PM, Daniel zeilMal <[EMAIL PROTECTED]>
> wrote:
> > I have a custom view . And I have drew something on this view . I want
> to
> >  add a custom view to a menuItem . But this is not supported before
> Leopard .So
>
>
> Are you trying to use _NSGetCarbonMenu on Leopard?  If so, just go
> with the NSView in NSMenu approach.  Leave _NSGetCarbonMenu for Tiger
> only.  Since the symbol is still defined on Leopard (even though it's
> giving you NULL) a simple if statement should suffice.
>
>
> --Kyle Sluder
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Getting notifications when any file in a folder change

2008-03-18 Thread Ryan Chapman
And here are a few implementations of FSEvents:


Open source implemenation of how to subscribe to file system events
http://greenearthcommons.org/rian/gfslogger/


Command line utility that shows file system events in real time
http://www.kernelthread.com/software/fslogger/


GUI utility that shows fs events
http://www.fernlightning.com/doku.php?id=software:fseventer:start



- Original Message 
From: j o a r <[EMAIL PROTECTED]>
To: Mr. Gecko <[EMAIL PROTECTED]>
Cc: cocoa-dev@lists.apple.com
Sent: Tuesday, March 18, 2008 2:16:16 PM
Subject: Re: Getting notifications when any file in a folder change


On Mar 18, 2008, at 11:07 AM, Mr. Gecko wrote:

> Hello I am wondering how to get my program to notice when a file  
> changes in a folder.


See:




j o a r


___

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/ryan%40heatery.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: NSTableView solution feedback and questions

2008-03-18 Thread Keary Suska
on 3/18/08 11:17 AM, [EMAIL PROTECTED] purportedly said:

> I have an NSTableView, bound to an NSArrayController, which is bound
> to my custom object. So far so good. I can change attributes, add,
> remove, all that good stuff. Now, my custom object can have one
> property changed programmatically by an NSTimer. Of course, when the
> change happens, the object is updated but not the NSTableView.

Chances are, you are not updating the property in a KVO-compliant way.
First, make sure you are doing things correctly, before kludging a
workaround.

See: 
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Conc
epts/Troubleshooting.html#//apple_ref/doc/uid/TP40002148-DontLinkElementID_6

And if you haven't read that whole document, you really really need to.

> My second question is more general. I've basically just completed the
> Cocoa Programming book by Hillegass. Is there a "next" logical book/
> document to read, or is it just time to write lots of experimental
> code and ask questions?

Write lots of experimental code, but read relevant docs *before* you ask
questions. Get AppKiDo . Not only
does it greatly simplify browsing the API, it also makes it easy to find
conceptual documentation.

Unfortunately, just about every Cocoa book on the market is sorely out of
date. Kochan's Objectice-C book, however, is a must-have must-read.

Best, 

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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: Confused about CFRunLoop

2008-03-18 Thread Hamish Allan
On Tue, Mar 18, 2008 at 1:41 PM, Brian Greenstone <[EMAIL PROTECTED]> wrote:

>  Now I just need to figure out the
>  CF equivalent of thos NSApplication calls and then I can be Obj-C
>  free ;)

You're asking in the wrong place. Perhaps try
http://lists.apple.com/mailman/listinfo/carbon-dev ?

Hamish
___

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: interface builder 3 question

2008-03-18 Thread Jonathan Hess

Hey Jack -

IB syncs with Xcode whenever a document comes to the foreground and  
there is an open project for that document. IB only syncs the files as  
the appear on disk, so if you have unsaved changes in an editor  
window, IB won't pick them up.  IB also only pulls in the headers from  
the project you are working with. If you're using multiple projects,  
you may need to read the headers for base classes manually.


Hope that clears things up -
Jon Hess


On Mar 18, 2008, at 10:15 AM, Jack Repenning wrote:


On Mar 17, 2008, at 11:44 PM, [EMAIL PROTECTED] wrote:
Starting with Interface Builder 3, it is suggested that you don't  
define
your class in IB and have it generate the code.  Instead you define  
it in

XCode and IB will stay in sync with those changes.


I've been getting a sense of surprise over this, like it's not  
always working.  Can anyone explain to me exactly when this  
synchronization happens?  I feel it happens sometimes, and not  
others, and rather than be surprised I've gone back to reading the  
headers manually.  Maybe if I understood the timing of this "stay in  
sync" thing, I wouldn't feel so timorous.


-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning




___

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/jhess%40apple.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: Modifying glyph storage in NSLayoutManager

2008-03-18 Thread Ross Carter


On Mar 17, 2008, at 11:19 PM, Martin Wierschin wrote:
I have some text items whose glyphs cannot be determined until  
layout. The text string might contain a marker to draw the current  
page number, or to sequentially number paragraphs, etc. The glyphs  
can be determined only by the layout manager; different layout  
managers for the same text storage might display different page  
numbers, for example.


One alternative to the glyph generator is to subclass  
NSTextAttachment. The attachment cell can query the text container /  
layout manager for any information it needs during cell frame  
calculation and drawing.


~Martin


Thanks Martin, that might well be the only solution. I'm going to  
fiddle with glyph storage a while longer before I give up and try  
NSAttachment. Following Douglas's advice on looking to the typesetter  
rather than the glyph generator or layout manager, I've been hitting  
NSATSTypesetter with  everything I can think of. Maybe I'm just  
pushing the text system too hard. For example, the typesetter method -  
(void)substituteGlyphsInRange:(NSRange)glyphRange withGlyphs:(NSGlyph  
*)glyphs looks mighty promising, and the docs say the method can be  
overridden by subclasses, but apparently it works only if you replace  
the glyphs on a 1-for-1 basis. Or maybe I'm just not calling it at the  
right time.


Ross
___

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: interface builder 3 question

2008-03-18 Thread Jack Repenning


On Mar 18, 2008, at 1:06 PM, Jonathan Hess wrote:
IB syncs with Xcode whenever a document comes to the foreground and  
there is an open project for that document. IB only syncs the files  
as the appear on disk, so if you have unsaved changes in an editor  
window, IB won't pick them up.  IB also only pulls in the headers  
from the project you are working with. If you're using multiple  
projects, you may need to read the headers for base classes manually.


Ah: "as they appear on disk" was probably what I was missing.  But the  
whole response is a model of clarity and concision; thanks!


-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning




___

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]


NSTableView double click binding and clickedRow

2008-03-18 Thread Paul Thomas
I have an NSTableView (multiple selection, not editable) and I want to  
do something with the elements of the displayed list when the user  
double clicks. Even though the table has multiple selection, I only  
want to action the single element that the user double-clicked.


If I set up a target/action message using setTarget: and  
setDoubleAction:, everything works fine and I can get clickedRow to  
tell me the row.


If I use bindings in IB3 and bind "Double Click Target", I get the  
action message, but clickedRow is always -1.


So, is this a bug? If so, I'll radar it. But I wanted to check if this  
is expected behaviour because of something special about bindings.


ta,
pt.
___

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]


NSTextField value binding (feeling like a newbie)

2008-03-18 Thread Jeff LaMarche
Working with IB3 to try and get my bearings again, and I know I'm  
doing something stupid here. I have an NSTextField inside an  
NSScrollView created in IB3. I have bound the value binding of the  
NSTextField to an NSString called feedback, exposed as an Objective-C  
2.0 property,declared like this:


@property (retain, nonatomic) NSMutableString *feedback;

In my implementation, use @synthesize to have it build the accessors  
and mutators. The binding is set to Continuously Updates Values, and  
is not editable, and has rich text turned off. If I run my program,  
and make changes to the string (feedback), those are not reflected in  
the text field even though I can tell through the debugger that the  
string is changing.


I suspect I'm doing something really stupid, but I'm stumped, and  
nothing in the archives pointed me in the right direction. The  
Objective-C 2.0 book seems to indicate that properties are KVC  
compliant, but maybe I missed something?


Any thoughts would be much appreciated.

Thanks,
Jeff
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the 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: NSTextField value binding (feeling like a newbie)

2008-03-18 Thread Jeff LaMarche

On Mar 18, 2008, at 5:33 PM, Jeff LaMarche wrote:

. If I run my program, and make changes to the string (feedback),  
those are not reflected in the text field even though I can tell  
through the debugger that the string is changing.


Just a clarification, if I populate the string with a starting value,  
that does show up in the text view, so I know the binding is working,  
partially at least.

___

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-dev Digest, Vol 5, Issue 430

2008-03-18 Thread James Hober

On Mar 18, 2008, at 11:36 AM, [EMAIL PROTECTED] wrote:


On Mar 18, 2008, at 11:32 AM, cai qin wrote:

I have a cocoa app developed in Tiger . Is it possible that Using a
carbon
menuRef to get App 's mainMenu?


Why not just use public Carbon API?

MenuRef carbonMenuBar = AcquireRootMenu();

...

error = ReleaseMenu(carbonMenuBar); //clean up

and remember that Carbon menu items are 1-based unlike Cocoa menu  
items that are 0-based.


James

PS This seems like more of a Carbon question than a Cocoa question


___

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: NSTextField value binding (feeling like a newbie)

2008-03-18 Thread Quincey Morris


On Mar 18, 2008, at 14:33, Jeff LaMarche wrote:

I have bound the value binding of the NSTextField to an NSString  
called feedback,


Actually, you bind the text field to the property "feedback" of some  
object (File's Owner?). When you start using array properties, getting  
this terminology right will help you avoid a *lot* of grief.  
(Sometimes a property of an object is really an object, sometimes it's  
not.)



exposed as an Objective-C 2.0 property,declared like this:

@property (retain, nonatomic) NSMutableString *feedback;

In my implementation, use @synthesize to have it build the accessors  
and mutators. The binding is set to Continuously Updates Values, and  
is not editable, and has rich text turned off. If I run my program,  
and make changes to the string (feedback), those are not reflected  
in the text field even though I can tell through the debugger that  
the string is changing.


Make changes how? If you're doing 'someObject.feedback = newString',  
the text field should update. If you're doing (in a someObject method)  
'feedback = newString', the text field won't update unless you enclose  
it in willChangeValueForKey/didChangeValueForKey.



___

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: Carbon Menu in Cocoa app

2008-03-18 Thread James Hober


On Mar 18, 2008, at 11:32 AM, cai qin wrote:
I have a cocoa app developed in Tiger . Is it possible that Using a
carbon
menuRef to get App 's mainMenu?

Why not just use public Carbon API?

MenuRef carbonMenuBar = AcquireRootMenu();

...

error = ReleaseMenu(carbonMenuBar); //clean up

and remember that Carbon menu items are 1-based unlike Cocoa menu  
items that are 0-based.


James

PS This seems like more of a Carbon question than a Cocoa question

PSS sorry for the repost but I forgot to change the subject line earlier
___

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: Python/Ruby for Cocoa (was: Simple question)

2008-03-18 Thread Sherm Pendley
On Tue, Mar 18, 2008 at 1:02 PM, Scott Thompson <[EMAIL PROTECTED]> wrote:

> > I completely agree - and I wrote CamelBones, the Cocoa/Perl bridge.
> > It is,
> > and always has been, my opinion that language bridges are not an
> > adequate
> > substitute for learning Cocoa's native language, Objective-C. What
> > they are
> > *great* for is giving additional options to a skilled programmer who's
> > already familiar with both Cocoa and a scripting language. Someone
> > who tries
> > to use them as a means to avoid Objective-C is just setting
> > themselves up
> > for a lot of frustration.
>
> I also find that (if you're already familiar with Cocoa, and if you're
> willing to put up with the corner cases) languages bridges like the
> Ruby, Python, and Perl bridges are really great tools for prototyping
> things quickly, and learning new APIs.
>
...

>  YMMV.


My mileage doesn't vary a bit - I've used CamelBones for precisely that.
Completely eliminating the compile/link time really puts the R in RAD. :-)

sherm--
___

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: NSTextField value binding (feeling like a newbie)

2008-03-18 Thread Jeff LaMarche

Quincey -

Thanks much. You pointed me in the right direction - I was doing this:

[self.feedback appendString:string];

Thanks much for the help!

On Mar 18, 2008, at 6:10 PM, Quincey Morris wrote:



On Mar 18, 2008, at 14:33, Jeff LaMarche wrote:

I have bound the value binding of the NSTextField to an NSString  
called feedback,


Actually, you bind the text field to the property "feedback" of some  
object (File's Owner?). When you start using array properties,  
getting this terminology right will help you avoid a *lot* of grief.  
(Sometimes a property of an object is really an object, sometimes  
it's not.)



exposed as an Objective-C 2.0 property,declared like this:

@property (retain, nonatomic) NSMutableString *feedback;

In my implementation, use @synthesize to have it build the  
accessors and mutators. The binding is set to Continuously Updates  
Values, and is not editable, and has rich text turned off. If I run  
my program, and make changes to the string (feedback), those are  
not reflected in the text field even though I can tell through the  
debugger that the string is changing.


Make changes how? If you're doing 'someObject.feedback = newString',  
the text field should update. If you're doing (in a someObject  
method) 'feedback = newString', the text field won't update unless  
you enclose it in willChangeValueForKey/didChangeValueForKey.



___

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/jeff_lamarche%40mac.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 430

2008-03-18 Thread Daniel zeilMal
Thanks a lot , James.Actually , I don't want to use carbon . : ( Because I'm
totally a newbie to carbon.But I have no choice to do that .
I have a custom view which need to set into a menuItem . This is not
supported in Tiger.
And when I search the key word "Carbon Menu" in Google , there seems to be
not so much useful reference.
What I'm doing now , is that get the menuRef from cocoa menu nib , draw
Everything I need on that menuItem using carbon with MenuRef.
Then set it back to the menu .
I 'm wondering , is that ok if I am implementing the staff like this ? Since
the example  I found on the net about the carbon menu staff are usually
using the carbon menu nib file instead of cocoa menu nib file.

2008/3/18, James Hober <[EMAIL PROTECTED]>:
>
> On Mar 18, 2008, at 11:36 AM, [EMAIL PROTECTED] wrote:
>
> On Mar 18, 2008, at 11:32 AM, cai qin wrote:
>
> I have a cocoa app developed in Tiger . Is it possible that Using a
>
> carbon
>
> menuRef to get App 's mainMenu?
>
>
>
> Why not just use public Carbon API?
>
>
> MenuRef carbonMenuBar = AcquireRootMenu();
>
> ...
>
> error = ReleaseMenu(carbonMenuBar); //clean up
>
> and remember that Carbon menu items are 1-based unlike Cocoa menu items
> that are 0-based.
>
> James
>
> PS This seems like more of a Carbon question than a Cocoa question
>
>
>
>
___

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]


Leaks with savepanel

2008-03-18 Thread Mr. Gecko

I don't see where the leak is but there is a leak in this code.
mainWindow.h
#import 

@interface mainWindow : NSObject {
}
- (IBAction)button:(id)sender;
@end

mainWindow.m
#import "mainWindow.h"

@implementation mainWindow
- (IBAction)button:(id)sender {
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setTitle:NSLocalizedString(@"save", @"save panel")];
[panel setPrompt:NSLocalizedString(@"save", @"save panel")];
[panel setTreatsFilePackagesAsDirectories:NO];
[panel setRequiredFileType:@"rtf"];
[panel runModal];
}
@end
Here is the out put of Instruments
Self%   Self Size   Address Leaked Object
30.764B 0x1aeab0NSCFString
23  48B 0x1aeb10GeneralBlock-48
15.332B 0x1adc20NSCFString
15.332B 0x1adfb0NSCFArray
15.332B 0x1aeb40NSCFSting
Note that I am new to cocoa and instruments.
___

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: Equivalent to Carbon's TransitionWindow(); using genie when opening an NSWindow

2008-03-18 Thread John Stiles
TransitionWindow was never implemented well in OS X, as far as I know. 
Last I checked, it simply drew a few zoomrects using the look of the old 
OS 9 Finder. Not too impressive. It didn't do genie effects either.


You might look into NSWindow's - (void)setFrame:(NSRect)windowFrame 
display:(BOOL)displayViews animate:(BOOL)performAnimation






Sean McBride wrote:

Hi all,

I'd like to use the genie effect (or similar) when opening and closing
an NSWindow.  Carbon has an API named TransitionWindow() for this task,
but it's 32-bit only.  I've searched the archives and it seems there is
no Cocoa equivalent?  Is this still so, even in 10.5?  Could Core
Animation accomplish this?

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]


PopupButton

2008-03-18 Thread Jay Martin
I have a NSPopupButton, bound Selected Tag to my array controller with  
the appropriate property. When a new object is created, the default  
value is appropriately selected out of the 2 menu items associated  
with the button (the value of the property is 0 or 1 as are the tags  
for the menu items so that should map directly). However, if the  
property is set to 0, when I select the second menu item (tag 1), the  
set message gets sent to my object correctly, but another set message  
is sent immediately changing it back to 0. This doesn't happen if the  
object is initialized with a 1 first: I can select the first menu item  
(tag 0) and only one set is sent.


Odd, and it's probably something stupid I did, but for the life of me  
I can't track down where that second set method message is coming  
from. I thought perhaps I was using the Selected Tag binding  
incorrectly, and since the values are 0 based, I switched the binding  
to Selected Index. Same thing.


Thoughts?

jay
___

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: Equivalent to Carbon's TransitionWindow(); using genie when opening an NSWindow

2008-03-18 Thread Sean McBride
On 3/18/08 3:49 PM, John Stiles said:

>TransitionWindow was never implemented well in OS X, as far as I know.
>Last I checked, it simply drew a few zoomrects using the look of the old
>OS 9 Finder. Not too impressive. It didn't do genie effects either.

It must have been updated since you last looked, it definitely does
genie, take a look at this:


>You might look into NSWindow's - (void)setFrame:(NSRect)windowFrame
>display:(BOOL)displayViews animate:(BOOL)performAnimation

Thanks for this, it's certainly better than nothing.  But alas there is
nothing analogous to the 'WindowTransitionEffect' type. :(

--

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: Modifying glyph storage in NSLayoutManager SOLVED

2008-03-18 Thread Ross Carter
I found that I can call the NSLayoutManager methods for modifying  
glyph storage (replaceGlyphAtIndex:withGlyph:,  
insertGlyph:atGlyphIndex:characterIndex:, etc.) without errors if I  
place the code in an override of NSATSTypesetter - 
beginLineWithGlyphAtIndex: and inform the typesetter of any change in  
glyph count by calling setParagraphGlyphRange:separatorGlyphRange:.


Ross
___

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-dev Digest, Vol 5, Issue 432

2008-03-18 Thread Jay Martin

I have an NSTableView, bound to an NSArrayController, which is bound
to my custom object. So far so good. I can change attributes, add,
remove, all that good stuff. Now, my custom object can have one
property changed programmatically by an NSTimer. Of course, when the
change happens, the object is updated but not the NSTableView.


Chances are, you are not updating the property in a KVO-compliant way.
First, make sure you are doing things correctly, before kludging a
workaround.

See:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Conc
epts/Troubleshooting.html#//apple_ref/doc/uid/TP40002148- 
DontLinkElementID_6


And if you haven't read that whole document, you really really need  
to.


That was it - there were two places in my object where I was updating  
the property directly rather than calling the accessor. Sigh. I have  
read the bindings docs, but skipped the troubleshooting section (in  
fact, forgot it was there). A couple of people pointed this out. Mea  
culpa.





My second question is more general. I've basically just completed the
Cocoa Programming book by Hillegass. Is there a "next" logical book/
document to read, or is it just time to write lots of experimental
code and ask questions?


Write lots of experimental code, but read relevant docs *before* you  
ask
questions. Get AppKiDo .  
Not only
does it greatly simplify browsing the API, it also makes it easy to  
find

conceptual documentation.

Unfortunately, just about every Cocoa book on the market is sorely  
out of

date. Kochan's Objectice-C book, however, is a must-have must-read.


I have Kochan's book. Haven't read through the whole thing, just been  
using it as a reference. I'll go back through it. With a large  
collection of frameworks like Cocoa it's sometimes hard to know when  
to keep digging and when to ask, but after spinning on this for a  
couple of days I decided I should ask.


Just downloaded AppKiDo - looks nice.

Thanks,
jay
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Creating Custom Views in Interface Builder

2008-03-18 Thread Michael Fey
Sorry for the long delay in replaying, I wanted to make sure that what  
I was doing was going to work before I responded.  It turns out that  
Jacob was the closest to the solution that I wanted (though I thank  
everyone for their suggestions).  The one common theme in the  
suggestions involved overriding drawRect to accomplish laying out my  
component.  My intention was to use IB to layout my component and not  
have to worry about drawRect at all.


What I ended up with is a class called ProgressViewController that has  
an IBOutlet NSView* progressView; Within a separate nib I made the  
File's Owner be of type ProgressViewController and laid out my view.   
Then I simply connected my view to the File's Owner progressView  
outlet.  Lastly, in ProgressViewController'sinit method I just (as  
Jacob suggested) load the nib that contains my progress view:

- (id) init {
if (![super init])
return nil;

if (progressView == nil) {
if (![NSBundle loadNibNamed:@"ProgressView" owner:self])
NSLog(@"Failed to load ProgressView");
if (progressView == nil)
NSLog(@"progressView is still nil");
}
return self;
}


Now whenever I want to create a new view I just create a new  
ProgressViewController instance and use its getter method (- (NSView*)  
view;) to access my custom view and add it where I need it.


Thanks again!

Warm regards,
Michael


On Mar 14, 2008, at 2:43 PM, Jacob Lukas wrote:


Whoops meant to hit "Reply All"

On Mar 14, 2008, at 14:33, Michael Fey wrote:


Hello List!

I am trying to create a custom view class using Interface Builder  
that I can then instantiate within my code as many times as  
needed.  In this particular case I have a control that I've created  
that contains a progress bar, two text fields, two buttons, and an  
image view.  I then want to be able to create any number of these  
components within my source code and add them to another view  
dynamically.


I'm guessing that this question has been answered before, but my  
searches have been unsuccessful.  If someone could point me in the  
right direction, that would be a great help.  Thanks!


Regards,
Michael


What about creating this view in a separate nib, and loading it each  
time you wish to insert it somewhere? Perhaps using +[NSBundle  
loadNibNamed:owner:]


-Jacob

___

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/michaelfey%40fruitstandsoftware.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]


CGFloat in 10.4

2008-03-18 Thread bensyverson
Hey all,

I have a few CIColor's that I need to query for their color components, but I'm 
running into errors. Here's what I'm trying to do:

CGFloat *color;
color = [ciColor components];

Xcode complains, saying CGFloat is undeclared. I think I'm including all the 
appropriate headers... What gives? How can I get at the components of my 
CIColors?

Thanks!

- ben
___

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: Best way to execute a shell script from a cocoa application

2008-03-18 Thread Mark Dawson
 Look at the "TaskWrapper" sample code 
(http://developer.apple.com/samplecode/Moriarity/listing5.html).  This not only 
launches a system command, but can update your UI for the IO feedback?

Mark
>
>
>What is the best way to execute a shell script from a Cocoa application?  
>I need to be able to specify arguments, like what execv() provides.
>
>
>-Ryan

___

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]


User Defaults Controller - IB

2008-03-18 Thread Jeremy

Hello,

I am working on a 10.5 only application. Now I want to start adding  
and using preferences in my code. This is my first MAJOR application  
and the first one to use preferences. How can I use the new "User  
Defaults Controller" and assign variables to it? My book isn't very  
helpful because it is all using custom classes. Help please. :D


Jeremy Dentel
"For a long time it puzzled me how something so expensive, so leading  
edge, could be so useless, and then it occurred to me that a computer  
is a stupid machine with the ability to do incredibly smart things,  
while computer programmers are smart people with the ability to do  
incredibly stupid things. They are, in short, a perfect match." - Bill  
Bryson



___

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: Confused about CFRunLoop

2008-03-18 Thread Eric Schlegel


On Mar 18, 2008, at 6:41 AM, Brian Greenstone wrote:

Works perfectly!  It inserts my timer into the main run loop and  
processes everything as it should.  Now I just need to figure out  
the CF equivalent of thos NSApplication calls and then I can be Obj- 
C free ;)


If you want mouse and keyboard events to be handled, you _must_ use  
either Carbon or Cocoa; you can't use CF by itself.


-eric

___

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: Leaks with savepanel

2008-03-18 Thread Rob Napier
Is this your entire program? I've built it and don't see any leaks in
Instruments over short runs (actually I noticed a 1-time leak of an
NWNode object). Over a longer run, I wouldn't be shocked if you
encounter a small number of leaks in Cocoa itself. You're showing a
total of 200 leaked bytes here. That's going to happen. What you want
to watch out for are any leaks that steadily grow over time (even if
slowly). A one-time leak of 64 bytes here and there is not going to
cause you trouble and is normal for a Cocoa program (even if it
shouldn't be).

So the short answer is: don't worry about it (unsatisfying as that can be).

-Rob

On Tue, Mar 18, 2008 at 6:49 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote:
> I don't see where the leak is but there is a leak in this code.
>  mainWindow.h
>  #import 
>
>  @interface mainWindow : NSObject {
>  }
>  - (IBAction)button:(id)sender;
>  @end
>
>  mainWindow.m
>  #import "mainWindow.h"
>
>  @implementation mainWindow
>  - (IBAction)button:(id)sender {
> NSSavePanel *panel = [NSSavePanel savePanel];
> [panel setTitle:NSLocalizedString(@"save", @"save panel")];
> [panel setPrompt:NSLocalizedString(@"save", @"save panel")];
> [panel setTreatsFilePackagesAsDirectories:NO];
> [panel setRequiredFileType:@"rtf"];
> [panel runModal];
>  }
>  @end
>  Here is the out put of Instruments
>  Self%   Self Size   Address Leaked Object
>  30.764B 0x1aeab0NSCFString
>  23  48B 0x1aeb10GeneralBlock-48
>  15.332B 0x1adc20NSCFString
>  15.332B 0x1adfb0NSCFArray
>  15.332B 0x1aeb40NSCFSting
>  Note that I am new to cocoa and instruments.
>  ___



-- 
"Those who would give up essential liberty to purchase a little
temporary safety, deserve neither liberty nor safety." -- B. Franklin,
Printer
___

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: Modifying glyph storage in NSLayoutManager SOLVED

2008-03-18 Thread Douglas Davidson


On Mar 18, 2008, at 4:40 PM, Ross Carter wrote:

I found that I can call the NSLayoutManager methods for modifying  
glyph storage (replaceGlyphAtIndex:withGlyph:,  
insertGlyph:atGlyphIndex:characterIndex:, etc.) without errors if I  
place the code in an override of NSATSTypesetter - 
beginLineWithGlyphAtIndex: and inform the typesetter of any change  
in glyph count by calling setParagraphGlyphRange:separatorGlyphRange:.


If I understand it correctly, what you want to do is to modify the  
glyphs before the stock system typesetter has a chance to do any  
layout with them, and then let the stock system typesetter lay out the  
modified glyphs as it would have if those had been the original  
glyphs.  In that case, whatever typesetter method you override will  
need to be early in the process, before the typesetter has obtained  
the glyphs it is going to lay out.  I'm not sure whether - 
beginLineWithGlyphAtIndex: is the most appropriate place, but I will  
take a look at it and see what I can determine.


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: Best Way To Lookup From a Huge Table

2008-03-18 Thread Scott Ribe
> 1) If I can load all the data into memory, using say a hash table,
> then the initial load time will be somewhat significant but the
> lookups will be near instantaneous.

Really shouldn't be too hard to load the OP's 41,000 very short strings
nearly instantaneously.

> I had a situation where I had about 170,000 unique strings that
> mapped to 170,000 other strings.
> 
> My first implementation used Objective-C++ and a C++ STL map to do
> the lookup (solution 1).   Depending on the machine, it took on the
> order of 2 to 7 seconds of time during the app launch to load the C++
> map.

Seems to me that would be either long strings, or inefficient use of STL.
Did you try to profile it and optimize it? For instance, if you used map<
string, string > the insertions would likely take up all the time in copying
strings, and map< string *, string * > would be an easy optimization. Not
quite so easy (but still not hard) is reading the whole file in one block,
replacing field/record delimiters with null chars, and initializing const
char * pointers into the single block, so you never even copy the strings
once, then you use map< char *, char *, comparefunc >.

Of course OP's "index" strings can all be represented as integers, which
would make the comparisons for inserts faster than string comparisons. In
fact, for 5-digit zip codes it's perfectly possible to just allocate an
array large enough to hold entries for all possible integers in the range 0
through 99,999. No comparisons while reading and building the array, and
just O(1) time to "find" an entry. Of course for 9-digit zip codes, this
wouldn't be such a great idea ;-)

-- 
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: CGFloat in 10.4

2008-03-18 Thread David Duncan

On Mar 18, 2008, at 5:11 PM, bensyverson wrote:

I have a few CIColor's that I need to query for their color  
components, but I'm running into errors. Here's what I'm trying to do:


CGFloat *color;
color = [ciColor components];

Xcode complains, saying CGFloat is undeclared. I think I'm including  
all the appropriate headers... What gives? How can I get at the  
components of my CIColors?



The Mac OS X 10.4 SDK doesn't have a declaration for CGFloat. If you  
need to target that SDK, then you should use the float data type  
instead (which is what CGFloat is typedef'd to when compiling for 32- 
bit anyway). If you can use the 10.5 SDK, then you will find that  
CGFloat is defined, and you can use it compatibly when running on 10.4  
or 10.5.

--
David Duncan
Apple DTS Animation and Printing
[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: CGFloat in 10.4

2008-03-18 Thread bensyverson
Okay -- but how do I get CIColor components in 10.4?

Both float* and double* throw a warning ("assignment from incompatible pointer 
type," and "assignment discards qualifiers from pointer target type," 
respectively)

Thanks!

- ben


David Duncan wrote ..
> 
> The Mac OS X 10.4 SDK doesn't have a declaration for CGFloat. If you  
> need to target that SDK, then you should use the float data type  
> instead (which is what CGFloat is typedef'd to when compiling for 32- 
> bit anyway). If you can use the 10.5 SDK, then you will find that  
> CGFloat is defined, and you can use it compatibly when running on 10.4  
> or 10.5.
> --
> David Duncan
> Apple DTS Animation and Printing
> [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: CGFloat in 10.4

2008-03-18 Thread David Duncan

On Mar 18, 2008, at 5:58 PM, bensyverson wrote:

Okay -- but how do I get CIColor components in 10.4?

Both float* and double* throw a warning ("assignment from  
incompatible pointer type," and "assignment discards qualifiers from  
pointer target type," respectively)



If your targeting the 10.4 SDK:

const float * c = [myColor components];

If your targeting the 10.5 SDK:

const CGFLoat * c = [myColor components];

Deployment target doesn't matter here. Just which SDK your targeting.
--
David Duncan
Apple DTS Animation and Printing
[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]


Adding spaces to an NSString

2008-03-18 Thread J. Todd Slack
Hello All,

I am a little stumped today, not sure why, but how would I add a space after
every character in an NSString and produce a new NSString from it.

So I have something like: (ignore the quotes, I just did it for containment
sake..)

³/Users/slack/Music²

And I want it to be:

³/ U s e r s / s l a c k / M u s i c ³

Would anyone have any thoughts?

Thanks!
-Jason
___

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]


OT: Cocoa classes in Vancouver, Canada

2008-03-18 Thread Pavel Kapinos
The course "Programming with Cocoa frameworks on Mac OS X and for  
iPhone" starts on March 25 at 6:30pm.


The course will cover:

• Xcode and Interface Builder
• Objective-C 2.0
• Controls and Views
• Cocoa Bindings
• Document-based apps
• Core Data
• Core Graphics and Core Image
• Core Animation
• Scripting Bridge

It will consist of 6 (plus one spare) classes run for 2 hours (up to  
3hrs if necessary) from 6:30pm twice a week.


The course will take place at The Scottish Cultural Centre at 8886  
Hudson Street in Vancouver.


The course total cost will be $295 or, alternatively, you may take  
separate classes which will cost $60 each.


___

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 spaces to an NSString

2008-03-18 Thread John Stiles

Have you looked at NSMutableString? The APIs are pretty basic here.
I'd recommend working from right-to-left; you'll find it probably makes 
the logic simpler.


J. Todd Slack wrote:

Hello All,

I am a little stumped today, not sure why, but how would I add a space after
every character in an NSString and produce a new NSString from it.

So I have something like: (ignore the quotes, I just did it for containment
sake..)

³/Users/slack/Music²

And I want it to be:

³/ U s e r s / s l a c k / M u s i c ³

Would anyone have any thoughts?

Thanks!
-Jason
___

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/jstiles%40blizzard.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: Adding spaces to an NSString

2008-03-18 Thread J. Todd Slack
Hi John,

Yes, I have, Are you thinking insertString:atIndex:?

So at a basic level, can I get the string length, for loop through each
character and after each use insertString to add a space?

I am just looking for the most efficient way, sometimes I suffer from doing
things multiple ways, trying to find the most succinct and efficient versus
just making it work and optimizing later..

Jason


On 3/18/08 5:46 PM, "John Stiles" <[EMAIL PROTECTED]> wrote:

> Have you looked at NSMutableString? The APIs are pretty basic here.
> I'd recommend working from right-to-left; you'll find it probably makes
> the logic simpler.
> 
> J. Todd Slack wrote:
>> Hello All,
>> 
>> I am a little stumped today, not sure why, but how would I add a space after
>> every character in an NSString and produce a new NSString from it.
>> 
>> So I have something like: (ignore the quotes, I just did it for containment
>> sake..)
>> 
>> ³/Users/slack/Music²
>> 
>> And I want it to be:
>> 
>> ³/ U s e r s / s l a c k / M u s i c ³
>> 
>> Would anyone have any thoughts?
>> 
>> Thanks!
>> -Jason
>> ___
>> 
>> 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/jstiles%40blizzard.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: OT: Cocoa classes in Vancouver, Canada

2008-03-18 Thread I. Savant
The course "Programming with Cocoa frameworks on Mac OS X and for  
iPhone" starts on March 25 at 6:30pm.


  I'm curious about your iPhone content. Do you cover the iPhone SDK  
or are you merely referring to the fact that learning XCode / IB /  
Objective-C 2.0 / Cocoa in general prepares you for iPhone development?


  If the former, how did you convince Apple to allow it? Note, I'm  
*not* starting a flame war, but I'm sure others are wondering the  
answer to that question.


--
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: CGFloat in 10.4

2008-03-18 Thread bensyverson
Awesome... thank you SO much!

- bun

David Duncan wrote ..
 
> If your targeting the 10.4 SDK:
> 
> const float * c = [myColor components];
> 
> If your targeting the 10.5 SDK:
> 
> const CGFLoat * c = [myColor components];
> 
> Deployment target doesn't matter here. Just which SDK your targeting.
> --
> David Duncan
> Apple DTS Animation and Printing
> [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: Getting notifications when any file in a folder change

2008-03-18 Thread Scott Ribe
Best solution is FSEvents, which others pointed you to, *if* you can use
10.5. Otherwise, look at kqueue.

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


DO problems

2008-03-18 Thread Alexander Cohen
Hi, i have a server and client communication through DO. Connections  
are all set up then the client send a message to the server with  
itself as the first argument. The server should then just reply right  
away to the client using the first argument as the proxy. Problem is,  
im getting the error below when trying to send the response form the  
server back to the client. Any ideas what might be happening?


 server received hello
 *** NSDistantObject initWithCoder: 0x2 not given away for conn  
0x171a62f0

exceptionHandler:shouldHandleException:
-[NSConcretePortCoder decodeInvocation]: no local target


thanks

AC
___

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: OT: Cocoa classes in Vancouver, Canada

2008-03-18 Thread Pavel Kapinos

Hi,

The answer is in the requirement to have ADC online membership and to  
download iPhone SDK, which will automatically promote you to iPhone  
developer too.


Regards,
Pavel Kapinos.

On 18-Mar-08, at 5:53 PM, I. Savant wrote:

The course "Programming with Cocoa frameworks on Mac OS X and for  
iPhone" starts on March 25 at 6:30pm.


 I'm curious about your iPhone content. Do you cover the iPhone SDK  
or are you merely referring to the fact that learning XCode / IB /  
Objective-C 2.0 / Cocoa in general prepares you for iPhone  
development?


 If the former, how did you convince Apple to allow it? Note, I'm  
*not* starting a flame war, but I'm sure others are wondering the  
answer to that question.


--
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 spaces to an NSString

2008-03-18 Thread John Stiles
Unless you are doing this hundreds of thousands of times in a row, I 
doubt you will need to worry about efficiency.


By the way, now that I'm thinking about this a little more,  you might 
also consider making an NSAttributedString and setting the kern value 
for the string to be a large value (e.g. five, seven, it depends on the 
font size) instead of putting in spaces at all. If the goal is just the 
visual effect of very wide character spacing, this might actually be 
closer to what you really have in mind.



J. Todd Slack wrote:

Hi John,

Yes, I have, Are you thinking insertString:atIndex:?

So at a basic level, can I get the string length, for loop through each
character and after each use insertString to add a space?

I am just looking for the most efficient way, sometimes I suffer from doing
things multiple ways, trying to find the most succinct and efficient versus
just making it work and optimizing later..

Jason


On 3/18/08 5:46 PM, "John Stiles" <[EMAIL PROTECTED]> wrote:

  

Have you looked at NSMutableString? The APIs are pretty basic here.
I'd recommend working from right-to-left; you'll find it probably makes
the logic simpler.

J. Todd Slack wrote:


Hello All,

I am a little stumped today, not sure why, but how would I add a space after
every character in an NSString and produce a new NSString from it.

So I have something like: (ignore the quotes, I just did it for containment
sake..)

³/Users/slack/Music²

And I want it to be:

³/ U s e r s / s l a c k / M u s i c ³

Would anyone have any thoughts?

Thanks!
-Jason
___

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/jstiles%40blizzard.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: OT: Cocoa classes in Vancouver, Canada

2008-03-18 Thread I. Savant
The answer is in the requirement to have ADC online membership and  
to download iPhone SDK, which will automatically promote you to  
iPhone developer too.


  That's not necessarily the case.

  Again, I'm not trying to be difficult, but you haven't addressed  
Apple's "permission". The typical interpretation of their SDK non- 
disclosure agreements is that you're not even allowed to talk to  
others under the same non-disclosure agreement unless they're within  
your organization (ie, a company sharing an ADC membership).*


  By conducting or attending the class and discussing the iPhone SDK  
without special permission from Apple, you'd potentially be breaking a  
legally-binding contract which carries real consequences (something  
Apple has demonstrated they'll pursue).


  I think this has to be publicly addressed very clearly so that  
conscientious professionals know they're not walking into legal hot  
water, or at the very least losing their ADC memberships. It's a fair  
question ... :-}


--
I.S.

* I admit I'm quoting information I've seen posted all over the place,  
not something I know for absolute certainty; I'm not a lawyer.


___

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: OT: Cocoa classes in Vancouver, Canada

2008-03-18 Thread Pavel Kapinos

Thank you very much for bringing this issue to me!

I will definitely have to have a second look at the SDK licence.
In the "worst" case scenario, yes - learning to program Cocoa on Mac  
OS X would be a good start for iPhone.


Regards,
Pavel Kapinos.


On 18-Mar-08, at 7:08 PM, I. Savant wrote:

The answer is in the requirement to have ADC online membership and  
to download iPhone SDK, which will automatically promote you to  
iPhone developer too.


 That's not necessarily the case.

 Again, I'm not trying to be difficult, but you haven't addressed  
Apple's "permission". The typical interpretation of their SDK non- 
disclosure agreements is that you're not even allowed to talk to  
others under the same non-disclosure agreement unless they're within  
your organization (ie, a company sharing an ADC membership).*


 By conducting or attending the class and discussing the iPhone SDK  
without special permission from Apple, you'd potentially be breaking  
a legally-binding contract which carries real consequences  
(something Apple has demonstrated they'll pursue).


 I think this has to be publicly addressed very clearly so that  
conscientious professionals know they're not walking into legal hot  
water, or at the very least losing their ADC memberships. It's a  
fair question ... :-}


--
I.S.

* I admit I'm quoting information I've seen posted all over the  
place, not something I know for absolute certainty; I'm not a lawyer.




___

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: Confused about CFRunLoop

2008-03-18 Thread Brian Greenstone
Actually, no.  Not for games.  For games we use the HID Manager for  
input which allows us to use more than just the keyboard and mouse.   
It allows for gamepads, steering wheels, tablets, etc, etc.  The code  
doesn't even need to know where the input is coming from.  The code  
can't tell the difference between a mouse click, a key press, or a  
joystick button press.  It all gets abstracted out :)


-B


On Mar 18, 2008, at 7:12 PM, Eric Schlegel wrote:


On Mar 18, 2008, at 6:41 AM, Brian Greenstone wrote:

Works perfectly!  It inserts my timer into the main run loop and  
processes everything as it should.  Now I just need to figure out  
the CF equivalent of thos NSApplication calls and then I can be Obj- 
C free ;)


If you want mouse and keyboard events to be handled, you _must_ use  
either Carbon or Cocoa; you can't use CF by itself.


-eric



__
Brian Greenstone
President & CEO[EMAIL PROTECTED]
Pangea Software, Inc.  http://www.pangeasoft.net
12405 John Simpson Ct. voice/fax:  (512)266-9991
Austin, TX 78732
__




___

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 spaces to an NSString

2008-03-18 Thread Matt Long
You could get a char array from your initial NSString and then use  
stringByAppendingFormat:@"%c " on an NSString in a loop. Notice the  
space after the %c.


-Matt




J. Todd Slack wrote:

Hi John,

Yes, I have, Are you thinking insertString:atIndex:?

So at a basic level, can I get the string length, for loop through  
each

character and after each use insertString to add a space?

I am just looking for the most efficient way, sometimes I suffer  
from doing
things multiple ways, trying to find the most succinct and  
efficient versus

just making it work and optimizing later..

Jason


On 3/18/08 5:46 PM, "John Stiles" <[EMAIL PROTECTED]> wrote:



Have you looked at NSMutableString? The APIs are pretty basic here.
I'd recommend working from right-to-left; you'll find it probably  
makes

the logic simpler.

J. Todd Slack wrote:


Hello All,

I am a little stumped today, not sure why, but how would I add a  
space after

every character in an NSString and produce a new NSString from it.

So I have something like: (ignore the quotes, I just did it for  
containment

sake..)

³/Users/slack/Music²

And I want it to be:

³/ U s e r s / s l a c k / M u s i c ³

Would anyone have any thoughts?

Thanks!
-Jason


___

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: [Solved]NSAppleScript returning wrong error info

2008-03-18 Thread Vinay Prabhu

Initializing the errorInfo to nil did the trick.

When no error occurs, NSAppleScript will not touch the error dictionary.
So I was trying to access the dictionary pointing to junk memory.

Thanks for the help.
-Vinay

On Mar 18, 2008, at 7:44 PM, Nir Soffer wrote:



On Mar 18, 2008, at 11:47, Vinay Prabhu wrote:

I am trying to create a NSAppleScript object using a applescript  
file.

The code is as follows,

NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc]  
initWithContentsOfURL: scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a  
dictionary containing error messages.


No, the docs say:

	"On return, if an error occurs, a pointer to an error information  
dictionary."


If an no error occurs, the value is undefined. Check for errors by  
testing the return value, not the error dictionary.



Best Regards,

Nir Soffer





___

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]


  1   2   >