Working with svg

2008-05-04 Thread lorenzo

Hi,
I'm using web-kit for loading an svg map in my application, I want to  
store the map data in memory for redisplay with some mods (like  
changing the colors at given population data etc.).
I'm thinking to trasform svg data in xml plain data and managing an  
nsxmldocument for storing changes but I don't know how render the web- 
view with xml
Perhaps I shouldn't convert data to xml but working directly with svg  
format, how can I store the whole file in memory for editing?

I'm a rookie programmer I'm not sure my question has sense :)
Bye

 
 
___


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

Please do not post admin requests or moderator comments to the list.
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: List Running apps and windows

2008-05-04 Thread Jere Gmail
PD: I have tried the UIElementInspector code and it also says that the
App is not trusted, but it succeeds in geting other apps info. Instead
when I run
AXUIElementRef ref=AXUIElementCreateApplication(pid);
AXUIElementCopyAttributeNames(ref, (CFArrayRef *)theNames);
theNames is empty.
Why is this happening?


On Sun, May 4, 2008 at 11:28 AM, Jere Gmail [EMAIL PROTECTED] wrote:
 I have implemented this code:
 if(!AXAPIEnabled ())
 {
 NSLog(@API not enabled);
 return;
 }
 if(!AXIsProcessTrusted ())
 {
 NSLog(@PROCESS not trusted);
 }
  And it enters the second if, so my app is not trusted. I have tried using
  AXMakeProcessTrusted((CFStringRef)path);
  But it wont do anything, no matter if I relaunch or not.
  Guesses?



  On Sun, May 4, 2008 at 1:17 AM, Jean-Daniel Dupas
  [EMAIL PROTECTED] wrote:
  
  
   Le 4 mai 08 à 01:09, Steve Christensen a écrit :
  
  
   On May 3, 2008, at 3:52 PM, Jere Gmail wrote:
  
   I want to list all the running apps and their windows.
   Running apps is easy with [ws launchedApplications] but I cant find a
   way for listing their windows.
   I have tried NSWindowList(win_count,arr_win)  but then
   [[NSApplication sharedApplication] windowWithWindowNumber:arr_win[i]]
   in a bucle will give me no info on windows from other apps.
   Can anyone help? Thanks
  
   Each application has its own private address space, so including another
   app's windows in your app's window list doesn't make sense. The only way to
   find out about other app's windows is to have the user enable accessibility
   in System Preferences. This has already been discussed in detail here and 
 on
   other lists. You might try doing a search to see what's already been said.
  
  
   In fact, this is no longer true on Leopard. Window are always in there own
   space, but you can list all windows and even create image for each window 
 on
   screen.
  
   http://developer.apple.com/samplecode/SonOfGrab/
  
   And it make sense to inlude other app window in an a list, else tools like
   the GrabFS would not exists.
  
  





 --
  http://zon7blog.wordpress.com/
  And again we fall.




-- 
http://zon7blog.wordpress.com/
And again we fall.
___

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

Please do not post admin requests or moderator comments to the list.
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: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Christopher Kempke
Yes, it appears that I want an NSPanel instead of an NSWindow for my  
modal dialogs, but I think the modality is a red herring here: I just  
tried adding the same checkbox and button controls to a floating  
window and a document window:  they don't visibly update based on  
mouse clicks there, either (although they still send actions to their  
targets)


There's an [NSWindow setAutodisplay:YES] method which again looks like  
it's just what I need, except that it's already turned on (I just did  
it explicitly to be sure, no change).   I've tried setting the  
window's backing store to BackingStoreNonretained, which also doesn't  
have any obvious effect.


I'm correct in my assumption that this is supposed to work, yes?  If I  
create a window, nest a checkbox in it's main view, and start the main  
event loop, clicks in the checkbox should keep toggling the value of  
the checkbox and updating the screen, right?  I don't have to do  
anything special to turn this on, or implement the drawing myself?


--Christopher Kempke

On May 3, 2008, at 8:47 PM, Kyle Sluder wrote:


On Sat, May 3, 2008 at 7:08 PM, Christopher Kempke
[EMAIL PROTECTED] wrote:
Thanks for the tip, but no go.  It actually makes the behavior  
worse: now
the modal dialog is still drawn, but never becomes active (the  
title bar

never gets dark, and the previously visible (document) window never
deactivates, although the dialog is drawn on top), and the default  
button

doesn't even turn blue.


Take a look at -[NSPanel setWorksWhenModal:].  You should be using an
NSPanel, not an NSWindow, and must send it this message before doing
-[NSApplication runModalForWindow:].  Read this document, entitled
How Modal Windows Work, for more information.
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html#/ 
/apple_ref/doc/uid/2223


--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: List Running apps and windows

2008-05-04 Thread Jere Gmail
I have implemented this code:
if(!AXAPIEnabled ())
{
NSLog(@API not enabled);
return;
}
if(!AXIsProcessTrusted ())
{
NSLog(@PROCESS not trusted);
}
And it enters the second if, so my app is not trusted. I have tried using
AXMakeProcessTrusted((CFStringRef)path);
But it wont do anything, no matter if I relaunch or not.
Guesses?

