Re: Removing folder from /Applications
On 8.7.2008, at 12:52, Glover,David wrote: Hi there, I've create a little app that is required to remove an obsolete folder from /Applications. This works fine when the user is logged in as an Admin, but not when logged in as a Standard user, as they obviously require authorization. So, I added some code to request an Admin username and password using Authorization Services, immediately before calling removeFileAtPath to remove the folder. However, the folder still cannot be removed after inputting an Admin username and password. Please can anybody offer any insight into what I'm missing here? Kind regards Dave Hi Dave, hard to help without any code. Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: Memory not freed with CIImage
On 12.6.2008, at 7:48, Stefano Falda wrote: On 12/giu/08, at 00:34, Nick Zitzmann wrote: It's normal for physical memory sizes to go up, and not come down until either the program is quit or the physical memory is needed elsewhere. Activity Monitor is not a memory leak detector. If you want to know where the memory is going, then use Instruments instead. Nick Zitzmann http://www.chronosnet.com/ I've tried, but I must admit that Instruments confused me... :-( Anyway, why the memory is marked as Active under Activity Monitor, and the iMac performance become sluggish, while this doesn't happen when using NSImage? Thank you Stefano Hi, I find Instruments weird too, but there is a lot of power there. Do you know you can simply build your application and choose from menu: Run - Start with Performace Tool - Leaks? HTH Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Support saving to network volumes
Hello folks, being more sysadmin than developer I'm very interested in the issue of saving Photoshop files over network, which is discussed here: http://discussions.apple.com/thread.jspa?messageID=7280520 and here http://www.adobeforums.com/webx/.59b56503/8 - and appears to be broken in the 10.5.3. I did check documentation again and I didn't find anything specific about saving to network volumes. I thought that _it just works_. I got several in house applications which support saving and am very interested in saving _the right way_ PS: I know that Adobe and even Microsoft doesn't officially support working on files which are on the network Thanks Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: DirWatch
On 23.5.2008, at 6:42, Ken Thomases wrote: On May 22, 2008, at 10:56 PM, Ken Thomases wrote: On May 22, 2008, at 6:57 PM, Lorenzo wrote: I can't. Think about the FNSubscribe tells me that there is something new because the user copied 2 new files into that folder, but only one file is totally copied, the other one is still in copying. So now I scan the folder with directoryContentsAtPath I compare with the previous list and I know that there are 2 new files. Well, one file is totally copied and the other one could be still in copying. You can try FSGetCatalogInfo() and the kFSNodeForkOpenBit of the nodeFlags field of the FSCatalogInfo structure to test if the file is still open. I'm not sure if this is supported on all filesystems that Mac OS X supports. It's actually very unusual for an OS or filesystem implementation to keep that sort of information in application-accessible form. The problem on a preemptively multi-tasking system is that the file's status can change between when you test and when you act on the results of the test. Generally speaking, sometimes the solution to a race condition like that is to attempt to grab the contended resource for exclusive access. If you succeed, you know that nobody else was using the resource, nor will they be able to start using it while you're using it. Again, it's quite unusual for modern OSes to support mandatory locking of files in this way. Most only provide advisory locking. However, Mac OS X's File Manager still maintains provisions for it. Once again, they may not work on all filesystems. In addition to the File Manager Reference, you can check out Technical Note FL37 http://developer.apple.com/technotes/fl/fl_37.html, although it's nearly archaic. (Not as archaic as the date it claims, though! :) OK, so none of the above actually works in the general case on Mac OS X. I checked the nodeFlags thing myself with a little test program and it doesn't work. The bits indicating if forks are open are never set. Also, I found a more recent technote regarding exclusive file access: http://developer.apple.com/technotes/tn/tn2037.html . That technote, though, does indicate that the frameworks perform and respect advisory locking. So, this is pretty good. It covers the most common cases. The exception would be a program using the BSD/ POSIX file access routines directly. Regards, Ken ___ I remember a utility which I wrote several years ago and I solved the problem using timer. I had a preference setting allowing to set 'how many seconds should I wait, until I take the file as complete'. Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: 'Configure Sheet' fails when containing a WebView
On 23.5.2008, at 14:28, harry greenmonster wrote: Hi I have a screensaver which I'm building, I have created a 'configure sheet' accessed by the 'options' button in 'system preferencesscreensaver'. In IB I drag WebView onto my 'configure sheet', then when I test the screensaver the 'options button' fails to open the sheet. If I delete the WebView in IB, and add any other view it works fine... Any ideas? Did you add WebKit.framework to your project? HTH Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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 et al as HCI usability problem
Well, I just made new bugreport #5955452 to enhance docs sets with more sample code inside of method descriptions. I took NSEnumerator's nextObject method as a sample how to do it the right way.. http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSEnumerator_Class/Reference/Reference.html#//apple_ref/doc/uid/2142-BCICDDHA Btw please keep this discussion going it's great. Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Core Data: How to encrypt a persistent store
On 22.5.2008, at 12:12, Ruotger Skupin wrote: Hi, I have an application which uses Core Data and handles sensitive information. Is there an easy way to encrypt the on-disk persistent store provided I'm reasonably fluent in libCrypto and do not want to use an encrypted disk image? Ruotger ___ Hi, I believe you need to subclass NSAtomicStore methods load: and save: HTH Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: File integrity
On 22.5.2008, at 12:35, [EMAIL PROTECTED] wrote: Hi all, is there a way to tell if my executable was launched by/attached to some other process? Basically, I just want to kill myself as soon as I sense those prying eyes, in order to make it just a little it harder for the crackers. TIA Check this: http://www.steike.com/code/debugging-itunes-with-gdb/ HTH Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: NSWindow in main nib.
On 22.5.2008, at 12:52, [EMAIL PROTECTED] wrote: Hi, I posted a qustion that about wndow zoom button.Now i got the window by setting all the intial positions. Thanks Sorry I have no idea what are you talking about. Could you please rephrase your question? Anyway, please don't cross post. Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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 does not lose focus
On 22.5.2008, at 11:15, Torsten Curdt wrote: I've got a NSTextField (on a NSTabView). I open the window. I click the text field and enter some text. Now I click on a button next to it. The value has still not been committed and it still has the cursor. Then I click outside of the text field (just somewhere in the view) and still the NSTextField does not lose it's focus. What's going on? I looked through options in IB3. What do I need to read up on? cheers -- Torsten Hey Torsten, it's the way how GUI works on OSX. Hitting button doesn't steal focus from text field, nor clicking in window. You can test this behaviour without any code, just inside IB. 1. Start IB 2. Choose Cocoa Window template 3. Drag text field and button into window 4. HIt -R to start Simulator HTH Robert___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: NSPasteboard Delegate
Hi, I don't think it's possible to be notified about pasteboard change. Depending on your needs I believe a polling should be the right way to go. HTH Robert On 22.5.2008, at 14:08, Adil Saleem wrote: Let me be more precise this time. I haven't used pasteboards before. I think i asked wrong question. Actually i want my application to be notified whenever there is a new text copied/cutted. So that i can paste it in my application. So please guide me how that can be achieved? (with or without delegates. whatever works) Thank you for your patience. --- Graham Cox [EMAIL PROTECTED] wrote: NSPasteboard indeed does not implement a setDelegate: method. The object you pass as owner in -declareTypes:owner: can act as the pasteboard's delegate in the case of when you promise (but do not actually provide) data when writing your data types to the pasteboard. What are you trying to do? Seems to me that attempting to become a permanent delegate of the general pasteboard in an awakeFromNib method is a very weird thing to do. Have you read this?: file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/CopyandPaste/Articles/pbImplementing.html #//apple_ref/doc/uid/TP40004255-SW2 In particular the section on Lazy Writing. This is about the only time that the delegation pattern is used by NSPasteboard. hth, G. On 22 May 2008, at 5:57 pm, Adil Saleem wrote: Hi, I am trying to set my object as delegate of NSPasteBoard. I am calling from awakeFromNib NSPasteboard *pb = [NSPasteboard generalPasteboard]; [pb setDelegate:self]; However, on running, it raises exception. There is also a warning at compile time that says NSPasteboard may not respond to method setDelegate. Please tell me how can i set my own class as delegate of NSPasteboard. Thanx ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.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/robertcerny%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: NSTextField will not become editable in a borderless window
You need to subclass NSTextField. http://www.cocoadev.com/index.pl?BorderlessWindow HTH Robert On 22.5.2008, at 14:13, Peter Burtis wrote: When I add an NSTextField to a borderless window, nothing I do will make it editable. Specifically, running the code below, the text field just won't work. (I've tried it with all backing types, BTW.) NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(300,300,300,300) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; NSTextField *field = [[NSTextField alloc] init]; [field setEditable:YES]; [window setContentView:field]; [window makeKeyAndOrderFront:self]; But change the styleMask to NSTitledWindowMask and it works as expected. What am I missing? Is it impossible to do this for some reason? On the subject of NSBorderlessWindowMask, the docs give the rather opaque guidance, Useful only for display or caching purposes, as if a window was useful for anything other than display. Is there some other, better way to create a completely custom window? I'm running 10.5.2, if that matters. Thanks, Peter Burtis ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/robertcerny%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: Newbie query re default buttons
Hi, could you simply add the default flag in IB? 1. select the button 2. Hit -1 to bring up Inspector pane 3. Click the dark grey rectangle next to Key Equiv. 4. Hit Enter HTH Robert On 22.5.2008, at 16:51, Michael McLaughlin wrote: As a Cocoa newbie (after years of Carbon), I am working my way through the 3rd edition of Hillegass' book. I finished his SpeakLine example then thought I'd challenge myself by making the Speak button the default button -- but failed. I coded the following *** AppController.h @interface AppController : NSObject { IBOutlet NSTextField *textField; NSSpeechSynthesizer *speechSynth; IBOutlet NSView *windView; -- content view, added IBOutlet NSButton *speakButton; -- added } - (IBAction)sayIt:(id)sender; - (IBAction)stopIt:(id)sender; @end *** added to AppController.m - (void)awakeFromNib { [[speakButton window] setDefaultButtonCell:[speakButton cell]]; // debugging NSButtonCell *def = nil; def = [[speakButton window] defaultButtonCell]; } I made the connections in IB to both windView and speakButton and they look OK (compared to those in Apple's BackgroundExporter sample code. I tried using the content view as well as the button itself to get the window. Neither works. My button is not blue or pulsing and the Return key does nothing. The def variable *does* get the correct result (judging by self variables). Using windView to get the window does not help. Calling [speakButton setKeyEquivalent:@\r]; did not work either. Even though my code and the BackgroundExporter seem the same to me, I am obviously missing something. Any tips, from anyone? TIA. -- Mike McLaughlin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/robertcerny%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: Newbie query re default buttons
Just FYI, [myButton setKeyEquivalent:@\r]; is the correct way to set button to Default. Are you sure that speakButton is not nil? Robert On 22.5.2008, at 16:51, Michael McLaughlin wrote: As a Cocoa newbie (after years of Carbon), I am working my way through the 3rd edition of Hillegass' book. I finished his SpeakLine example then thought I'd challenge myself by making the Speak button the default button -- but failed. I coded the following *** AppController.h @interface AppController : NSObject { IBOutlet NSTextField *textField; NSSpeechSynthesizer *speechSynth; IBOutlet NSView *windView; -- content view, added IBOutlet NSButton *speakButton; -- added } - (IBAction)sayIt:(id)sender; - (IBAction)stopIt:(id)sender; @end *** added to AppController.m - (void)awakeFromNib { [[speakButton window] setDefaultButtonCell:[speakButton cell]]; // debugging NSButtonCell *def = nil; def = [[speakButton window] defaultButtonCell]; } I made the connections in IB to both windView and speakButton and they look OK (compared to those in Apple's BackgroundExporter sample code. I tried using the content view as well as the button itself to get the window. Neither works. My button is not blue or pulsing and the Return key does nothing. The def variable *does* get the correct result (judging by self variables). Using windView to get the window does not help. Calling [speakButton setKeyEquivalent:@\r]; did not work either. Even though my code and the BackgroundExporter seem the same to me, I am obviously missing something. Any tips, from anyone? TIA. -- Mike McLaughlin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/robertcerny%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: Newbie query re default buttons
Hi, could you send me your project off list? I will check it and let you know what's wrong. (If I find it of course) Robert On 22.5.2008, at 19:39, Michael McLaughlin wrote: Robert Cerny wrote: Just FYI, [myButton setKeyEquivalent:@\r]; is the correct way to set button to Default. Are you sure that speakButton is not nil? The button is OK. I found that I could get the button to work by entering the Return key equivalent in IB, stubbing out awakeFromNib. However, the *appearance* of the button is still non-default. Also, Hillegass instructs to set up the FirstResponder of the window to point to the textField. I had done that earlier and thought that it might be interefing so I eliminated it along with the entire textField in IB, then made a new textField without messing with FirstResponder. I found that the textField behaves just as though the FirstResponder still existed (perhaps this is a new default behavior with a single textField). The button appearance was not fixed. So, right now, the button works as though it were the default (thanks to the IB key equivalent field) but it does not *look* like a default button. I searched again for some difference in what I did vs. what the BackgroundExporter code looks like and cannot find any real differences. Moreover, the debugger behaves as though all it well -- no errors, no nil outlets. BTW, all of this is with Xcode 3.0 and OS 10.5.2. On 22.5.2008, at 16:51, Michael McLaughlin wrote: As a Cocoa newbie (after years of Carbon), I am working my way through the 3rd edition of Hillegass' book. I finished his SpeakLine example then thought I'd challenge myself by making the Speak button the default button -- but failed. I coded the following *** AppController.h @interface AppController : NSObject { IBOutlet NSTextField *textField; NSSpeechSynthesizer *speechSynth; IBOutlet NSView *windView; -- content view, added IBOutlet NSButton *speakButton; -- added } - (IBAction)sayIt:(id)sender; - (IBAction)stopIt:(id)sender; @end *** added to AppController.m - (void)awakeFromNib { [[speakButton window] setDefaultButtonCell:[speakButton cell]]; // debugging NSButtonCell *def = nil; def = [[speakButton window] defaultButtonCell]; } I made the connections in IB to both windView and speakButton and they look OK (compared to those in Apple's BackgroundExporter sample code. I tried using the content view as well as the button itself to get the window. Neither works. My button is not blue or pulsing and the Return key does nothing. The def variable *does* get the correct result (judging by self variables). Using windView to get the window does not help. -- Mike McLaughlin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: DirWatch
On 23.5.2008, at 0:32, Lorenzo wrote: Hi, I need to watch at a given folder and check whenever a new file has been copied therein. At the beginning, I fired a timer periodically getting the list of the contents of that folder with directoryContentsAtPath But soon I discovered that the list includes files still in copying (not yet the whole file). So I switched to NewFNSubscriptionUPP FNSubscribe Here I get the notification only after a file has been totally copied into the folder, but I can't yet find the way to know which file has been copied. Do you know how to get that info? Thanks. Best Regards -- Lorenzo email: [EMAIL PROTECTED] Not sure what are you trying to achieve but I had to solve similar problem (on server) and lauchnd was very helpful there. You can set it up to watch folder for changes... Another option which came to my mind was UKQueue by Uli http://www.zathras.de/angelweb/sourcecode.htm HTH Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
NSXMLDocument encoding
Hi folks, I use NSXMLDocument to parse web page content, which is in NSWindowsCP1250Encoding. However I don't get correctly encoded data from NSXMLNodes NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; NSData *webData = [NSURLConnection sendSynchronousRequest:req returningResponse:response error:error]; doc = [[NSXMLDocument alloc] initWithData:webData options:NSXMLDocumentTidyHTML error:error]; [doc setCharacterEncoding:@windows-1250]; does anyone have an idea what's wrong? Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: NSXMLDocument encoding
On 5.5.2008, at 22:41, Ricky Sharp wrote: On May 5, 2008, at 2:53 PM, Robert Cerny wrote: I use NSXMLDocument to parse web page content, which is in NSWindowsCP1250Encoding. However I don't get correctly encoded data from NSXMLNodes NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; NSData *webData = [NSURLConnection sendSynchronousRequest:req returningResponse:response error:error]; doc = [[NSXMLDocument alloc] initWithData:webData options:NSXMLDocumentTidyHTML error:error]; [doc setCharacterEncoding:@windows-1250]; does anyone have an idea what's wrong? You're going to have to provide more detail. For example, given a starting string, how is it getting mangled? The best thing to do for encoding issues is to divide and conquer to see where there problem(s) is/are. For example, how exactly is the data from the web-site handled? e.g. does the URL point directly to an XML file? Is there something about the HTTP header that is specifying the wrong encoding? Is there an encoding attribute in the XML file itself? ___ Ricky A. Sharp mailto:[EMAIL PROTECTED] Instant Interactive(tm) http://www.instantinteractive.com Hi, thanks for your reply. My URL is a standard HTML (php based) web page which I need to parse to gather some data. It's in XHTML Transitional coding, lang defined as 'cs': !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; xml:lang=cs lang=cs meta http-equiv=content-type content=text/html; charset=windows-1250 / When I get contents of URL as NSData and convert it to [NSString initWithData:(NSData *)data encoding:(NSStringEncoding)encoding] and provide NSWindowsCP1250Encoding, I get correct result. Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: NSXMLDocument encoding
Hi, On 5.5.2008, at 23:14, Jens Alfke wrote: On 5 May '08, at 12:53 PM, Robert Cerny wrote: doc = [[NSXMLDocument alloc] initWithData:webData options:NSXMLDocumentTidyHTML error:error]; Try using -initWithContentsOfURL: instead — then it can see the HTTP headers, which might describe the encoding. good idea, but it didn't change anything You don't get an error back in the 'error' parameter? Error Domain=NSXMLParserErrorDomain Code=1 UserInfo=0x12d8300 line 217 column 9376 - Warning: discarding invalid character code 141 line 298 column 210 - Warning: '' + '/' + letter not allowed here line 298 column 217 - Warning: '' + '/' + letter not allowed here line 49 column 11 - Warning: table lacks summary attribute line 217 column 1 - Warning: table lacks summary attribute Info: Doctype given is -//W3C//DTD XHTML 1.0 Transitional//EN Info: Document content looks like XHTML 1.0 Transitional 5 warnings, 0 errors were found! However I don't get correctly encoded data from NSXMLNodes Well, what *do* you get? Show us the data and what you expected. I get the data in us-ascii encoding. The accented characters are missing from output or changed to wrong letters When I get contents of URL as NSData and convert it to [NSString initWithData:(NSData *)data encoding:(NSStringEncoding)encoding] and provide NSWindowsCP1250Encoding, I get correct result. Then you could use the -initWithXMLString: initializer instead... —Jens Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
AddressBook.framework binding
hi everybody, I searched the web but I'm probably not asking the right question :/ Is there a way how to use AddressBook data with bindings directly (I mean without writing glue code for extracting values wrapped with properties)? I mean I can write bunch of repeating code and add it to ABPerson category like: @implementation ABPerson (_binding_) - (NSString*)lastName { return [self valueForProperty:kABLastNameProperty]; } - (NSString*)firstName { return [self valueForProperty:kABFirstNameProperty]; } @end but is there a more clever way? Thanks Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Why is my NSTableView empty?
Hi, I'm kind of stupid today, my question is probably very easy to answer. I haven't been in programming for some time and somehow cannot manage solution for my following simple problem.. I got an array 'peeps' populated in apps delegate: peeps = [[NSArray arrayWithArray:[[ABAddressBook sharedAddressBook] people]] retain]; I created an ABPerson category to get lastName easily... - (NSString*) lastName { return [self valueForProperty:kABLastNameProperty]; } and I'm trying to display all last names in the table. - I created NSArrayController ABPeople and set content to my delagate, key path: peeps - I bound table content to ABPeople, controller key: arrangedObjects - I bound table column value to ABPeople, controller key: arrangedObjects, model key path: lastname and my table becomes full of empty rows (I got 380 addresses in AB, so I expect I got 380 empty rows in table). What am I missing? Thanks in advance Robert ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.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: Why is my NSTableView empty?
Hello IS, thanks for your reply. On 28.4.2008, at 16:46, I. Savant wrote: and I'm trying to display all last names in the table. - I created NSArrayController ABPeople and set content to my delagate, key path: peeps This is imprecise - if there is a problem with this, we won't know to tell you about it without the specifics of how this works in your application. I dragged NSArrayController over my MainMenu.nib file a dropped it. I did set: ClassName = ABPerson Prepares contents = YES Editable = YES Controller Content: Bind to MyApp_Delegate model key path: peeps - I bound table content to ABPeople, controller key: arrangedObjects - I bound table column value to ABPeople, controller key: arrangedObjects, model key path: lastname Why both? Drop the table content binding and just bind the column value. Also, was lastname a typo or is the model key path actually lastName? This matters. I did drop content binding for table and checked that lastName was a typo. I created a textfield and did set it up to: binding: ABPeople controller key: arrangedObjects model:@count and got correct 388 count of ppl in AB. Robert -- 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: NSMailDelivery Deprecated
Hello Seth, check this link http://www.cocoadev.com/index.pl?SendingEmailMessages HTH Robert On 12.4.2008, at 19:35, Seth Willits wrote: Howdy, I'm writing an internal tool, and NSMailDelivery looked to fit the bill to automatically send emails behind the scenes, but it was deprecated in 10.5. Is there a replacement at all for it? All I need is a way to send emails from an smtp server. Thanks, -- Seth Willits ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/robertcerny%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]