Re: Error with malloc and NSFileWrapper

2008-12-19 Thread Ken Thomases
On Dec 17, 2008, at 7:22 PM, Guillaume Campagna wrote: I'm using a NSDirectoryEnumerator to add all the content of a folder to some array... I'm filtering these files (I don't want certains types of files). One of these file types is symbolic link (alias). So I'm using NSFileWrapper to

Re: UNIX signals

2008-12-19 Thread Ken Thomases
On Dec 18, 2008, at 12:59 PM, Michael Ash wrote: Good luck finding *any* documentation about the mach functions. (Seriously. If you know of good Apple-provided ones, I'd like to know!) Normally I'd be wary, but in this case not having documentation is simply par for the course. As you

Fwd: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread jonathan
I think that this there is still not enough example code here to help. I use AsyncSocket extensively and any trouble I have had with data transfer has been my fault entirely. -(void)onSocket:(AsyncSocket *)sock didReadData:(NSData*)data withTag:(long)tag Having said that I always use the

Re: -[NSURLConnection cancel] doesn't release its delegate?

2008-12-19 Thread Jonathan del Strother
On Thu, Dec 18, 2008 at 6:43 PM, Stephen J. Butler stephen.but...@gmail.com wrote: Actually, this works for me on 10.5.6, with XCode 3.1.1. The assert doesn't trigger. ... Or it could be a bug that was fixed in the latest release.Try putting a run loop in your main function instead. I'd try

SocketPort allocating

2008-12-19 Thread Kiran Kumar S
I had Distributed object which can used by any client, i am establishing connection using a port , every thing works fine.My object is vended and the client can use the vended object . But i am getting problem when i restart my server which supplies vended object. When i am restarting

Re: Enabling add button

2008-12-19 Thread Andre Masse
Thanks a lot Mark, This works great. The only change I made is to test with isEqualTo for the table view's specific instance to prevent adding rows when the master table is the first responder. And no flickers when presenting a sheet :-) Thanks again, Andre Masse On Dec 19, 2008, at

Re: does this crash make sense to anyone?

2008-12-19 Thread slasktrattena...@gmail.com
Thank you. I have read up on NSZombie et al and found a non-retained object that may have been the culprit, although it's too early to say definitely. I'll keep investigating... Cheers On Thu, Dec 18, 2008 at 8:49 PM, Shawn Erickson shaw...@gmail.com wrote: On Thu, Dec 18, 2008 at 11:45 AM,

download security hanging app - It's a more general Problem + Solution

2008-12-19 Thread Robert Clair
It seems to be a more general bug with runModalForWindow: If anything grabs the focus while the app is starting (i.e. something that would require you click on the dock icon to get the app back - which the warning does) the modal window never becomes visible. I can see the same thing by

NSNoSelectionMarker example?

2008-12-19 Thread Jon C. Munson II
Namaste! Anyone have an example of using NSNoSelectionMarker in a value transformer? If so, would you mind sharing? I've looked at what documentation I can locate and am not able to retrieve an appropriate example. The difficulty I'm having is having value evaluate properly against

Re: User Default Bindings

2008-12-19 Thread patrick machielse
Gerriet Denkman wrote: A related question: In Tiger I often used a Model Key Path containing blanks. Now IB (Version 3.1.1 (672)) does no longer allows me to enter this. Where is the definition of a valid key path to be found? Spaces obviously cannot occur in Obj-C method keypaths, but

Optimizing NSRectFill

2008-12-19 Thread Oleg Krupnov
I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the view. I am disappointed that such a basic operation

Re: Optimizing NSRectFill

2008-12-19 Thread Stéphane Sudre
On Dec 19, 2008, at 4:37 PM, Oleg Krupnov wrote: I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Jean-Nicolas Jolivet
Well after doing more tests... It happens even if I only have 1 active connection and it also happens even if only download 1 part of the multiparts file (i.e. the part is still slightly bigger than it should be) so basically the files that were ending up ok with multiple connections

Listening for changes

2008-12-19 Thread Andre Masse
Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do - observeValueForKeyPath for each of the 25 fields? Thanks, Andre Masse ___ Cocoa-dev mailing list

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Michael Ash
On Fri, Dec 19, 2008 at 11:43 AM, Jean-Nicolas Jolivet silver...@videotron.ca wrote: Well after doing more tests... It happens even if I only have 1 active connection and it also happens even if only download 1 part of the multiparts file (i.e. the part is still slightly bigger than it

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Jean-Nicolas Jolivet
I would love to give you an answer! The problem is that every newsreader out there that download binary files automatically decode and join the parts... I can't download just one part to test it against the part that my app downloaded!... I'm still trying to find another app that might be

Is NSKeyedArchiver portable / reliable?

2008-12-19 Thread Mike Chambers
I need to include a set of data with my application. It is an Array of about 1500 objects. Since this may also be used as an iphone app, I need this to be as fast and efficient as possible. I want to use NSKeyedArchiver to serialize the data to a file, and then include that file in the

Re: Listening for changes

2008-12-19 Thread Ken Thomases
On Dec 19, 2008, at 11:06 AM, Andre Masse wrote: Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do - observeValueForKeyPath for each of the 25 fields? You can add one fake property, use

Re: Listening for changes

2008-12-19 Thread Andre Masse
Thanks for the great trick! Andre Masse On Dec 19, 2008, at 12:35, Ken Thomases wrote: On Dec 19, 2008, at 11:06 AM, Andre Masse wrote: Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do -

Re: [Q] How to let the pasteboard know a file type?

2008-12-19 Thread JongAm Park
Hello. I found out that NSCreateFilenamePboardType() would help. So, I tried it like : My code example is : In awakeFromNib NSString http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html *quicktimeFileNamesPboardType =

Cocoa Apple Script Problem

2008-12-19 Thread John Nairn
I have implemented the required methods to support creating an object in Apple Script, but it does not work as advertised. This does work as expected tell front document make new family at end tell last family set properties to

Re: Is NSKeyedArchiver portable / reliable?

2008-12-19 Thread Nick Zitzmann
On Dec 19, 2008, at 9:24 AM, Mike Chambers wrote: 1. Would this work across different machines? If by different machines you mean PPC, Intel, 32-bit, 64-bit, iPhone, iPod, etc. then yes. NSKeyedArchiver is documented as being architecture-independent. There are some subtle differences

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Jean-Nicolas Jolivet
Well after comparing the data that I am receiving with the data that I SHOULD be receiving, it turns out that dots (yes, the dot character (.) ) are added all over the place in the data if I have 10 extra bytes, it means 10 extra dots were added to my data, so for example, a line that

Re: Optimizing NSRectFill

2008-12-19 Thread Bill Bumgarner
On Dec 19, 2008, at 7:37 AM, Oleg Krupnov wrote: I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread glenn andreas
On Dec 19, 2008, at 12:24 PM, Jean-Nicolas Jolivet wrote: Well after comparing the data that I am receiving with the data that I SHOULD be receiving, it turns out that dots (yes, the dot character (.) ) are added all over the place in the data if I have 10 extra bytes, it means 10

Re: Listening for changes

2008-12-19 Thread Andre Masse
Hmm.. Thought this would be easy but I'm stuck... Here's what I've done: - added the fake property BOOL needSaving @property(assign, nonatomic) BOOL needSaving; @synthesize needSaving; - implemented keyPathsForValuesAffecting (I'm on Leopard) +

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Jean-Nicolas Jolivet
I am indeed using NNTP, but really I'm not even looking at cr+lf etc... Basically I'm sending the following command to retrieve a message: ARTICLE message-id\r\n Then I'm reading all the data up until \r\n.\r\n is found (that is, a new line, a dot, and a new line again) which marks the

Re: Listening for changes

2008-12-19 Thread Keary Suska
On Dec 19, 2008, at 11:36 AM, Andre Masse wrote: Hmm.. Thought this would be easy but I'm stuck... Here's what I've done: - added the fake property BOOL needSaving @property(assign, nonatomic) BOOL needSaving; @synthesize needSaving; - implemented keyPathsForValuesAffecting (I'm on

Re: Listening for changes

2008-12-19 Thread Andre Masse
Thanks for the explanation. It just works :-) Andre Masse On Dec 19, 2008, at 13:51, Keary Suska wrote: As I understand this approach, it doesn't matter. All you should need to do is observe the fake property, and in the observeValueForKeyPath call do whatever you need to do. The +

NSLog ??

2008-12-19 Thread Phil Hystad
Why can't I find any reference page for NSLog? I believe I have searched all over all documentation that I have and the closest match is NSLogicalTest. I even tried a search using Spotlight on my entire system. I was able to find a usage of NSLog in a program but no documentation hits.

Re: NSLog ??

2008-12-19 Thread Dave Carrigan
On Dec 19, 2008, at 11:18 AM, Phil Hystad wrote: Why can't I find any reference page for NSLog? I believe I have searched all over all documentation that I have and the closest match is NSLogicalTest. I even tried a search using Spotlight on my entire system. I was able to find a

Re: NSLog ??

2008-12-19 Thread Eric Gorr
On Dec 19, 2008, at 2:18 PM, Phil Hystad wrote: Why can't I find any reference page for NSLog? I believe I have searched all over all documentation that I have and the closest match is NSLogicalTest. I even tried a search using Spotlight on my entire system. I was able to find a usage

[Fwd: Re: [Q] How to let the pasteboard know a file type?]

2008-12-19 Thread JongAm Park
Because my previoius post contains extra href link, it was not readable. So, I am posting it by removing all format. Original Message Hello. I found out that NSCreateFilenamePboardType() would help. So, I tried it like : My code example is : In awakeFromNib NSString

Re: NSLog ??

2008-12-19 Thread Nathan Kinsinger
On Dec 19, 2008, at 12:18 PM, Phil Hystad wrote: Why can't I find any reference page for NSLog? I believe I have searched all over all documentation that I have and the closest match is NSLogicalTest. I even tried a search using Spotlight on my entire system. I was able to find a

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread Andrew Farmer
On 19 Dec 08, at 10:24, Jean-Nicolas Jolivet wrote: Well after comparing the data that I am receiving with the data that I SHOULD be receiving, it turns out that dots (yes, the dot character (.) ) are added all over the place in the data if I have 10 extra bytes, it means 10 extra dots

Re: NSData downloaded over socket is bigger than it should be...

2008-12-19 Thread jonat...@mugginsoft.com
On 19 Dec 2008, at 18:43, Jean-Nicolas Jolivet wrote: I am indeed using NNTP, but really I'm not even looking at cr+lf etc... Basically I'm sending the following command to retrieve a message: ARTICLE message-id\r\n Then I'm reading all the data up until \r\n.\r\n is found (that

Re: NSLog ??

2008-12-19 Thread Andy Lee
On Dec 19, 2008, at 2:18 PM, Phil Hystad wrote: Why can't I find any reference page for NSLog? In addition to the search methods others have suggested, you could also Google for nslog site:developer.apple.com, which works really well for searching for Cocoa info in general. In addition,

populate/resize an already open NSMenu in background

2008-12-19 Thread Martin Wierschin
Hi everyone, I have a menu that needs to be populated on demand, so I've set an NSMenu delegate and note the update request in menuNeedsUpdate:. The problem is that populating the menu can take quite a while, so results need to be generated in the background and then added as they come

Determining width of a cell in an NSOutlineView

2008-12-19 Thread Eric Gorr
I only have a single column in my NSOutlineView. The outline view looks like: Collapsible Row 1 Item 1 Collapsible Row 2 Item 2 I need the height of a row an of an item displayed when the disclosure triangle is clicked to be based on the width of the cell. I can get the

Re: Determining width of a cell in an NSOutlineView

2008-12-19 Thread Corbin Dunn
On Dec 19, 2008, at 1:35 PM, Eric Gorr wrote: I only have a single column in my NSOutlineView. The outline view looks like: Collapsible Row 1 Item 1 Collapsible Row 2 Item 2 I need the height of a row an of an item displayed when the disclosure triangle is clicked to be based on

Re: Cocoa Apple Script Problem

2008-12-19 Thread john
Hi John- If you are on Leopard, try taking a look at the documentation for the following method: - (id)newScriptingObjectOfClass:(Class)class forValueForKey:(NSString *)key withContentsValue:(id)contentsValue properties:(NSDictionary *)properties; The Cocoa Scripting Guide refers to the Leopard

Re: Determining width of a cell in an NSOutlineView

2008-12-19 Thread Eric Gorr
On Dec 19, 2008, at 5:20 PM, Corbin Dunn wrote: On Dec 19, 2008, at 1:35 PM, Eric Gorr wrote: I only have a single column in my NSOutlineView. The outline view looks like: Collapsible Row 1 Item 1 Collapsible Row 2 Item 2 I need the height of a row an of an item displayed when the

[Q] How will the Pasteboard manager be changed?

2008-12-19 Thread JongAm Park
Hello. I'm implementing some logic to enable drag from my application's NSTableView and drop on the Final Cut Pro's project. I found out that it was not possible with NSFilenamesPboardType. When I compared it a dragdrop from the Finder to the FCP, the one between the Finder and the FCP

Re: [Q] How will the Pasteboard manager be changed?

2008-12-19 Thread Jim Correia
On Dec 19, 2008, at 5:39 PM, JongAm Park wrote: So, can anyone tell me how the Carbon's pasteboard manager will change, and why Cocoa's pasteboard manager doesn't reveal some methods which handles flavors easily? Probably flavors are being deprecated also? ( Although there should be some

Re: Determining width of a cell in an NSOutlineView

2008-12-19 Thread Corbin Dunn
On Dec 19, 2008, at 2:30 PM, Eric Gorr wrote: On Dec 19, 2008, at 5:20 PM, Corbin Dunn wrote: On Dec 19, 2008, at 1:35 PM, Eric Gorr wrote: I only have a single column in my NSOutlineView. The outline view looks like: Collapsible Row 1 Item 1 Collapsible Row 2 Item 2 I need the

Re: Optimizing NSRectFill

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 2:37 am, Oleg Krupnov wrote: I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the

Re: Optimizing NSRectFill

2008-12-19 Thread Peter Ammon
On Dec 19, 2008, at 7:37 AM, Oleg Krupnov wrote: I'm developing a custom view and noticed that drawRect is becoming increasingly slow. The Shark has pointed out that the bottleneck is the NSRectFill function (that calls CGContextFillRect under the hood) that I use to draw the background of the

Re: populate/resize an already open NSMenu in background

2008-12-19 Thread Peter Ammon
On Dec 19, 2008, at 1:21 PM, Martin Wierschin wrote: Hi everyone, I have a menu that needs to be populated on demand, so I've set an NSMenu delegate and note the update request in menuNeedsUpdate:. The problem is that populating the menu can take quite a while, so results need to be

Re: [Q] How will the Pasteboard manager be changed?

2008-12-19 Thread JongAm Park
Thanks for your comment. Although the AppKit supports UTIs, but I couldn't find a way to generate pasteboard type for 'hfs'. So, probably for this, I think Carbon functions should be used. There are only two functions in the AppKit for making file type specific Pboard :

NSTextList - need help

2008-12-19 Thread rethish
hi all, I would like to use bullets and numberings in the textview . I found some of search results for this topic ,they were about NSTextList . How can it be implemented. please provide me some help on NSTextList. thank you Regards.. rethish

Re: Enabling add button

2008-12-19 Thread Mark
I did something like this once. I'm not sure if this is a good way to tackle the problem or not but here's what you need: - A BOOL ivar exposed as a property on one of your controllers: BOOL isTableViewSelected; @property(assign) BOOL isTableViewSelected; @synthesize isTableViewSelected;

Core Data File Encryption

2008-12-19 Thread Chris Benedict
Hello, I'm just beginning to learn Cocoa programming and I'm having some trouble figuring out how to encrypt a persistent data store transparently. I'm trying to write a Core Data (not document based) application and it needs to store the data in a file encrypted with AES. I found out

Re: NSTreeController rearrangeObjects doesn't always trigger sorting

2008-12-19 Thread Jonathan Fewtrell
I'm pleased to see that this has been fixed in 10.5.6 and it's all sorting properly again. Many thanks to Apple's engineers for this. On 4 Oct 2008, at 12:57, Alexey Zakhlestin wrote: I see this behaviour since 10.5.3. (10.5.2 was ok) My solution is manual re-sorting, for now. On Tue, Jul

Newbie Question: implementing a stack

2008-12-19 Thread Steve Wetzel
Hi All, I am new to this list and new to mac programming as well. I am working on implementing a stack as a category of NSMutableArray. I want this stack to be able to store objects. This is what I have so far: // // Stack.h // Stack implements a basic stack object in an

Re: [Q] How will the Pasteboard manager be changed?

2008-12-19 Thread Jim Correia
On Dec 19, 2008, at 6:59 PM, JongAm Park wrote: Although the AppKit supports UTIs, but I couldn't find a way to generate pasteboard type for 'hfs'. So, probably for this, I think Carbon functions should be used. I previously offered a solution for this problem. I wrote: If you have

Drawing in a NSView out side of drawRect

2008-12-19 Thread David Alter
I want to draw in a NSView but not when drawRect is called. To do this I understand that I need to call lockFocus before drawing and unlockFocus after. The drawing appears to happen but it is not until I deactivate the window do I see my results. How can I get it to refresh once I have done my

Re: Listening for changes

2008-12-19 Thread Mike Abdullah
Since you apparently want to just know that one of the fields changed, but not which one specifically, why not just have the class post an NSNotification called MyClassDidChange or similar? Mike. On 19 Dec 2008, at 17:06, Andre Masse wrote: Let's say I have a class (called it Client) that

Re: Newbie Question: implementing a stack

2008-12-19 Thread Ricky Sharp
On Dec 19, 2008, at 1:22 PM, Steve Wetzel wrote: I am new to this list and new to mac programming as well. I am working on implementing a stack as a category of NSMutableArray. I want this stack to be able to store objects. This is what I have so far: // // Stack.h // Stack

Using NSURL authentication APIs for non-standard protocols

2008-12-19 Thread Mike Abdullah
Has anyone had much luck using the NSURL authentication APIs for anything outside of http, https, ftp and ftps? The first problem I ran into is that when creating an NSURLProtectionSpace object, specifying ftp as the protocol gets converted to ftps. Likewise, trying to use ssh - http or

Re: Drawing in a NSView out side of drawRect

2008-12-19 Thread Ricky Sharp
On Dec 19, 2008, at 6:20 PM, David Alter wrote: I want to draw in a NSView but not when drawRect is called. To do this I understand that I need to call lockFocus before drawing and unlockFocus after. The drawing appears to happen but it is not until I deactivate the window do I see my

Using runtime functions to match up object types safely when setting properties

2008-12-19 Thread Graham Cox
In my app, I have an interface and code that allows the user to set up different values that can be set as properties of an object. The user is presented with a list of properties that can be set (suitably converted for display in the UI) and then they can set up the values of these

Re: Drawing in a NSView out side of drawRect

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 11:20 am, David Alter wrote: I want to draw in a NSView but not when drawRect is called. Why? There are very few situations when this is required or appropriate. To do this I understand that I need to call lockFocus before drawing and unlockFocus after. The drawing

Re: Using runtime functions to match up object types safely when setting properties

2008-12-19 Thread Ken Thomases
On Dec 19, 2008, at 6:53 PM, Graham Cox wrote: In my app, I have an interface and code that allows the user to set up different values that can be set as properties of an object. The user is presented with a list of properties that can be set (suitably converted for display in the UI) and

Re: Using runtime functions to match up object types safely when setting properties

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 2:28 pm, Ken Thomases wrote: First of all, are you familiar with Key-Value Validation? http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html So I'm looking for a way to safely and reliably determine whether a property will

Re: Newbie Question: implementing a stack

2008-12-19 Thread Steve Wetzel
On Dec 19, 2008, at Dec 19:6:31 PM, Ricky Sharp wrote: On Dec 19, 2008, at 1:22 PM, Steve Wetzel wrote: I am new to this list and new to mac programming as well. I am working on implementing a stack as a category of NSMutableArray. I want this stack to be able to store objects. This is

Re: Drawing in a NSView out side of drawRect

2008-12-19 Thread Michael Ash
On Fri, Dec 19, 2008 at 7:20 PM, David Alter alterconsult...@gmail.com wrote: I want to draw in a NSView but not when drawRect is called. Others have pointed this out, but I want to reiterate: no you don't. Trying to draw outside of drawRect: will only lead to pain. (It is useful, on rare

Re: getObjects:andKeys

2008-12-19 Thread chaitanya pandit
Jordon, this can be used to create copies of a dictionary, you get the keys and values array with getObjects:andKeys on an existing dictionary and iterate through the keys array and setting the same keys and values for a mutable dict. On 17-Dec-08, at 7:06 PM, Jordon Hirshon wrote: Can

Re: getObjects:andKeys

2008-12-19 Thread Michael Ash
On Sat, Dec 20, 2008 at 12:20 AM, chaitanya pandit chaita...@expersis.com wrote: Jordon, this can be used to create copies of a dictionary, you get the keys and values array with getObjects:andKeys on an existing dictionary and iterate through the keys array and setting the same keys and

Re: getObjects:andKeys

2008-12-19 Thread chaitanya pandit
Hehe, i know, but he just wanted an example as to what can be done with getObjects:andKeys. This was focused on using the getObjects... method rather than to create a copy of the dict. On 20-Dec-08, at 10:56 AM, Michael Ash wrote: On Sat, Dec 20, 2008 at 12:20 AM, chaitanya pandit

Re: Newbie Question: implementing a stack

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 3:15 pm, Steve Wetzel wrote: Regarding memory management - does it make more sense to copy the object to be pushed from within the Stack object rather then copying it externally before the push call? I am thinking that it does because then that object is encapsulated

Re: Newbie Question: implementing a stack

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 4:52 pm, Graham Cox wrote: On 20 Dec 2008, at 3:15 pm, Steve Wetzel wrote: Regarding memory management - does it make more sense to copy the object to be pushed from within the Stack object rather then copying it externally before the push call? I am thinking that it