On Sun, May 4, 2008 at 1:17 AM, Jean-Daniel Dupas
[EMAIL PROTECTED] wrote:


 Le 4 mai 08 à 01:09, Steve Christensen a écrit :


 On May 3, 2008, at 3:52 PM, Jere Gmail wrote:

 I want to list all the running apps and their windows.
 Running apps is easy with [ws launchedApplications] but I cant find a
 way for listing their windows.
 I have tried NSWindowList(win_count,arr_win)  but then
 [[NSApplication sharedApplication] windowWithWindowNumber:arr_win[i]]
 in a bucle will give me no info on windows from other apps.
 Can anyone help? Thanks

 Each application has its own private address space, so including another
 app's windows in your app's window list doesn't make sense. The only way to
 find out about other app's windows is to have the user enable accessibility
 in System Preferences. This has already been discussed in detail here and on
 other lists. You might try doing a search to see what's already been said.


 In fact, this is no longer true on Leopard. Window are always in there own
 space, but you can list all windows and even create image for each window on
 screen.

 http://developer.apple.com/samplecode/SonOfGrab/

 And it make sense to inlude other app window in an a list, else tools like
 the GrabFS would not exists.





-- 
http://zon7blog.wordpress.com/
And again we fall.
___

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

Please do not post admin requests or moderator comments to the list.
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: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Mike Abdullah
Are you sure you're running the event loop correctly? It sounds to me  
that Cocoa is not getting a chance to do its usual behaviour of  
calling -displayIfNeeded at the end of the event loop. What if you  
manually call that method yourself?


Mike.

On 4 May 2008, at 10:19, Christopher Kempke wrote:

Yes, it appears that I want an NSPanel instead of an NSWindow for my  
modal dialogs, but I think the modality is a red herring here: I  
just tried adding the same checkbox and button controls to a  
floating window and a document window:  they don't visibly update  
based on mouse clicks there, either (although they still send  
actions to their targets)


There's an [NSWindow setAutodisplay:YES] method which again looks  
like it's just what I need, except that it's already turned on (I  
just did it explicitly to be sure, no change).   I've tried setting  
the window's backing store to BackingStoreNonretained, which also  
doesn't have any obvious effect.


I'm correct in my assumption that this is supposed to work, yes?  If  
I create a window, nest a checkbox in it's main view, and start the  
main event loop, clicks in the checkbox should keep toggling the  
value of the checkbox and updating the screen, right?  I don't have  
to do anything special to turn this on, or implement the drawing  
myself?


--Christopher Kempke

On May 3, 2008, at 8:47 PM, Kyle Sluder wrote:


On Sat, May 3, 2008 at 7:08 PM, Christopher Kempke
[EMAIL PROTECTED] wrote:
Thanks for the tip, but no go.  It actually makes the behavior  
worse: now
the modal dialog is still drawn, but never becomes active (the  
title bar

never gets dark, and the previously visible (document) window never
deactivates, although the dialog is drawn on top), and the default  
button

doesn't even turn blue.


Take a look at -[NSPanel setWorksWhenModal:].  You should be using an
NSPanel, not an NSWindow, and must send it this message before doing
-[NSApplication runModalForWindow:].  Read this document, entitled
How Modal Windows Work, for more information.
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html#/ 
/apple_ref/doc/uid/2223


--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/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: List Running apps and windows

2008-05-04 Thread Jean-Daniel Dupas

You need 10.4 support ?

The SonOfGrab  sample is able to list all windows without AXAPI !



Le 4 mai 08 à 11:33, Jere Gmail a écrit :


PD: I have tried the UIElementInspector code and it also says that the
App is not trusted, but it succeeds in geting other apps info. Instead
when I run
AXUIElementRef ref=AXUIElementCreateApplication(pid);
AXUIElementCopyAttributeNames(ref, (CFArrayRef *)theNames);
theNames is empty.
Why is this happening?


On Sun, May 4, 2008 at 11:28 AM, Jere Gmail [EMAIL PROTECTED]  
wrote:

I have implemented this code:
   if(!AXAPIEnabled ())
   {
   NSLog(@API not enabled);
   return;
   }
   if(!AXIsProcessTrusted ())
   {
   NSLog(@PROCESS not trusted);
   }
And it enters the second if, so my app is not trusted. I have tried  
using

AXMakeProcessTrusted((CFStringRef)path);
But it wont do anything, no matter if I relaunch or not.
Guesses?



On Sun, May 4, 2008 at 1:17 AM, Jean-Daniel Dupas
[EMAIL PROTECTED] wrote:



Le 4 mai 08 à 01:09, Steve Christensen a écrit :


On May 3, 2008, at 3:52 PM, Jere Gmail wrote:

I want to list all the running apps and their windows.
Running apps is easy with [ws launchedApplications] but I cant  
find a

way for listing their windows.
I have tried NSWindowList(win_count,arr_win)  but then
[[NSApplication sharedApplication]  
windowWithWindowNumber:arr_win[i]]

in a bucle will give me no info on windows from other apps.
Can anyone help? Thanks

Each application has its own private address space, so including  
another
app's windows in your app's window list doesn't make sense. The  
only way to
find out about other app's windows is to have the user enable  
accessibility
in System Preferences. This has already been discussed in detail  
here and on
other lists. You might try doing a search to see what's already  
been said.



In fact, this is no longer true on Leopard. Window are always in  
there own
space, but you can list all windows and even create image for each  
window on

screen.

http://developer.apple.com/samplecode/SonOfGrab/

And it make sense to inlude other app window in an a list, else  
tools like

the GrabFS would not exists.








--
http://zon7blog.wordpress.com/
And again we fall.





--
http://zon7blog.wordpress.com/
And again we fall.



___

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

Please do not post admin requests or moderator comments to the list.
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: Proxy Window of another

2008-05-04 Thread Daniel
On Sun, May 4, 2008 at 12:30 AM, Jean-Daniel Dupas
[EMAIL PROTECTED] wrote:

  Override the -[NSWindow  sendEvent:] method and pass the event parameter to
 the target window sendEvent: method.


Thank you very much!


On Sun, May 4, 2008 at 12:34 AM, Jean-Daniel Dupas
[EMAIL PROTECTED] wrote:

 Sorry, I miss the first part. I don't think you can copy the content of a
 Window into another one.  What are you trying to do ?



On Sun, May 4, 2008 at 1:31 AM, Uli Kusterer
[EMAIL PROTECTED] wrote:
 Am 03.05.2008 um 23:45 schrieb Daniel Rampanelli:

   What are you trying to do?

   Usually, content translates to model, display generally translates
 to view, so according to the Model-View-Controller paradigm, you could
 create another instance of your controller that has its own copy of the
 views, but points at the same model, instead of forwarding events.

   That's one of the advantages of Cocoa's MVC design: If you separate the
 view and the model code, you can easily have several windows showing the
 same data. It's also more flexible than just duplicating a window and
 forwarding its contents, because it can be scrolled to a different location,
 can have a different toolbar collapse state, can be a different size etc.

  Cheers,
  -- Uli Kusterer
  The Witnesses of TeachText are everywhere...
  http://www.zathras.de


Basically I wanted to display a window which modifies graphically
another window. Under graphically I mean for example zooming of some
parts of the window or change colors and so on and also to preserve
the funcionality of the original window.
For example, if the Proxy Window displays a part of the original
Window (on which there is a button) on the Proxy Window we still can
use the zoomed button as it were the original one.

I hope I've mad myself clear ;-)

Daniel
___

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

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

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

This email sent to [EMAIL PROTECTED]


CALayer retain count problem when changing geometry

2008-05-04 Thread Pete Callaway
Hi,

I'm having a problem with the retain count of CALayers. It seems that
when changing geometry related properties, such as bounds or position,
the retain count is decremented. Below is a simple example that
exhibits the problem. In the example, if changeName is called, the
retain count of the layer isn't touched, but if changePosition is
called, the retain count is decremented so far that the overridden
dealloc method is called.

I can hide the problem by turning on garbage collection, but that's
cheating. Does anyone have any ideas as to what might be causing this?

Cheers,
Pete



@interface TestController : NSObject {
IBOutlet NSView *view;
TestLayer *_testLayer;
}

- (IBAction)changePosition:(id)sender;
- (IBAction)changeName:(id)sender;

@end



@implementation TestController

- (void)awakeFromNib
{
view.wantsLayer = YES;

_testLayer = [[TestLayer alloc] init];
_testLayer.name = @layer1;
[view.layer addSublayer:_testLayer];
}

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

- (IBAction)changePosition:(id)sender
{
NSPoint newPosition = _testLayer.position;
newPosition.x += 10;
_testLayer.position = newPosition;
}

- (IBAction)changeName:(id)sender
{
_testLayer.name = [_testLayer.name stringByAppendingString:@1];
}

@end



@interface TestLayer : CATextLayer {
}

@end



@implementation TestLayer

- (void)dealloc
{
NSLog(@TestLayer dealloc called);
[super dealloc];
}

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


iPhone SDK Question

2008-05-04 Thread Development
Well I'm not willing to switch to ATT for my cell, but I would like  
to develop for iPod and iPhone. I've been messing with the SDK and it  
seems fairly straight forward, however I am in love with my PPC  
and unwilling to give it up until Apple stops making OSes for it.  
Therefore I am using the SDK on my G5. It took a little tweeking, and  
googling to get the thing to compile but it all runs now. So my  
question is: If a compiled iPhone/iPod app runs on the simulator on my  
PPC will it actually run on the iPhone/iPod? I checked the apps and  
they say they are PPC even though the arch variable says its the right  
one. So I'm a bit confuzzled about this as it seems it should at the  
very least say universal according to the apps in the sdk.
P.S. Before asking this I looked for a iPhone dev list but there  
doesn't seem to be one or I didn'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: Proxy Window of another

2008-05-04 Thread Uli Kusterer

Am 04.05.2008 um 13:25 schrieb Daniel:

Basically I wanted to display a window which modifies graphically
another window. Under graphically I mean for example zooming of some
parts of the window or change colors and so on and also to preserve
the funcionality of the original window.


 So, basically you're trying to write a GUI editor, like Interface  
Builder? In that case, I think what you'd really want to do is build  
your view hierarchy slightly differently. It's been a while since I  
tried writing a GUI editor in Cocoa, and I did half a dozen in Classic/ 
Carbon, so I may be mixing up things here, but there are several  
approaches, all of which might work depending on what you want to do:


1) Use NSImage and NSBitmapImageRep's -initWithFocusedViewRect: method  
to create a snapshot of each view. Then you can create a custom view  
for each view that draws such a snapshot, accepts clicks, draws a  
selected look, etc.


2) Wrap each view in a container view. I think there was some way to  
make a view get clicks before its subviews get them. That way, you can  
intercept the clicks and do something special with them when needed,  
and also draw a highlight to indicate a selection.


Views are objects just like any other, so you can easily create a new  
one using alloc/initWithFrame:, then use addSubview to insert it in  
another view etc., and thus dynamically change the view hierarchy or  
even build a completely new one, without a NIB. Same applies to  
NSWindows.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

Please do not post admin requests or moderator comments to the list.
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]


awakeFromUndo?

2008-05-04 Thread Hamish Allan
I have a Cocoa app presenting a classic master-detail view of managed
objects, each of which represents a machine on a network and has a
string property address. I also have a class which monitors the
status of a networked machine whose initialiser takes such an address.
Therefore in awakeFromInsert and awakeFromFetch in my NSManagedObject
subclass I add self as an observer for self's address property, and in
the observeValueForKeyPath:... method I set up a new or replacement
monitoring object. Conversely, in willTurnIntoFault I remove the
monitoring object and the observer.

This works fine as I add and remove items using my array controller,
but if I remove an item and then undo that removal, the object is
reinserted into the context, but without awaking either from insert or
from fetch. I am wondering where I should put my hook for adding the
address observer, or whether I should be doing something different
altogether.

Thanks,
Hamish

P.S. I have written the following workaround, but it relies on a private method:

//  NSManagedObjectContextWorkaround.h

#import Cocoa/Cocoa.h

@interface NSManagedObjectContextWorkaround : NSManagedObjectContext
{

}

@end

@interface NSManagedObjectContext (PrivateNSManagedObjectContextWorkaround)

- (void)_undoDeletions:(id)object;

@end

//  NSManagedObjectContextWorkaround.m

#import NSManagedObjectContextWorkaround.h

@implementation NSManagedObjectContextWorkaround

- (void)_undoDeletions:(id)deletions
{
[super _undoDeletions:deletions];
@try
{
for (NSManagedObject *deletion in [deletions objectAtIndex:0])
[deletion awakeFromFetch]; // treating this as a fetch 
works for my purposes
}
@catch (NSException *exception)
{

}
}

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


Mail.app account preferences

2008-05-04 Thread Torsten Curdt

Hey guys,

I am looking for an example on how to implement something like the  
Mail accounts preferences.


I assume this should be possible with Core Data  ...but there are  
different types of accounts in the list of accounts. So the UI needs  
to change depending on what type of account has been selected. Any  
pointers on how to accomplish this?


cheers
--
Torsten

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: Mail.app account preferences

2008-05-04 Thread I. Savant
I assume this should be possible with Core Data  ...but there are  
different types of accounts in the list of accounts. So the UI needs  
to change depending on what type of account has been selected. Any  
pointers on how to accomplish this?


  This could be solved with Cocoa Bindings and one or more value  
transformers. Whatever the selected account's type is, this or that is  
visible, this or that tab (in a tabless tab view) is selected, etc.,  
depending on what exactly you're trying to do.


  More specific questions will yield more specific answers.

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


Using ObjC to access SOAP/WSDL server

2008-05-04 Thread fclee
Greetings Jeff  fellow Cocoa Developers:
 I need to access a SOAP/WSDL server.
 I'm trying to convert some Java code to its ObjC equivalent.   

Client (Mac)  --- SOAP  WSDL server.

Here's where I'm coming from:
1) I need to make a POST connection.
2) Content type is SOAP (text/xml).
3) I need to set a request property as shown below.

This is a synchronous connection, waiting for a response  close the connection.
..
private String SOAP_SERVER_URL = http://myconnect.eccron.com/soap/sync;;  
private final String SOAP_ACTION = http://myconn.eccron.com/2007/02;; 
..
xmlstream = (StreamConnection)Connector.open(SOAP_SERVER_URL + 
;deviceside=false,Connector.READ_WRITE,true);

connection = (HttpConnection)xmlstream;
connection.setRequestMethod(HttpConnection.POST);
connection.setRequestProperty(Content-Type, text/xml; charset=utf-8);
connection.setRequestProperty(SOAPAction,SOAP_ACTION);
..

4) Send the SOAP envelope:
 ...
 //  Send Request 
---
  OutputStream out = connection.openOutputStream();
  out.write(xmlreq.getBytes()); // 'xmlreq' is a concatenated XML string that 
is the SOAP envelope  message.
  out.flush();
  out.close();

5) And I need to interpret the response:
 //  Get Response 
---
 // Get the connection status
  status = connection.getResponseCode();
  ...

=

I don't need to know any particular socket.  I'm told that all I need to do is 
to access a given URI stated above.
I've tested the URI with a browser; and I do get a contact, albeit access was 
denied since I didn't supply a SOAP message with authorization.

I've read some blogs and follow some of the CocoaDev discussions.
I've learned that I should use NSFileHandle.

I believe you're onto something; and I need your (and/or other CococDev 
members) help.

What I've gotten so far is:
   NSFileHandle *myFileHandle ;

  // ... generate a file descriptor of the target URL...

  //  [myFileHandle initWithFileDescriptor:fileDescriptor closeOnDealloc:YES];


-(void)process:(id)notification { 
NSFileHandle *fh = [notification object]; 
NSMutableData *data = [fh availableData]; 
NSString *dataString = [[NSString alloc] initWithData:data 
encoding:NSUTF8StringEncoding]; 
/* Process the data however you need to here */ 
[dataString release]; 
} 

...

I'm hitting a brick wall here.
I know there's a way...

Can you (and/or fellow CocoaDev members) please supply some guidance here 
and/or point to some simple docs?

Thanks; I would truly appreciate it!

Regards,
Ric


On Apr 9, 2008, at 2:53 PM, Jeff LaMarche wrote:

I'm periodically getting this message

*** -[NSConcreteFileHandle availableData]: Invalid argument

printed to the console of an application I'm working on. I'm confused about 
what it means because availableData doesn't take an argument.

Here's what I'm doing: I'm using NSFileHandle to handle socket communications 
with a remote server. I create an old-fashioned network socket, allocate an 
NSFileHandle, feed it the socket using initWithFileDescriptor:, and then use 
readInBackgroundAndNotify after specifying to receive 
NSFileHandleReadCompletionNotifications.  The odd thing is that despite this 
error getting printed in the console, my code is working as expected - I am 
getting data from the file handle and the data appears to be 100% correct.

My call back method looks like this:

- (void)updateStatusCallback:(id) notification
{
NSFileHandle *fh = [notification object];
NSData *data = [fh availableData];   //  - This call generates the 
message in the console sometimes... but it works
NSString *theString = [[NSString alloc] initWithData:data 
encoding:NSUTF8StringEncoding];

 // code to process the response
}

In the debugger, I see no difference in fh between calls that generate the 
message and those that don't - it's always an NSConcreteFileHandle with a 
positive file descriptor. This message show up rougly about 10% of the time 
that the callback gets called, although it's not consistent.

Thanks in advance!
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/fclee%40dialup4less.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 and loadNibNamed

2008-05-04 Thread Joseph Ayers

The method that loads the NIB is:

-(void)loadTableController{
   if (tableController == NULL) {
   tableController = [[TableController alloc] init];
   if (![NSBundle loadNibNamed:@tableWindow owner:tableController]) {
   NSLog(@Error loading TableController);}
   else{
   NSLog(@TableController NIB Loaded);   
   }

   [tableController loadWindow];
   }   
}


After the aloc init step
tableController is 0x380060
dataTable is 0x0

At a break at the NSLog(@TableController NIB Loaded) call
the values are unchanged

indeed, the file's Owner is TableController and dataTable is connected 
to the NSTableView object in the NIB.


Thanks,
Joseph Ayers

Keary Suska wrote:

on 5/4/08 9:14 AM, [EMAIL PROTECTED] purportedly said:

  

I have a NSTableView as an instance of a NSWindowController declared as:

@interface TableController : NSWindowController {
IBOutlet NSWindow*   tableWindow;
IBOutlet NSTableView*dataTable;
IBOutlet NSTableHeaderView*  headers;
IBOutlet NSTableColumn*  column;
}

I read in the NIB using:
[NSBundle loadNibNamed:@tableWindow owner:tableController]



Did you set the file's owner of the nib to your TableController  class? Are
all the outlets connected? Is tableController non-nil when you call the
above method?

  

Indeed  the NIB tableWindow has file's Owner set to tableController and
there is a connection made to dataTable
from a TableController object.

I get a pointer to tableController, but the field dataTable is nil.



What do you mean by get a pointer to tableController? How are you getting
the pointer? Should you have already created it before calling -loadNibNamed
? If your outlet is nil, it is not getting connected.

  

How do I get dataTable to point to the NSTableView in the nib?



1. Set the File's Owner in the nib  to your custom class
2. Connect the dataTable outlet to the NSTableView

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/lobster%40neu.edu

This email sent to [EMAIL PROTECTED]

  


--
Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Cellular (617) 755-7523, FAX: (781) 581-6076 
Boston Office 444RI, (617) 373-4044

eMail: [EMAIL PROTECTED]
http://www.neurotechnology.neu.edu/

___

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

Please do not post admin requests or moderator comments to the list.
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 and loadNibNamed

2008-05-04 Thread Hamish Allan
On Sun, May 4, 2008 at 4:14 PM, Joseph Ayers [EMAIL PROTECTED] wrote:

  Indeed  the NIB tableWindow has file's Owner set to tableController and
 there is a connection made to dataTable
  from a TableController object.

Do you mean you have another TableController instantiated in your nib?
In that case, you have two TableControllers: one being the File's
Owner and a second one. It sounds like you have the dataTable
connection wired up from the second one. Delete that second
TableController and wire your dataTable connection from the File's
Owner instead.

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: NSTableView and loadNibNamed

2008-05-04 Thread Joseph Ayers

That was it.

Many thanks,
Joseph

Hamish Allan wrote:

On Sun, May 4, 2008 at 4:14 PM, Joseph Ayers [EMAIL PROTECTED] wrote:

  

 Indeed  the NIB tableWindow has file's Owner set to tableController and
there is a connection made to dataTable
 from a TableController object.



Do you mean you have another TableController instantiated in your nib?
In that case, you have two TableControllers: one being the File's
Owner and a second one. It sounds like you have the dataTable
connection wired up from the second one. Delete that second
TableController and wire your dataTable connection from the File's
Owner instead.

Hamish

  


--
Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Cellular (617) 755-7523, FAX: (781) 581-6076 
Boston Office 444RI, (617) 373-4044

eMail: [EMAIL PROTECTED]
http://www.neurotechnology.neu.edu/

___

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

Please do not post admin requests or moderator comments to the list.
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: Event loop in a secondary thread? Nibless Cocoa?

2008-05-04 Thread Ken Thomases

On May 4, 2008, at 4:55 AM, Jean-Daniel Dupas wrote:


Le 4 mai 08 à 05:18, Jens Alfke a écrit :



On 3 May '08, at 8:13 PM, Bruce Sherwood wrote:

Thanks! I'm really glad to hear that this is a known problem, and  
that there are solutions, even if it is pretty tricky stuff. Can  
you or someone else point me to a sample piece of code that could  
get me started?


I'm not sure, actually. Check the last few weeks of list archives;  
I remember a thread whose subject was something relevant about  
promoting a command-line process.


The function in question is TransformProcessType().

You might also find that reading the overview of the NSApplication  
class, with its discussion of the +sharedApplication method, helpful.


Cheers,
Ken___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Using ObjC to access SOAP/WSDL server

2008-05-04 Thread fclee
Thanks for the reply.
I've been doing research and found the NSURL... classes appear to do what I was 
looking for:
Accessing data from a server using a SOAP envelope.

1) The server provides me with a URL (no port# given;  just the http URL).
2) I can set/adjust the authority parameters via NSURL... routines.
3) I need to grab what's returned.  I think NSURL can do this.

Note: all communications to/from are in XML format.

The server DOES have a WSDL file, but it's not available to the public.
I tried to create stubs using WSMakeStubs with the given http URL.  But I got 
an error back.
I'm told that the .wsdl is hidden.

That was my 'phase 1' plan.
Now I'm checking  the NSURL... route.

I'll study further this evening.

Thanks again...
.. and I shall study all replies!

Regards,
Ric.

On 05/04/2008 12:23 Nir Soffer wrote ..
 
 On May 4, 2008, at 19:37, [EMAIL PROTECTED] wrote:
 
  Greetings Jeff  fellow Cocoa Developers:
   I need to access a SOAP/WSDL server.
 
 Check WebServicesCore framework (part of CoreServices framework).  
 Basically you create a WSMethodInvocation, then schedule it on the  
 runloop and get a callback when its done.
 
 If you have a working java code, this should not be too hard.
 
 You can create stubs from the WSDL using /Developer/Tools/ 
 WSMakeStubs. In my case, the stubs did not work - but were good  
 starting point for working code.

___

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

Please do not post admin requests or moderator comments to the list.
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: Working with svg

2008-05-04 Thread Jens Alfke


On 4 May '08, at 1:28 AM, lorenzo wrote:

I'm thinking to trasform svg data in xml plain data and managing an  
nsxmldocument for storing changes but I don't know how render the  
web-view with xml


Call [[webView mainFrame] loadHTMLString: xml baseURL: nil];

There's a related method that loads from NSData, if that's more  
convenient for your code.


—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: Reading XML (Mr. Gecko)

2008-05-04 Thread Jens Alfke


On 4 May '08, at 1:35 PM, Richard Wolf wrote:

Your next task is to learn XQuery.  If you are going to deal with  
searching XML data for values, this is a MUST, but you will be amply  
rewarded for all your efforts.


XQuery's powerful, all right, but it's kind of complicated, so I  
thought it wouldn't be a good thing to suggest to someone who's  
already dealing with learning the Cocoa APIs.


(Personally, I was never really able to figure out XQuery. XPath is  
sort of XQuery For Teh Dummiez, and saves me enough typing that I  
stick with it instead of limping back into the ring for another bout  
with XQuery.)


—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: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Christopher Kempke
Thanks to those folks who have tried (unsuccessfully) to help me.  My  
first post clearly contained too many magenta mackerels, so I've done  
what I should have started with and reduced it to a shorter example.


Given the following complete, nibless, and astoundingly uninteresting  
app:


#import Cocoa/Cocoa.h

int main(int argc, char *argv[])
{
//return NSApplicationMain(argc,  (const char **) argv);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];

NSRect platRect;
platRect.origin.x = 300;
platRect.origin.y = 300;
platRect.size.width = 200;
platRect.size.height = 200;

NSWindow* aWindow = [[NSWindow alloc] initWithContentRect:platRect
	styleMask:(NSTitledWindowMask | NSClosableWindowMask |  
NSMiniaturizableWindowMask | NSResizableWindowMask)  
backing:NSBackingStoreRetained defer:YES];



platRect.origin.x = 20;
platRect.origin.y = 20;
platRect.size.width = 100;
platRect.size.height = 100;

NSControl* ctl = [[NSButton alloc] init];
[(NSButton*)ctl setButtonType:NSSwitchButton];
[(NSButton*)ctl setTitle:@Check Me];
[(NSButton*)ctl setState:1];
[ctl setFrame:platRect];

NSView* cview = [aWindow contentView];
[cview addSubview:ctl];

[aWindow makeKeyAndOrderFront:nil];

[NSApp run];

return 0;
}

Clearly I'm missing something critical here (and artistic talent  
isn't what I'm looking for).  What important step am I missing to make  
the event loop handle the drawing of my window and checkbox?


--Christopher Kempke
___

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

Please do not post admin requests or moderator comments to the list.
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]


Cannot remove an observer ... because it is not registered as an observer.

2008-05-04 Thread Steve Steinitz

Hello,

I now have two projects where I am getting the error below.  
I've tried some obvious things like adding calls to will|did 
Access|Change ValueForKey to my custom methods and also ensuring 
key-value compliance by adding dummy setters.  Here is the error.


Cannot remove an observer NSTableBinder 0x158a70 for the key 
path name from Alternative 0x15abd0 because it is not 
registered as an observer.


It doesn't help that 'it' is ambiguous.

Is there a workaround?  A solution?

I've asked about this previously and have included my previous 
post, below.


Thanks,

Steve






Older post on the same subject: Cannot remove an observer

Hello,

I have what, in WebObjects, we used to call a master-slave 
display.  I show a list of specific Products based on the 
selected Product Model, hereafter referred to as the 'Model'. So 
when a user picks a certain Model of sunglasses in the master 
list, she sees all the different size/color/lens combinations 
(Products) in the slave list.  It works nicely.


I use a contentSet binding (programmatically-generated if that 
makes a difference) to filter the slave list ie. bind it to the 
to-many relationship from Model to Products. **


In the slave (Product) list, I have a popup that allows the user 
to change a Product's Model.  The popup is usually only used to 
fix data entry errors - e.g. specifying the wrong Model for a Product.


Here is my problem.  I noticed that changing the Model results 
in two exception:


NSRangeException -- Cannot remove an observer 
NSKeyValueObservance 0x30bacf0 for the key path currentCost 
from Model 0x2a159a0 because it is not registered as an observer.


and

NSInternalInconsistencyException -- Cannot remove an observer 
ProductCategorySelectingArrayController 0x10e8650 for the key 
path model.currentCost from Product 0x1a68130, most likely 
because the value for the key model has changed without an 
appropriate KVO notification being sent. Check the 
KVO-compliance of the Product class.


Googling, I found some other developers who have experienced 
this but no answers were offered.


Note that the exceptions are complaining about one of the 
Model's attributes: currentCost.  At other times, the exception 
complains about another attribute: 'active' -- its unclear 
whether that refers to the Model's 'active' attribute or the 
Product's 'active' attribute.


Should I be reporting a bug?

Thanks,

Steve


** this likely has little to do with my question, but for the 
curious: I

programmatically bind a contentSet based on the setting of a radio
button with two choices: 'All' and Model.  All means show all
products, Model means show just the Products for the selected Model.
I only have the problem in Model mode.

___

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

Please do not post admin requests or moderator comments to the list.
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: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Adam Leonard

Hi,
Did you see Michael Ash's message?

That certainly seems like the problem to me.
Just change backing:NSBackingStoreRetained to NSBackingStoreBuffered  
and see if that works.


Adam Leonard

On May 4, 2008, at 3:23 PM, Christopher Kempke wrote:

Thanks to those folks who have tried (unsuccessfully) to help me.   
My first post clearly contained too many magenta mackerels, so I've  
done what I should have started with and reduced it to a shorter  
example.


Given the following complete, nibless, and astoundingly  
uninteresting app:


#import Cocoa/Cocoa.h

int main(int argc, char *argv[])
{
//return NSApplicationMain(argc,  (const char **) argv);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];

NSRect platRect;
platRect.origin.x = 300;
platRect.origin.y = 300;
platRect.size.width = 200;
platRect.size.height = 200;

NSWindow* aWindow = [[NSWindow alloc] initWithContentRect:platRect
	styleMask:(NSTitledWindowMask | NSClosableWindowMask |  
NSMiniaturizableWindowMask | NSResizableWindowMask)  
backing:NSBackingStoreRetained defer:YES];



platRect.origin.x = 20;
platRect.origin.y = 20;
platRect.size.width = 100;
platRect.size.height = 100;

NSControl* ctl = [[NSButton alloc] init];
[(NSButton*)ctl setButtonType:NSSwitchButton];
[(NSButton*)ctl setTitle:@Check Me];
[(NSButton*)ctl setState:1];
[ctl setFrame:platRect];

NSView* cview = [aWindow contentView];
[cview addSubview:ctl];

[aWindow makeKeyAndOrderFront:nil];

[NSApp run];

return 0;
}

Clearly I'm missing something critical here (and artistic talent  
isn't what I'm looking for).  What important step am I missing to  
make the event loop handle the drawing of my window and checkbox?


--Christopher Kempke
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/adam%40caffeinatedcocoa.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]


NSXML assistance please

2008-05-04 Thread Damien Cooke
I am porting a tool from Java to Cocoa.  I am reasonably new to XML  
and I am having some difficulties.


my Items in the XML look like this:



Item Name=01.Image.JPG PhysicalFilePath=C:\Documents and Settings 
\M01.Image.JPG Title=Bridge Category=Structures SubCategory=  
Region=South Australia MediaType=Photo

Keywords
  Keywordmulti-laned/Keyword
  Keywordnon-water-based/Keyword
/Keywords
  /Item

I can easily get the keywords out but have found no way of getting the  
attributes out of the Item tag.  Can someone make some suggestions?


Regards
Damien


___

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

Please do not post admin requests or moderator comments to the list.
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: List Running apps and windows

2008-05-04 Thread Chris Hanson

On May 3, 2008, at 3:52 PM, Jere Gmail wrote:


I want to list all the running apps and their windows.


Why, what do you hope to do with this information?

The answer to that will probably help us help you much better.

  -- Chris


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: List Running apps and windows

2008-05-04 Thread Adam Leonard


On May 4, 2008, at 2:28 AM, Jere Gmail wrote:

I have implemented this code:
if(!AXAPIEnabled ())
{
NSLog(@API not enabled);
return;
}
if(!AXIsProcessTrusted ())
{
NSLog(@PROCESS not trusted);
}
And it enters the second if, so my app is not trusted. I have tried  
using

AXMakeProcessTrusted((CFStringRef)path);
But it wont do anything, no matter if I relaunch or not.
Guesses?


You need to be running as root to call AXMakeProcessTrusted().
I wrote a post on my blog with some code to do that: http://caffeinatedcocoa.com/blog/?p=12 
 (look towards the bottom)



Adam Leonard
___

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

Please do not post admin requests or moderator comments to the list.
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: NSXML assistance please

2008-05-04 Thread Chris Hanson

On May 4, 2008, at 3:53 PM, Damien Cooke wrote:

Item Name=01.Image.JPG PhysicalFilePath=C:\Documents and Settings 
\M01.Image.JPG Title=Bridge Category=Structures SubCategory=  
Region=South Australia MediaType=Photo

   Keywords
 Keywordmulti-laned/Keyword
 Keywordnon-water-based/Keyword
   /Keywords
 /Item

I can easily get the keywords out but have found no way of getting  
the attributes out of the Item tag.  Can someone make some  
suggestions?


If you're using NSXMLDocument to represent your XML, each Item is an  
NSXMLElement and you can therefore use NSXMLElement's attribute  
methods to get at its attributes.  Pretty basic, just read the docs on  
NSXMLElement:


http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSXMLElement_Class/Reference/Reference.html 



Also, if you're going to work with XML documents on Mac OS X, it's  
well worth reading the Tree-Based XML Programming Guide for Cocoa http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/NSXML.html 
.


Read that document first and it'll give you a pretty good overview of  
what's available and where to look for figuring this sort of thing out.


  -- Chris

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Kyle Sluder
On Sun, May 4, 2008 at 6:47 PM, Adam Leonard [EMAIL PROTECTED] wrote:
  Just change backing:NSBackingStoreRetained to NSBackingStoreBuffered and
 see if that works.

You're also displaying your window before NSApplication starts pumping
the runloop.  Perhaps you should consider making a delegate of NSApp
that responds to -applicationDidFinishLaunching: and put your window
creation code in there.

--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: Cannot remove an observer ... because it is not registered as an observer.

2008-05-04 Thread Jens Alfke


On 4 May '08, at 3:35 PM, Steve Steinitz wrote:

Cannot remove an observer NSTableBinder 0x158a70 for the key path  
name from Alternative 0x15abd0 because it is not registered as  
an observer.


It refers to the observer. -removeObserver:forKeyPath: raises this  
exception if told to remove an object that isn't currently registered  
as an observer. So what's happening is that a table view is trying to  
unregister as an observer from one of your objects that it  
unfortunately didn't previouly register as an observer for.


The usual cause of this is that you have a property that isn't KVO- 
compliant. Something accesses your 'foo' property and registers as an  
observer of that property, and also as an observer of the object  
that's the property's current value; you change the value of 'foo'  
without letting anyone know; the observer then later decides to stop  
observing, gets your 'foo' property, and removes itself as an observer  
of that object. But it's no longer the same object that it registered  
as an observer for...


—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: Cocoa-dev Digest, Vol 5, Issue 727

2008-05-04 Thread John Joyce
I'm struggling and maybe tired, but how do you set the state of and  
NSMatrix with radio buttons and NSPopUpButton ?

Does it go in windowDidLoad or should it be in awakeFromNIB ?
This is in a Preference window for my app.
I'm having a hard time figuring out how to get it to set state to  
reflect the userDefaults.
No trouble with changing the defaults after a selection, just  
reflecting the current defaults on load of the window.

What methods am I missing?
For the popup, I have tried selectItemWithTitle, selectItemWithTag,  
etc...
For the radio button matrix, I am totally lost and I don't understand  
how to set the state of it. Does the matrix need IBOutlets for each  
cell 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]