Xcode editor question

2008-04-10 Thread Valentin Dan
Hi,

 

Is there any way I can add “custom colouring”  in the editor ? (for instance if 
I want all NSClasses to be coloured differently)

 

Thanks!

 

___

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

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

Masstech Group Inc.  Fax:+40 256-220912

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

 

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

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.11/1368 - Release Date: 09.04.2008 
16:20
 
___

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]


Can I record video in iPhone?

2008-04-10 Thread Jason Guo
Dear all:
 Any dev guide or sample code for recording video in iPhone?

Many Thanks.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: core data and IB outlet binding

2008-04-10 Thread Torsten Curdt


On Apr 9, 2008, at 17:45, Mike R. Manzano wrote:
Are you sure you're calling applyFilter after or during  
awakeFromNib? i.e., you're not calling applyFilter in some sort of - 
init, right?


No, see the IBAction ...it's bound to a button and it only gets called  
when I press the button.


cheers
--
Torsten
___

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 and IB outlet binding

2008-04-10 Thread Torsten Curdt

Is you outlet actually connected in IB? If it is properly connected,
it
shouldn't be nil.


Yeah ...that's connected. Which is why I am so surprised it's nil.


Well, AFAIK it's not possible for an outlet to be nil, as long as  
the object

with the outlet is instantiated in the nib or is the file's owner.
Otherwise, the outlet will never be set.

Have you put an NSLog in the object's awakeFromNib to make sure your  
object

is involved in the nib and the outlet is being set?


Here is a small screenshot of the bindings

 http://vafer.org/pub/bindings.png

As the button binding is working so should the NSTextField  
binding ...one would think.
But just to verify I've also added the awakeFromNib. As expected it  
also gets called.


Is there a way to get more information on the NIB startup?

cheers
--
Torsten
___

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]


Capture youtube image in webview

2008-04-10 Thread Xin

Hello,

First, sorry for my english, I'm a catalan.

Well, I'm a newbee in Mac and Cocoa and I have tried to make an  
application for capture an image of web. It's all ok. My app work  
correctly, except when I capture a module of vídeo. In this cases the  
result is wrongly. How you can see in this image of a video in  
youtube.com:

- http://img238.imageshack.us/img238/5626/capturaxq0.png

The static page is correctly captured, but the video in youtube no. Do  
you know what is the problem?


This is my code:

NSRect  frame = [theView frame];
	NSBitmapImageRep	*rep = [theView  
bitmapImageRepForCachingDisplayInRect:frame];

[theView cacheDisplayInRect:frame toBitmapImageRep:rep];
	NSData			*data = [rep representationUsingType:NSTIFFFileType  
properties:nil];


NSImage *image = [[NSImage alloc] initWithSize:[rep size]];
[image addRepresentation:rep];
[but setImage:image];

Thanks for all

Xin___

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 and IB outlet binding

2008-04-10 Thread Torsten Curdt


On Apr 10, 2008, at 10:00, Torsten Curdt wrote:
Is you outlet actually connected in IB? If it is properly  
connected,

it
shouldn't be nil.


Yeah ...that's connected. Which is why I am so surprised it's nil.


Well, AFAIK it's not possible for an outlet to be nil, as long as  
the object

with the outlet is instantiated in the nib or is the file's owner.
Otherwise, the outlet will never be set.

Have you put an NSLog in the object's awakeFromNib to make sure  
your object

is involved in the nib and the outlet is being set?


Here is a small screenshot of the bindings

http://vafer.org/pub/bindings.png

As the button binding is working so should the NSTextField  
binding ...one would think.
But just to verify I've also added the awakeFromNib. As expected it  
also gets called.


Is there a way to get more information on the NIB startup?


I did get to the correct Core Data value via representedObject

- (IBAction) applyFilter:(id)sender
{
NSString *expression = [[self representedObject] Expression];

...but that still doesn't really help with the normal bindings :-(

cheers
--
Torsten
___

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: Highlight color of a NSTableView row

2008-04-10 Thread Cathy Shive
If you're targeting Leopard, there is an NSTableView method you can  
override for this (a public one!)


-(void)highlightSelectionInClipRect:(NSRect)theClipRect

You have to actually draw the highlights, it's not simply a matter of  
setting the color.  If you look at the post Ben linked to, there is  
sample code you can download that will show you what to do.


If you're targeting anything before Leopard, you can do the same, but  
there is the issue that the table view is going to draw over your  
drawing anyway.  This is the weirdest bug ever in my opinion. This is  
also discussed in the post and later in the comments by John.


Hopefully, you're just dealing with Leopard and you can avoid the  
ugliness of this bug.


Good luck!
Cathy


On Apr 10, 2008, at 7:55 AM, Ben Lachman wrote:


Look at:

http://katidev.com/blog/2008/02/22/styling-an-nstableview-dttah/

but make sure you read the comments.  John Randolph's comments are  
worth considering.


->Ben

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009



On Apr 10, 2008, at 12:27 AM, Eric Gorr wrote:
I've got a NSTableView and when I select a row, it is highlighted  
with the color specified in the Appearance System Preference panel.


Is there a way to take control over what color gets used to  
highlight a row when selected?


I need to be able to set the highlight color used based on what  
row in the table is selected.

___

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/catshive%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Xcode editor question

2008-04-10 Thread Mike Abdullah

You want the Xcode mailing list, not cocoa-dev.

On 10 Apr 2008, at 08:01, Valentin Dan wrote:


Hi,



Is there any way I can add “custom colouring”  in the editor ? (for  
instance if I want all NSClasses to be coloured differently)




Thanks!



___

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


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


Masstech Group Inc.  Fax:+40  
256-220912


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



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









No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.11/1368 - Release Date:  
09.04.2008 16:20


___

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]


NSString value mangled in NSDictionary with Garbage Collection

2008-04-10 Thread Jason Kravitz
I created a while loop where I am reading through a text file and pulling
out certain words based on RegEx criteria. I want to add these words as a
comma separated list under different keys in an NSMutableDictionary. I've
created a simplified psuedo-code representation of what I'm trying to do as
it may make it clearer and potentially expose what I'm doing wrong (see
below).

I am running with Garbage Collection set to "Required" (I also tested
Supported with the same behavior and turning it off crashes my program).

I loop through the text and pass each sentence to a function which pulls out
different RegEx matched words. I used StringWithFormat in this function to
build the comma separated list of words (not sure if that affects why it is
getting freed early as I thought StringWithFormat would ensure an
autoreleased string?) which are returned to the function that loops through
the text file. This function adds the return string to the dictionary using
setObjectForKey.

Occasionally, my strings get mangled several iterations through the loop so
when I call objectForKey, I get strings like "Ø«˝˛_˛˛@" instead of the
comma separated list. If I watch it in the debugger, I can see where one
iteration, the string is correct and then the next loop through, it is
mangled.

This does not happen every time, I can go through for several passes of the
text file without any words getting mangled and then randomly it happens
again.

Here is a simplified illustration of what I'm doing - if there is a better
way to organize this (perhaps store value as array and not string?) I am
open to trying anything or if I'm doing something blatantly wrong that is
messing up memory, I'd like to learn how to do it correctly.

thanks!

NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:1];

while ([scanner isAtEnd] == NO)
{
NSString *sentence = @"a big long sentence of words from scanner... ";
NSString *words = [obj functionThatReturnsString:sentence];

[dict setObject:words forKey:@"some key"];

// in real program, scanner keeps looping and sentence is changing...

}


// function that returns string
-(NSString *)functionThatReturnsString:(NSString *)text
{
NSString *returnstring = @"";

// pick some words out of text
// lets say we loop and get regEx matches and each match we add to
return string
while (loop_matching_pattern) {
// found pattern and put in string "matched", add to return string
returnstring = [NSString stringWithFormat:@
"%@,%@",returnstring,matched];
}

return returnstring;
}
___

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: Override AppleScrollBarVariant on NSScroller?

2008-04-10 Thread slasktrattenator
Thanks Mike, adding a default to NSArgumentDomain (i.e. by passing
{"-AppleScrollBarVariant", "Single"} to the executable on launch) did
the trick.

On Thu, Apr 10, 2008 at 1:24 AM, Mike Abdullah
<[EMAIL PROTECTED]> wrote:
> I believe one normally does this system-wide via the user defaults. I
> suspect that setting such a default for your app only may do the trick. Not
> that I've actually tested it - try it and see! :)
>
>
>
>  On 9 Apr 2008, at 23:12, [EMAIL PROTECTED] wrote:
>
>
> >
> >
> >
> > Hi,
> >
> > I'm looking for a way to override the user's AppleScrollBarVariant
> > setting, and force the arrows on my custom NSScroller to be displayed
> > at both ends of the scroller. The documentation has no mentioning of
> > this. Does anyone know if this is possible?
> >
> > Thanks.
> > F.
> > ___
> >
> > 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: Capture youtube image in webview

2008-04-10 Thread Chris Ryland

On Apr 10, 2008, at 5:24 AM, Xin wrote:


First, sorry for my english, I'm a catalan.

Well, I'm a newbee in Mac and Cocoa and I have tried to make an  
application for capture an image of web. It's all ok. My app work  
correctly, except when I capture a module of vídeo. In this cases  
the result is wrongly. How you can see in this image of a video in  
youtube.com:

- http://img238.imageshack.us/img238/5626/capturaxq0.png

The static page is correctly captured, but the video in youtube no.  
Do you know what is the problem?


Video (Quicktime, Flash, etc.) is usually done directly on a graphics  
card texture for efficiency, and thus you can't capture it this way.


You may have to resort to the Carbon-level window manager calls, which  
read back from the window server (see Son of Grab sample under 10.5).


Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Capture youtube image in webview

2008-04-10 Thread João Pavão

Hi Xin,

Take a look at this thread in the webkit mailing list: .


I implemented what was suggested in that thread and it worked out very  
well. I also added a very small delay before actually trying to  
capture the WebView so that the flash content has time to at least  
display some content.


Unfortunately, our resulting implementation is proprietary source code  
not owned by me, but I'll be happy to help with any further questions  
you may have.


--
João Pavão



On 2008/04/10, at 10:24, Xin wrote:

Hello,

First, sorry for my english, I'm a catalan.

Well, I'm a newbee in Mac and Cocoa and I have tried to make an  
application for capture an image of web. It's all ok. My app work  
correctly, except when I capture a module of vídeo. In this cases  
the result is wrongly. How you can see in this image of a video in  
youtube.com:

- http://img238.imageshack.us/img238/5626/capturaxq0.png

The static page is correctly captured, but the video in youtube no.  
Do you know what is the problem?


This is my code:

NSRect  frame = [theView frame];
	NSBitmapImageRep	*rep = [theView  
bitmapImageRepForCachingDisplayInRect:frame];

[theView cacheDisplayInRect:frame toBitmapImageRep:rep];
	NSData			*data = [rep representationUsingType:NSTIFFFileType  
properties:nil];


NSImage *image = [[NSImage alloc] initWithSize:[rep size]];
[image addRepresentation:rep];
[but setImage:image];

Thanks for all

Xin___

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/jpavao-lists%40sericaia.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: some questions about creating image thumbnails

2008-04-10 Thread Jesse Grosjean

Ben and others thank you.

Through that link I found CGImageSourceCreateThumbnailAtIndex, which  
looks like it might be just what I need.


Jesse
___

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]


NSURLConnection doesn't post

2008-04-10 Thread Micha Fuhrmann

Hi there,

I'm running into a problem with NSURLConnection and I can't solve it,  
any help greatly appreciated.


in my main (Shared Instance) class i have the following code to post  
crash logs:


- (IBAction)test:(id)sender{

[self sendLogs];
}

- (void)sendLogs
{
NSMutableString* logsPath = [[NSMutableString alloc]init];
[logsPath appendString:[[NSBundle mainBundle]bundlePath]];
[logsPath appendString:@"/Contents/logs/"];
NSDate *currentDate = [NSDate date];
	NSString * theTime = [[currentDate dateWithCalendarFormat:@"%Y-%m-%d  
%H:%M:%S" timeZone:[NSTimeZone localTimeZone]]description];

NSFileManager *manager = [NSFileManager defaultManager];
bool doesTheLogsFolderExist = [manager fileExistsAtPath:logsPath];
NSMutableString * theDate = [[NSMutableString alloc]init];
[theDate appendString:@"error_"];
	[theDate appendString:[[currentDate dateWithCalendarFormat:@"%d_%m_ 
%Y" timeZone:[NSTimeZone localTimeZone]]description]];

[theDate appendString:@".log"];
[logsPath appendString:theDate];
	NSString* theXmlAsString = [NSString  
stringWithContentsOfFile:logsPath encoding:NSUTF8StringEncoding  
error:NULL];
	NSXMLDocument* theLogsXmlData = [[NSXMLDocument alloc]  
initWithXMLString:theXmlAsString options:NSXMLDocumentTidyHTML  
error:nil];
	NSString* content = [@"xmlData=" stringByAppendingString: 
[theLogsXmlData XMLString]];
	NSURL* url = [NSURL URLWithString:@"http://www.theappstore.net/support/logs_reports.php 
"];
	NSMutableURLRequest* urlRequest = [[NSMutableURLRequest alloc]  
initWithURL:url];

[urlRequest setHTTPMethod:@"POST"];
	[urlRequest setHTTPBody:[content  
dataUsingEncoding:NSUTF8StringEncoding]];
	NSURLConnection *connectionResponse = [[NSURLConnection alloc]  
initWithRequest:urlRequest delegate:self];

}

- (void)connection:(NSURLConnection *)connection didReceiveData: 
(NSData *)data


{
	NSString* thhhe = [[NSString alloc]initWithData:data  
encoding:NSASCIIStringEncoding];

}

Now if I place a button on my interface and call test everything is  
fine, the post is submitted and the delegate method is called. Suffice  
I call the test method from another class and nothing gets posted  
(break points show me the sendLogs method is indeed called), the  
didReceiveData method is not called either. I've looked into adding  
the NSURLConnection into an array so it wouldn't be scraped, created a  
separate send class just for the post etc. to no avail, I really don't  
know what I'm doing wrong.


Any help very much appreciated.

Micha
___

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: Capture youtube image in webview

2008-04-10 Thread John Joyce

You  may need to try a different method.
The keyboard shortcuts for taking screenshots, as well as the bundled  
application Grab, are both capable of making an image that includes  
flash video in a web view.

You might simply do it with AppleScript...
___

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]


networking question

2008-04-10 Thread Valentin Dan
Hi,

 

What’s the best way to create a connection to a server in Cocoa + Objective-C ?

 

Is there another way than BSD sockets or CFSocketRef ?

 

___

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

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

Masstech Group Inc.  Fax:+40 256-220912

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

 

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

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.11/1368 - Release Date: 09.04.2008 
16:20
 
___

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: networking question

2008-04-10 Thread Alastair Houghton

On 10 Apr 2008, at 14:24, Valentin Dan wrote:

What’s the best way to create a connection to a server in Cocoa +  
Objective-C ?


It depends what you're trying to achieve.

If your server is also implemented using Cocoa/ObjC, Distributed  
Objects is quite a nice solution.  Or you could use SOAP (e.g. via the  
WebServices framework).  Or you could use any of the things listed here:


  

Or you could use sockets via NSStream (or CFStream).  Or indeed  
NSURLConnection et al.


There are probably lots of other ways too, but it really depends on  
what you're doing.  You'll have to be more specific about what you  
want if you want a more specific answer.


Kind regards,

Alastair.

--
http://alastairs-place.net


___

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: NSURLConnection doesn't post

2008-04-10 Thread Michael Vannorsdel
Maybe a shot in the dark, but setting self as delegate, are you sure  
self is the correct object if called from other objects (self is not  
the calling object)?



On Apr 10, 2008, at 6:27 AM, Micha Fuhrmann wrote:

Now if I place a button on my interface and call test everything is  
fine, the post is submitted and the delegate method is called.  
Suffice I call the test method from another class and nothing gets  
posted (break points show me the sendLogs method is indeed called),  
the didReceiveData method is not called either. I've looked into  
adding the NSURLConnection into an array so it wouldn't be scraped,  
created a separate send class just for the post etc. to no avail, I  
really don't know what I'm doing wrong.


Any help very much appreciated.


___

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: NSURLConnection doesn't post

2008-04-10 Thread Michael Vannorsdel
Also, this method may be called multiple times with only a fragment of  
the data each time.



On Apr 10, 2008, at 6:27 AM, Micha Fuhrmann wrote:

- (void)connection:(NSURLConnection *)connection didReceiveData: 
(NSData *)data


{
	NSString* thhhe = [[NSString alloc]initWithData:data  
encoding:NSASCIIStringEncoding];

}


___

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: NSURLConnection doesn't post

2008-04-10 Thread Micha Fuhrmann
Yes, I've tried that too, I've set the delegate to be my shared  
instance.


Micha
On 10 avr. 08, at 15:57, Michael Vannorsdel wrote:

Maybe a shot in the dark, but setting self as delegate, are you sure  
self is the correct object if called from other objects (self is not  
the calling object)?



On Apr 10, 2008, at 6:27 AM, Micha Fuhrmann wrote:

Now if I place a button on my interface and call test everything is  
fine, the post is submitted and the delegate method is called.  
Suffice I call the test method from another class and nothing gets  
posted (break points show me the sendLogs method is indeed called),  
the didReceiveData method is not called either. I've looked into  
adding the NSURLConnection into an array so it wouldn't be scraped,  
created a separate send class just for the post etc. to no avail, I  
really don't know what I'm doing wrong.


Any help very much appreciated.


___

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/michaf%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: NSURLConnection doesn't post

2008-04-10 Thread Micha Fuhrmann
Correct, however it doesn't get called even once, the only answer I've  
set from the server right now is an OK string.


Micha
On 10 avr. 08, at 15:59, Michael Vannorsdel wrote:

Also, this method may be called multiple times with only a fragment  
of the data each time.



On Apr 10, 2008, at 6:27 AM, Micha Fuhrmann wrote:

- (void)connection:(NSURLConnection *)connection didReceiveData: 
(NSData *)data


{
	NSString* thhhe = [[NSString alloc]initWithData:data  
encoding:NSASCIIStringEncoding];

}


___

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/michaf%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: networking question

2008-04-10 Thread Valentin Dan

Hi,

A few more details :)

- server: Windows (so absolutely not Cocoa)
- communication : XML messages (need to both send & receive messages)

___
Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   
Email: [EMAIL PROTECTED] Office: +40 356-710158
Masstech Group Inc.  Fax:+40 256-220912
http://www.masstechgroup.com 
 
THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.
 
 
-Original Message-
From: Alastair Houghton [mailto:[EMAIL PROTECTED] 
Sent: 10 aprilie 2008 16:52
To: Valentin Dan
Cc: cocoa-dev@lists.apple.com
Subject: Re: networking question

On 10 Apr 2008, at 14:24, Valentin Dan wrote:

> What’s the best way to create a connection to a server in Cocoa +  
> Objective-C ?

It depends what you're trying to achieve.

If your server is also implemented using Cocoa/ObjC, Distributed  
Objects is quite a nice solution.  Or you could use SOAP (e.g. via the  
WebServices framework).  Or you could use any of the things listed here:

   

Or you could use sockets via NSStream (or CFStream).  Or indeed  
NSURLConnection et al.

There are probably lots of other ways too, but it really depends on  
what you're doing.  You'll have to be more specific about what you  
want if you want a more specific answer.

Kind regards,

Alastair.

--
http://alastairs-place.net



No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.11/1368 - Release Date: 09.04.2008 
16:20
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.11/1368 - Release Date: 09.04.2008 
16:20
 
___

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: networking question

2008-04-10 Thread Alastair Houghton

On 10 Apr 2008, at 15:22, Valentin Dan wrote:


A few more details :)

- server: Windows (so absolutely not Cocoa)

- communication : XML messages (need to both send & receive messages)


What kind of XML messages?  Over what kind of transport?  HTTP?   
Something else?  XML on its own is just a data format, not a  
communication protocol.


If you're talking XML-RPC, then the ObjectLibraryNetwork page on  
CocoaDev has a pointer to an implementation.  If it's raw XML with no  
encapsulation or with custom encapsulation you may want to use one of  
the stream classes.  If it's XML over HTTP (but not XML-RPC or SOAP),  
NSURLConnection et al. will probably work for you.  If it's SOAP,  
check out the WebServices framework.


Unless you're using a standard protocol like XML-RPC or SOAP, you most  
likely won't find a perfect match for what you're trying to do.  But  
there are lots of things, both in the standard frameworks and  
available separately under various Open Source licenses that can help  
you.


Kind regards,

Alastair.

--
http://alastairs-place.net


___

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: Tips to deploy applications to multiple Mac OS X versions

2008-04-10 Thread Steve Christensen

On Apr 9, 2008, at 11:08 PM, Ben Lachman wrote:

On Apr 9, 2008, at 3:27 PM, David Duncan wrote:

On Apr 9, 2008, at 7:43 AM, Lorenzo Bevilacqua wrote:

I'm trying to build a Cocoa application so that it can run on Mac  
OS X from version 10.3.9 to 10.5.
I have 10.5 installed so the application runs fine on my system  
and on other Leopard systems.
I haven't build a project for multiple platforms yet, so I tried  
to duplicate the main Xcode target and set different deployment  
target settings like


Typically you would only use 1 target. Use the SDK to the OS whose  
API your are targeting (such as the 10.5 SDK). Then set the  
deployment target to the minimum version you wish to run on  
(example, 10.3). Finally, you would do runtime checks for API  
availability.


This is totally true.  Multiple binaries make unhappy users. Of  
course buggy cross-version binaries make unhappy users too.


- Is there a way to differentiate part of code by platform? I  
remember I saw in some files lines like this


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4
#endif

is this correct?


This is a compile time check. Generally it is appropriate if you  
plan to ship a binary with a specific compile-time dependency. It  
sounds like you really want a run time check, which requires you  
to check for the availability of the features you are trying to  
use. How you check for this will depend on what you are doing to  
some degree.



To elaborate:

Your code will have checks like this in it:

if( [someObject respondsToSelector:@selector 
(niftyLeopardFeatureMethod:)] )

[someObject niftyLeopardFeatureMethod:anotherObject];
else
// handle the 10.4 and/or 10.3.9 case


Actually, what I find to be a better arrangement is something like this:

#if MACOSX_DEPLOYMENT_TARGET < MAC_OS_X_VERSION_10_5
if (![someObject respondsToSelector:@selector 
(niftyLeopardFeatureMethod:)])

{
// handle the pre-10.5 case here
}
else
#endif
{
// handle the 10.5+ case here
}

Picky, perhaps, but the benefit is that the check for existence of a  
10.5 feature, plus the code that handles the older OS versions, is  
inside a compile-time conditional. If you later change your  
deployment target to 10.5, all the older OS pieces are compiled out.  
You can also easily search your sources for  
"MACOSX_DEPLOYMENT_TARGET" to find your legacy code.


One caveat, though, is that you should probably have a runtime check  
for the minimum OS version you expect so that you don't end up with a  
crash if someone tries to use your nifty Leopard features on Tiger.  
Adding something to main() would probably be easiest, either checking  
against NSAppKitVersionNumber or calling Gestalt() to get the OS  
version.


steve

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Can I record video in iPhone?

2008-04-10 Thread Ben Lachman

As always:

a) the iPhone SDK is under a NDA, so releasing sample code, and/or  
talking about any APIs is not allowed.


b) the iPhone doesn't natively support video in any of its released  
features/application so I'd guess this might not be the easiest thing  
to do.


->Ben

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009



On Apr 10, 2008, at 3:25 AM, Jason Guo wrote:

Dear all:
 Any dev guide or sample code for recording video in iPhone?

Many Thanks.
___

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

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

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


starter application

2008-04-10 Thread Gonzalo Castro
We have an application that needs to be launched by a shell script.  
To give the user dbl click launching of this app we created a starter  
application which, on launch, uses system() to call the shell script  
which then runs the main application.


The down side to this charade is that we see two bouncing app icons  
in the Dock during launch; first the starter application followed by  
the main application.


Any ideas how one application can launch another and yet show the  
user only one launch sequence in the Dock?


Gonzalo

___

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]


CoreAnimation in a modal window

2008-04-10 Thread Pierre Bernard

Hi!

I am trying to do some nice drawing using CoreAnimation. It all works  
fine, except for a long series of "CoreAnimation: rendering error 500"  
messages.


However, as soon as I try to use my window in the context of a modal  
session, only the background is draw. The actual animated layers are  
missing.


What am I doing wrong?

- (NSUInteger)beginModalWindow:(NSWindow *)modalWindow
{
NSModalSession currentModalWindowSession;

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowWillBeginModal:)]) {

[[modalWindow delegate] windowWillBeginModal:modalWindow];
}

[modalWindow makeKeyAndOrderFront:self];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowDidBeginModal:)]) {

[[modalWindow delegate] windowDidBeginModal:modalWindow];
}

	currentModalWindowSession = [NSApp  
beginModalSessionForWindow:modalWindow];


NSUInteger result = NSOKButton;

while(1) {
		NSInteger response = [NSApp  
runModalSession:currentModalWindowSession];


if (response == NSRunAbortedResponse) {
result = NSCancelButton;
}

if (response != NSRunContinuesResponse) {
break;
}
}

[NSApp endModalSession:currentModalWindowSession];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowWillEndModal:)]) {

[[modalWindow delegate] windowWillEndModal:modalWindow];
}

[modalWindow orderOut:self];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowDidEndModal:)]) {

[[modalWindow delegate] windowDidEndModal:modalWindow];
}

return result;
}

Best,
Pierre Bernard

---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com





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: starter application

2008-04-10 Thread Jean-Daniel Dupas


Le 10 avr. 08 à 17:33, Gonzalo Castro a écrit :

We have an application that needs to be launched by a shell script.  
To give the user dbl click launching of this app we created a  
starter application which, on launch, uses system() to call the  
shell script which then runs the main application.


The down side to this charade is that we see two bouncing app icons  
in the Dock during launch; first the starter application followed by  
the main application.


Any ideas how one application can launch another and yet show the  
user only one launch sequence in the Dock?


Gonzalo


Please search the archives. This topics was discussed yesterday and  
today…


http://www.cocoabuilder.com/archive/message/cocoa/2008/4/9/203738


___

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 and IB outlet binding

2008-04-10 Thread Keary Suska
on 4/10/08 4:30 AM, [EMAIL PROTECTED] purportedly said:

>> Here is a small screenshot of the bindings
>> 
>> http://vafer.org/pub/bindings.png
>> 
>> As the button binding is working so should the NSTextField  binding ...one
>> would think. But just to verify I've also added the awakeFromNib. As expected
>> it  also gets called.
>> 
>> Is there a way to get more information on the NIB startup?
> 
> I did get to the correct Core Data value via representedObject
> 
> - (IBAction) applyFilter:(id)sender
> {
>  NSString *expression = [[self representedObject] Expression];
> 
> ...but that still doesn't really help with the normal bindings :-(

Just to be clear, "binding" is a specific technology that has nothing to do
with outlet setting. Better to use proper terminology or suggestions may not
be correct.

Anyway, in your original post, you say:

> When the button is pressed it turns out that filterExpression (and
> therefor also the stringValue of it) is nil.

Are you certain that filterExpression is nil? Just because it's string value
is nil, doesn't mean the outlet is nil. It just means the field thinks that
it's empty. If it *isn't* nil, then make sure that the field editor has
committed changes. Remember that in the UI, when editing a text field, you
aren't editing the text field, but the field editor. Edits aren't normally
committed until either the field is exited or effected by certain binding
options (such as 'continuously updates value").

Best,

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: looking for sample code to read UUID from a disk volume.

2008-04-10 Thread Herb Petschauer
On 09/04/2008, Chris Suter <[EMAIL PROTECTED]> wrote:
>
>  On 10/04/2008, at 5:05 AM, Herb Petschauer wrote:
>
>
> > And note that only a GUID partition table scheme will yield partitions
> > with a UUID.  The old style Apple Partition Map will not (so any
> > legacy or even current PPC machines).
> >
>
>  No this is incorrect. Volumes have a UUID of their own and is different
> from the one used in the GUID partition map. Disk Utility displays the
> volume UUID. In HFS the UUID is not actually a proper UUID but is generated
> from 8 bytes in the Finder Info of the volume header. Have a look at the
> Darwin source code if you want to know how it's computed. I'm not sure how
> they're computed for other file-system types.

That's a good point.  When think volume UUID I always think of what I
can easily get from the ioregistry :-)  Thanks for the correction!

Cheers,
-H.
___

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: NSURLConnection doesn't post

2008-04-10 Thread Tom Harrington
On Thu, Apr 10, 2008 at 6:27 AM, Micha Fuhrmann <[EMAIL PROTECTED]> wrote:
>  Now if I place a button on my interface and call test everything is fine,
> the post is submitted and the delegate method is called. Suffice I call the
> test method from another class and nothing gets posted (break points show me
> the sendLogs method is indeed called), the didReceiveData method is not
> called either. I've looked into adding the NSURLConnection into an array so
> it wouldn't be scraped, created a separate send class just for the post etc.
> to no avail, I really don't know what I'm doing wrong.

When you call -sendLogs from another class, does the run loop have the
chance to run, or does the code block, or busy-wait, or something else
that might prevent it from running?  You'll need a working run loop
for NSURLConnection to successfully post the data and call its
delegate methods.

Also, is it possible that when -sendLogs is called from another class,
it's also called from a separate thread?  NSURLConnection's delegate
methods are called on the same thread that initiated the connection,
and if you've started a different thread, you have to create your own
run loop.

-- 
Tom Harrington
[EMAIL PROTECTED]
AIM: atomicbird1
___

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: [OFF] unicode characters

2008-04-10 Thread Petite Abeille


On Apr 9, 2008, at 8:14 PM, Alexander Cohen wrote:


ü = u
é = e

Anyone know of a way to do that or do i need a lookup table with all  
characters and their equivalents?


For, hmm, inspiration, take a look at Sean M. Burke's Unidecode:

http://interglacial.com/~sburke/tpj/as_html/tpj22.html

E.g.

print( Unidecode( 'Москва́' ) )

> Moskva

--
PA.
http://alt.textdrive.com/nanoki/___

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]


recursive dir searching

2008-04-10 Thread Wesley Smith
hi,
I've been trying to use
NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager]
enumeratorAtPath:dir];

to recursively search for a file in a given directory but am coming
across some minor details that I'm not sure what the best way to deal
with is.  There's a method  skipDescendents, which is described as
"Causes the receiver to skip recursion into the most recently obtained
subdirectory."  I'm finding this not to be what I thought it was.  For
example, for the layout:


Docs
   /Images
   /.svn
 [[ all of the svn junk ]]
   1.jpg
2.jpg

If I give @"docs" to the enumerator and let's say it is on images/.svn
and I call [dirEnum skipDescendents].  What actually happens is it
skips Images instead of only skipping .svn.  Is this intended
behavior??  How else can I ignore what are normally hidden subdirs.

thanks,
wes
___

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: CoreAnimation in a modal window

2008-04-10 Thread Dimitri Bouniol
That error indicates that the image stored for the layer is too large  
(because the layer itself is too large probably) for your graphics  
card to handle, and therefore won't be drawn. Consider using smaller  
layers, or take a look at CATiledLayer. Never tried it, but that's  
what NSScrollView uses when layer backing is requested, as to handle  
the large scrolling view as many smaller layers tiled to make it look  
as if it was all one large layer.


On Apr 10, 2008, at 8:33 AM, Pierre Bernard wrote:


Hi!

I am trying to do some nice drawing using CoreAnimation. It all  
works fine, except for a long series of "CoreAnimation: rendering  
error 500" messages.


However, as soon as I try to use my window in the context of a modal  
session, only the background is draw. The actual animated layers are  
missing.


What am I doing wrong?

- (NSUInteger)beginModalWindow:(NSWindow *)modalWindow
{
NSModalSession currentModalWindowSession;

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowWillBeginModal:)]) {

[[modalWindow delegate] windowWillBeginModal:modalWindow];
}

[modalWindow makeKeyAndOrderFront:self];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowDidBeginModal:)]) {

[[modalWindow delegate] windowDidBeginModal:modalWindow];
}

	currentModalWindowSession = [NSApp  
beginModalSessionForWindow:modalWindow];


NSUInteger result = NSOKButton;

while(1) {
		NSInteger response = [NSApp  
runModalSession:currentModalWindowSession];


if (response == NSRunAbortedResponse) {
result = NSCancelButton;
}

if (response != NSRunContinuesResponse) {
break;
}
}

[NSApp endModalSession:currentModalWindowSession];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowWillEndModal:)]) {

[[modalWindow delegate] windowWillEndModal:modalWindow];
}

[modalWindow orderOut:self];

	if ([[modalWindow delegate]  
respondsToSelector:@selector(windowDidEndModal:)]) {

[[modalWindow delegate] windowDidEndModal:modalWindow];
}

return result;
}

Best,
Pierre Bernard

---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com


--
定魅刀利
Dimitri Bouniol
[EMAIL PROTECTED]
http://web.mac.com/dimitri008/



___

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]


Tight loop processing

2008-04-10 Thread Don Arnel

Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to play  
around with Macs. I feel like a beginner all over again! Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest of  
the program while the simulation is running. When I was programming  
for Windows there was a call in Visual Basic (app.DoEvents()) which  
would process any pending events. You could put DoEvents() inside long  
loops to prevent blocking user input.  Is there a similar way to  
handle this in Cocoa?


Thanks for any help!
- Don
___

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: Tight loop processing

2008-04-10 Thread Stéphane


On Apr 10, 2008, at 8:00 PM, Don Arnel wrote:


Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to  
play around with Macs. I feel like a beginner all over again!  
Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.   
Is there a similar way to handle this in Cocoa?


Is using Threads not a possible solution?


___

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: Tight loop processing

2008-04-10 Thread Jamie Phelps
Maybe look into NSThread and see if it meets your needs. You'd run  
your loop in the thread and keep processing events like normal in the  
main thread.


(I'm still rather new to Cocoa myself, so I hope I'm not misleading  
you. The other list readers will correct me if I'm wrong.)


HTH,
Jamie

On Apr 10, 2008, at 1:00 PM, Don Arnel wrote:


Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to play  
around with Macs. I feel like a beginner all over again! Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.  Is  
there a similar way to handle this in Cocoa?


Thanks for any help!
- Don
___

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/jrphelps%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: Tight loop processing

2008-04-10 Thread Don Arnel
I thought maybe there was a simple message I could send to NSApp, but  
it looks like putting the loop in a new thread is the way to go.   
Thanks!



On Apr 10, 2008, at 2:06 PM, Jamie Phelps wrote:

Maybe look into NSThread and see if it meets your needs. You'd run  
your loop in the thread and keep processing events like normal in  
the main thread.


(I'm still rather new to Cocoa myself, so I hope I'm not misleading  
you. The other list readers will correct me if I'm wrong.)


HTH,
Jamie

On Apr 10, 2008, at 1:00 PM, Don Arnel wrote:


Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to  
play around with Macs. I feel like a beginner all over again!  
Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.   
Is there a similar way to handle this in Cocoa?


Thanks for any help!
- Don
___

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/jrphelps%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]


A simple Objective-C question

2008-04-10 Thread Rama Krishna
I am new to Objective-C but I have done C++/C#/Java work. I have been doing
some experiments to understand how the language works. I found that it is
not necessary for an Objective-C class to derive from Object. I was able to
create a class which did not derive from Object contrary to my assumption
that all Objective-C classes implicitly derive from Object (such as in C# or
Java).

 

However, such a class has a problem. It cannot be allocated or initialized.
Because it can never get the alloc message as the alloc message is declared
in the Object class. My question ,therefore, is how can such classes be
instantiated. Is there a library function for that? Surely, the standard
alloc function must be using such a function. Or should I just derive all
classes from Object.

___

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: Tight loop processing

2008-04-10 Thread Shawn Erickson
On Thu, Apr 10, 2008 at 11:14 AM, Don Arnel <[EMAIL PROTECTED]> wrote:
> I thought maybe there was a simple message I could send to NSApp, but it
> looks like putting the loop in a new thread is the way to go.  Thanks!

Likely throwing this loop off to an NSThread is the cleanest and most
efficient solution (allows UI to respond and the simulation to run
concurrently, most Macs are at least dual core these days).

You can inform your UI of work status, etc. by using -[NSObject
performSelectorOnMainThread:withObject:waitUntilDone:] since you
(normally) want to manipulate Cocoa UI on while running in the context
of the main thread.

You could attempt to run the work loop periodically in your simulation
loop if you don't want to use a secondary thread. Look at the docs for
NSRunLoop.

Also I suggest you review...


-Shawn
___

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: Tight loop processing

2008-04-10 Thread Michael Vannorsdel
There's NSRunLoop's runUntilDate: or CFRunLoopRunInMode if you'd like  
to avoid multithreading.  Though threading on Mac OS X is pretty  
lightweight and has plenty of ways to do inter-thread communication.



On Apr 10, 2008, at 12:00 PM, Don Arnel wrote:


Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to play  
around with Macs. I feel like a beginner all over again! Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.  Is  
there a similar way to handle this in Cocoa?

___

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: A simple Objective-C question

2008-04-10 Thread john darnell
Mr. Krishna:

   I, too am new to Objective-C, but in the two books I have been
studying on the language, they both make the point that Objective-C
plays nicely with both C and C++.  Could you simply write a standard C++
class and instantiate it the same way one does with other C++ classes
(i.e. by declaring it, or by using the new operator)?

R,
John

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Rama Krishna
Sent: Thursday, April 10, 2008 1:22 PM
To: cocoa-dev@lists.apple.com
Subject: A simple Objective-C question

I am new to Objective-C but I have done C++/C#/Java work. I have been
doing
some experiments to understand how the language works. I found that it
is
not necessary for an Objective-C class to derive from Object. I was able
to
create a class which did not derive from Object contrary to my
assumption
that all Objective-C classes implicitly derive from Object (such as in
C# or
Java).

 

However, such a class has a problem. It cannot be allocated or
initialized.
Because it can never get the alloc message as the alloc message is
declared
in the Object class. My question ,therefore, is how can such classes be
instantiated. Is there a library function for that? Surely, the standard
alloc function must be using such a function. Or should I just derive
all
classes from Object.

___

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/john.darnell%40walswort
h.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: A simple Objective-C question

2008-04-10 Thread Michael Vannorsdel
You'll want to make all basic classes a subclass of NSObject so alloc/ 
dealloc, retain/release function properly.  Unless you really want to  
implement you're own alloc/dealloc method, but I think that's  
unnecessary work.



On Apr 10, 2008, at 12:22 PM, Rama Krishna wrote:

I am new to Objective-C but I have done C++/C#/Java work. I have  
been doing
some experiments to understand how the language works. I found that  
it is
not necessary for an Objective-C class to derive from Object. I was  
able to
create a class which did not derive from Object contrary to my  
assumption
that all Objective-C classes implicitly derive from Object (such as  
in C# or

Java).



However, such a class has a problem. It cannot be allocated or  
initialized.
Because it can never get the alloc message as the alloc message is  
declared
in the Object class. My question ,therefore, is how can such classes  
be
instantiated. Is there a library function for that? Surely, the  
standard
alloc function must be using such a function. Or should I just  
derive all

classes from Object.


___

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

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

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

This email sent to [EMAIL PROTECTED]


re: NSTreeController Core Data Duplicate Entries Problem

2008-04-10 Thread eblugamma

Hi Chris,
I think I have a solution for you. I've been having the same exact  
problem as you, and while looking for the solution, I stumbled upon  
your post.
then I stumbled upon the solution. I don't have a clear picture of  
whats happening, but your duplicate entry problem centers on the  
prepares content option in the tree controller in IB.


turn it off.

thats right, turning off the prepares content option in IB fixes the  
duplicate entries problem.
Now for you... that might cause some other problem, but I can assure  
you that my model object is very similar to yours and mine works now.




From: Chris Schmitt
Subject: NSTreeController Core Data Duplicate Entries Problem
To: cocoa-dev@lists.apple.com
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

I have a simple core data application set up with 1 entity for
tracking folders.  This entity has a circular reference to itself to
mark the Children and Parent objects.   I then added an
NSTreeController to a simple form and hooked it up to an
NSOutlineView.  After hooking up the bindings and a add and delete
button I can add records to the tree controller and the display works
fine.

My problem is, when I reopen the application the data was not being
loaded into the NSTreeControl, so checked the prepares content button
and my data showed up.  Now when I add a new child entity to one of my
existing entities I get a duplicate parent created.

Example:
Folder 1
  Child 1
Folder 2

When I add a Child 1 to Folder 1 I get the following:

Folder 1
  Child 1
Folder 2
  Child 1
Folder 3

The child record is being created, but a new parent record (Folder 3)
is also being created.  The add button is hooked up to the addChild:
method on the NSTreeController.

How do I stop this duplicate entry problem?

Thanks in advance.
Chris Schmitt

___

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: A simple Objective-C question

2008-04-10 Thread Bill Bumgarner

On Apr 10, 2008, at 11:22 AM, Rama Krishna wrote:
I am new to Objective-C but I have done C++/C#/Java work. I have  
been doing
some experiments to understand how the language works. I found that  
it is
not necessary for an Objective-C class to derive from Object. I was  
able to
create a class which did not derive from Object contrary to my  
assumption
that all Objective-C classes implicitly derive from Object (such as  
in C# or

Java).

However, such a class has a problem. It cannot be allocated or  
initialized.
Because it can never get the alloc message as the alloc message is  
declared
in the Object class. My question ,therefore, is how can such classes  
be
instantiated. Is there a library function for that? Surely, the  
standard
alloc function must be using such a function. Or should I just  
derive all

classes from Object.


You need to implement said methods using lower level primitives  
available on the system (malloc(), for example)!  And you'll likely  
need to implement a boatload of other methods, depending on what level  
of interoperability you want with the rest of Cocoa.


However, as someone else indicated...

... you probably do not want to create your own base class.   If you  
look at Cocoa, you'll find that there are very very few base  
classes.   NSProxy is about the most prominent one.Unless you  
really do need to create a new class hierarchy with very different  
semantics than the hierarchy derives from NSObject, there is no reason  
to do define a new root class.


NSObject (Not "Object", btw, as-- in the context of Cocoa-- that  
refers to pre-1992 APIs) presents a tremendous amount of functionality  
that provides the foundation on top of which much of Cocoa is  
implemented;  KVO, KVC, bindings, allocation, reference counting, GC,  
etc.


b.bum


___

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: A simple Objective-C question

2008-04-10 Thread stephen joseph butler
On Thu, Apr 10, 2008 at 1:22 PM, Rama Krishna <[EMAIL PROTECTED]> wrote:

> However, such a class has a problem. It cannot be allocated or
> initialized.
> Because it can never get the alloc message as the alloc message is
> declared
> in the Object class. My question ,therefore, is how can such classes be
> instantiated. Is there a library function for that? Surely, the standard
> alloc function must be using such a function. Or should I just derive all
> classes from Object.
>

I could be wrong, but I think you can build a +alloc message using
NSAllocateObject. However, to make your class behave well with the rest of
Cocoa, you'll also need to implement a large part of the NSObject protocol.

Unless you have a very good reason (no offense, but beginners rarely do)
then you should inherit from NSObject instead.
___

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: [OFF] unicode characters

2008-04-10 Thread Gerriet M. Denkmann


On 9 Apr 2008, at 21:02, [EMAIL PROTECTED] wrote:


Take a look at CFStringTransform().  The details will depend on
exactly what you want to do.


I just have taken a look at CFStringTransform.

kCFStringTransformLatinThai =  "reversible transform to transliterate  
text to Thai from Latin."

But: the reverse (Thai -> Latin) always returns NO, i.e. does not work.
In the forward direction there a few strange things:
"h" → "ก" = THAI CHARACTER KO KAI
There are two 'h' letters in Thai: HO HIP and HO NOKHUK - KO KAI is  
not one of these.
Other consonants getting translated in a surprising way are 'q', 'v'  
and 'x'.



kCFStringTransformMandarinLatin = "reversible transform to  
transliterate text to Latin from ideographs interpreted as Mandarin  
Chinese."
The reverse returns YES (i.e. no problem) but does nothing, just  
returns the input string unmodified.
(I have no idea how the reverse could ever work, given the huge  
number of homophones in Mandarin.)


Maybe I am doing something wrong? Or misunderstanding the documentation?


Kind regards,

Gerriet.

___

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]


Replacement for GetApplicationEventTarget?

2008-04-10 Thread Michael Vannorsdel
Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not 64  
bit compatible.

___

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]


ObjC static member variable

2008-04-10 Thread vance

Does ObjC supports Static Member Variable, and if so, how do you set it?

The getter function gets a compile time error. In C++ we do  
MyObject::staticObject to return the static member variable but I am  
not sure how is that done in ObjC


Ex:

@interface MyObject : NSObject {
static BaseObject *staticObject;
}

- (BaseObject *)staticObject
{
return staticObject;
}

Thank you
___

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]


NSArrayController and managedObjectContext Problem

2008-04-10 Thread Michael Burns

Hello list,

I've been trying to track down the cause of an EXC_BAD_ACCESS I've  
been getting upon document closure.  Here is the set up --


I have a custom view that is programmatically bound to the  
arrangedObjects of an array controller.  The array controller is  
bound to the managedObjectContext of my persistent document subclass  
in IB.  (No content binding, it just grabs all of the 'Cell' entities  
out of the moc).


So here is what happens -- I start my application, and create one  
Cell object.  I save the document and quit the application.  All is  
fine.  I reopen that same document, do nothing to it, and attempt to  
close it.  The second I move the mouse, the program crashes with an  
EXC_BAD_ACCESS error.  Here is the stack:


#0  0x90a61b09 in _objc_error
#1  0x90a61b40 in __objc_error
#2  0x90a601a0 in _freedHandler
#3	0x927e0344 in -[NSObject(NSKeyValueObserverNotification)  
didChangeValueForKey:]

#4  0x93cd2038 in -[NSManagedObject didChangeValueForKey:]
#5  0x9f46 in -[WBCell didChangeValueForKey:]
#6  0x93cbd9c8 in -[NSFaultHandler turnObject:intoFaultWithContext:]
#7	0x93cbd558 in -[NSManagedObjectContext(_NSInternalAdditions)  
_disposeObjects:count:notifyParent:]
#8	0x93cbd067 in -[NSManagedObjectContext(_NSInternalAdditions)  
_dispose:]

#9  0x93cbccf7 in -[NSManagedObjectContext dealloc]
#10 0x937e874a in -[_NSManagedProxy setManagedObjectContext:]
#11 0x937e861a in -[_NSManagedProxy dealloc]
#12 0x937e6573 in -[NSObjectController _dealloc]
#13 0x937df1a6 in -[NSArrayController _dealloc]
#14 0x9353ff55 in -[NSController dealloc]
#15 0x93847afc in -[NSAutounbinderBinding dealloc]
#16 0x927d58cf in NSPopAutoreleasePool

I know for a fact that all of the programmatic bindings with my  
custom view to the array controller are unbound (I do this in the  
dealloc method of the window controller for the custom view which is  
all getting called).  The only possible explanation I can see for  
this is that my array controller is still observing/trying to access  
values in the managed object context after it has been deallocated/ 
all of the entities released.  How would this be?


Sorry for the length of this post, this has been driving me nuts...

Mike


___

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

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

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

This email sent to [EMAIL PROTECTED]


RE: ObjC static member variable

2008-04-10 Thread Rama Krishna
You can declare a static member variable in the implementation file (.m or
.mm).

static int someSharedVariable;

@implementation 

//Use the someSharedVariable in any of the methods

@end

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
vance
Sent: Thursday, April 10, 2008 3:30 PM
To: cocoa-dev
Subject: ObjC static member variable

Does ObjC supports Static Member Variable, and if so, how do you set it?

The getter function gets a compile time error. In C++ we do  
MyObject::staticObject to return the static member variable but I am  
not sure how is that done in ObjC

Ex:

@interface MyObject : NSObject {
static BaseObject *staticObject;
}

- (BaseObject *)staticObject
{
return staticObject;
}

Thank you
___

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/vrk.lists%40gmail.com

This email sent to [EMAIL PROTECTED]

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Replacement for GetApplicationEventTarget?

2008-04-10 Thread David Duncan

On Apr 10, 2008, at 12:21 PM, Michael Vannorsdel wrote:

Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not  
64 bit compatible.


You will have to elaborate on what you are using it for, as there are  
many possible replacements.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ObjC static member variable

2008-04-10 Thread vance

Yes that works but then it becomes a global variable.

I was wondering if ObjC can handle static member variables. If not I  
will have to hack it up and declare the variable outside of the class


Thanks.
Vance

On Apr 10, 2008, at 12:36 PM, Rama Krishna wrote:

You can declare a static member variable in the implementation file  
(.m or

.mm).

static int someSharedVariable;

@implementation

//Use the someSharedVariable in any of the methods

@end

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On  
Behalf Of

vance
Sent: Thursday, April 10, 2008 3:30 PM
To: cocoa-dev
Subject: ObjC static member variable

Does ObjC supports Static Member Variable, and if so, how do you set  
it?


The getter function gets a compile time error. In C++ we do
MyObject::staticObject to return the static member variable but I am
not sure how is that done in ObjC

Ex:

@interface MyObject : NSObject {
static BaseObject *staticObject;
}

- (BaseObject *)staticObject
{
return staticObject;
}

Thank you
___

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/vrk.lists%40gmail.com

This email sent to [EMAIL PROTECTED]

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoa%40grkov.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: A simple Objective-C question

2008-04-10 Thread Kevin Dixon
While you can use Objective-C++, the main reservation is you cannot
combine the semantics of the two languages. Objects of each language need
to maintain clear divison, and only be created and deleted according to
their native language.

So C++ objects use new/delete and Objective-C objects must use alloc/release

-Kevin

> Mr. Krishna:
>
>I, too am new to Objective-C, but in the two books I have been
> studying on the language, they both make the point that Objective-C
> plays nicely with both C and C++.  Could you simply write a standard C++
> class and instantiate it the same way one does with other C++ classes
> (i.e. by declaring it, or by using the new operator)?
>
> R,
> John
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Rama Krishna
> Sent: Thursday, April 10, 2008 1:22 PM
> To: cocoa-dev@lists.apple.com
> Subject: A simple Objective-C question
>
> I am new to Objective-C but I have done C++/C#/Java work. I have been
> doing
> some experiments to understand how the language works. I found that it
> is
> not necessary for an Objective-C class to derive from Object. I was able
> to
> create a class which did not derive from Object contrary to my
> assumption
> that all Objective-C classes implicitly derive from Object (such as in
> C# or
> Java).
>
>
>
> However, such a class has a problem. It cannot be allocated or
> initialized.
> Because it can never get the alloc message as the alloc message is
> declared
> in the Object class. My question ,therefore, is how can such classes be
> instantiated. Is there a library function for that? Surely, the standard
> alloc function must be using such a function. Or should I just derive
> all
> classes from Object.

___

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: Replacement for GetApplicationEventTarget?

2008-04-10 Thread Michael Vannorsdel

To install an event handler for a global hotkey.


On Apr 10, 2008, at 1:39 PM, David Duncan wrote:


On Apr 10, 2008, at 12:21 PM, Michael Vannorsdel wrote:

Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not  
64 bit compatible.


You will have to elaborate on what you are using it for, as there  
are many possible replacements.

___

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: ObjC static member variable

2008-04-10 Thread Randall Meadows

On Apr 10, 2008, at 1:42 PM, vance wrote:


Yes that works but then it becomes a global variable.

I was wondering if ObjC can handle static member variables. If not I  
will have to hack it up and declare the variable outside of the class


Yep, that was the answer I got from several sources when I inquired  
about this as well.

___

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: ObjC static member variable

2008-04-10 Thread j o a r


On Apr 10, 2008, at 12:42 PM, vance wrote:

Yes that works but then it becomes a global variable.



It's static, so it's local to the module being compiled.


I was wondering if ObjC can handle static member variables. If not I  
will have to hack it up and declare the variable outside of the class



No, ObjC doesn't have any support for static member variables.

j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ObjC static member variable

2008-04-10 Thread Michael Vannorsdel
You'll need to move the declaration outside the interface.  You can  
stick it in the .m file for that class like you can with C/C++.



On Apr 10, 2008, at 1:29 PM, vance wrote:

Does ObjC supports Static Member Variable, and if so, how do you set  
it?


The getter function gets a compile time error. In C++ we do  
MyObject::staticObject to return the static member variable but I am  
not sure how is that done in ObjC


Ex:

@interface MyObject : NSObject {
static BaseObject *staticObject;
}

- (BaseObject *)staticObject
{
return staticObject;
}


___

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: Tight loop processing

2008-04-10 Thread Brian Stern


On Apr 10, 2008, at 2:00 PM, Don Arnel wrote:
I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.  Is  
there a similar way to handle this in Cocoa?


NSTimer may be a simple way to implement this.  Your code is called  
back by the timer at the specified interval.  Your code would probably  
run one iteration of the simulation at each callback.   User interface  
events would be processed between timer callbacks. Coding this is  
likely to be simpler than using threads.


http://developer.apple.com/documentation/Cocoa/Conceptual/Timers/Timers.html

--
Brian Stern
[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: ObjC static member variable

2008-04-10 Thread j o a r


On Apr 10, 2008, at 12:48 PM, j o a r wrote:

No, ObjC doesn't have any support for static member variables.



Btw. For ObjC I think it would be more appropriate to call them "class  
variables".



j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Replacement for GetApplicationEventTarget?

2008-04-10 Thread Nick Zitzmann


On Apr 10, 2008, at 1:21 PM, Michael Vannorsdel wrote:
Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not  
64 bit compatible.



GetApplicationEventTarget() is actually in PPC64 and X86-64 even  
though it isn't documented as such, and you'll have to supply your own  
prototype. Good thing; otherwise it would be impossible for 64-bit  
apps to get some system change notifications... Before anyone asks,  
yes, I have a bug on this.


Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ObjC static member variable

2008-04-10 Thread Scott Ribe
> Yes that works but then it becomes a global variable.

Not when it's declared static. As in plain C, static variables are at file
scope.

If you really want to access it via instances of the Objective-C class (or
the class itself), you'll just have to implement an appropriate method to
return it, in which case you might as well declare it as a static local
inside the method.

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ObjC static member variable

2008-04-10 Thread Andy Lee

On Apr 10, 2008, at 4:08 PM, Scott Ribe wrote:

Yes that works but then it becomes a global variable.


Not when it's declared static. As in plain C, static variables are  
at file

scope.

If you really want to access it via instances of the Objective-C  
class (or
the class itself), you'll just have to implement an appropriate  
method to
return it, in which case you might as well declare it as a static  
local

inside the method.


Unless you need to set it somewhere outside the method.  But yes, the  
static local approach often works for caches and for things that only  
have to be initialized once.


--Andy

___

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: System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-10 Thread Tom Harrington
On Wed, Apr 9, 2008 at 11:06 AM, Dave Camp <[EMAIL PROTECTED]> wrote:
> After designing the UI for a new System Preferences pane I've discovered
> that the window size in Leopard is 75 pixels wider than it was in Tiger or
> earlier OS releases. The net result appears to be that my shiny new UI is
> clipped on the right side in Tiger. Ugh. I've sent feedback that the docs
> are incorrect here and need to be updated...
>
>  In the mean time, what is the correct way to handle this?
>
>  From what I've read on the net adding springs in IB doesn't help. Would it
> be safe for me to resize the preferences window to be 75 pixels wider on
> Tiger while my pane is visible (and size it back down when my pane is
> deselected)?

Probably not a good idea.  Although the window width differs from
Tiger to Leopard, it's not supposed to be a resizable window.  If
you're going to run on Tiger you'll need to live with the narrower
window.

I was pretty annoyed when I found out that Leopard's System
Preferences wouldn't resize the pref pane view, even if you had
designed it to be resizable.  But that's the way it is.

>  Do I have to make my UI narrower and have an obnoxious amount of dead space
> around the edges on Leopard?

Maybe.  You can find out what the current window width is once your
preference pane has been loaded into the window.  Using something like
"[[[self mainView] superview] frame]" would give you the current
width, and if desired you could adjust mainView's frame appropriately.
 This would mean designing to Tiger's pref pane width, and then
expanding when running on Leopard.  Best to stick with looking up the
size instead of the OS version, because who knows what might happen in
10.6?

-- 
Tom Harrington
[EMAIL PROTECTED]
AIM: atomicbird1
___

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]


Singletons on Leopard with GC

2008-04-10 Thread Karl Moskowski
I have a couple of classes for which I'd like to use the singleton  
pattern.


I read some of the old posts on this list and at cocoadev.com about  
approaches to take. They mention Apple's recommendations about  
overriding retain, release, etc. to essentially turn them into no-ops.  
However, they're from pre-Leopard days, and in a GC-required app, the  
compiler automatically no-ops those methods.


I'm currently using something like this code in my implementations:

static MyClass *sharedInstance;
+ (MyClass *)sharedInstance {
if (!sharedInstance)
sharedInstance = [[self alloc] init];
return sharedInstance;
}

- (id)init {
if (!sharedInstance)
sharedInstance = [super init];
return sharedInstance;
}

My goal is to ensure that [MyClass sharedInstance] and [[MyClass  
alloc] init] return the same singleton object. Furthermore, I'd like  
to ensure that an object instantiated in a NIB is the sharedInstance  
too. So far, it seems to work, but I'm afraid I've missed something.


Any suggestions? Thanks.


Karl Moskowski <[EMAIL PROTECTED]>
Voodoo Ergonomics Inc. 



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: Replacement for GetApplicationEventTarget?

2008-04-10 Thread Jean-Daniel Dupas


Le 10 avr. 08 à 22:05, Nick Zitzmann a écrit :



On Apr 10, 2008, at 1:21 PM, Michael Vannorsdel wrote:
Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not  
64 bit compatible.



GetApplicationEventTarget() is actually in PPC64 and X86-64 even  
though it isn't documented as such, and you'll have to supply your  
own prototype. Good thing; otherwise it would be impossible for 64- 
bit apps to get some system change notifications... Before anyone  
asks, yes, I have a bug on this.


Nick Zitzmann



I'm using this function with 64 bits too, and I just want to make you  
avoid a problem I encounter. Follow Nick's advice and declare your own  
prototype for 64 bits, else even if GCC only log a warning, the  
function call will not be correctly generated and your application  
will crash.


___

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: Tight loop processing

2008-04-10 Thread Wade Tregaskis
Threads are almost always the right way to do what the OP wants.  The  
problem as was presented is that there's some work to do, which  
happens to be dividable into N segments.  There were no bounds placed  
on how long it takes to run any individual segment.  And even if there  
were, they'd probably be wrong - just about anything your code does  
can be delayed unexpectedly in weird and wonderful ways.


No, the correct approach is to do your work on a separate thread.  In  
Leopard you can send messages between threads trivially using  
performSelector:onThread:withObject:waitUntilDone:, which makes it  
very simple to tell your worker thread to stop, or send results &  
status back to the main thread, etc.


It's worth doing this properly if only for the sake of learning how to  
do it.  Concurrency is the way of the future, like it or not, and  
threads are the primary way to get that concurrency.  They're more  
resistant to numerous failure modes (such as unexpected blocking,  
excessively long work periods, and more) and they scale better - you  
can do other stuff, you could run two threads concurrently to do a  
second set of work, etc.  And, naturally, they give you performance  
scaling that is potentially even better than linear.


Sorry if that all sounds a bit pious, but I personally feel it's  
really important that people don't try to use crutches like timers or  
delayed performs, that are only going to be a liability sooner or later.


Wade
___

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: Replacement for GetApplicationEventTarget?

2008-04-10 Thread Michael Vannorsdel

Great thanks a lot.


On Apr 10, 2008, at 3:11 PM, Jean-Daniel Dupas wrote:



Le 10 avr. 08 à 22:05, Nick Zitzmann a écrit :



On Apr 10, 2008, at 1:21 PM, Michael Vannorsdel wrote:
Is there a replacement function for GetApplicationEventTarget?   
I'm looking for one since this is the only thing I have left  
that's not 64 bit compatible.



GetApplicationEventTarget() is actually in PPC64 and X86-64 even  
though it isn't documented as such, and you'll have to supply your  
own prototype. Good thing; otherwise it would be impossible for 64- 
bit apps to get some system change notifications... Before anyone  
asks, yes, I have a bug on this.


Nick Zitzmann



I'm using this function with 64 bits too, and I just want to make  
you avoid a problem I encounter. Follow Nick's advice and declare  
your own prototype for 64 bits, else even if GCC only log a warning,  
the function call will not be correctly generated and your  
application will crash.




___

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: System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-10 Thread E. Wing
On 4/9/08, Dave Camp <[EMAIL PROTECTED]> wrote:
> After designing the UI for a new System Preferences pane I've
> discovered that the window size in Leopard is 75 pixels wider than it
> was in Tiger or earlier OS releases. The net result appears to be that
> my shiny new UI is clipped on the right side in Tiger. Ugh. I've sent
> feedback that the docs are incorrect here and need to be updated...
>
> In the mean time, what is the correct way to handle this?
>

There's a Developer example that shows how to handle this (create two
different views, one for each version).
http://developer.apple.com/samplecode/PrefsPane/index.html

-Eric
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: core data and IB outlet binding

2008-04-10 Thread Torsten Curdt


On Apr 10, 2008, at 17:51, Keary Suska wrote:

on 4/10/08 4:30 AM, [EMAIL PROTECTED] purportedly said:


Here is a small screenshot of the bindings

http://vafer.org/pub/bindings.png

As the button binding is working so should the NSTextField   
binding ...one
would think. But just to verify I've also added the awakeFromNib.  
As expected

it  also gets called.

Is there a way to get more information on the NIB startup?


I did get to the correct Core Data value via representedObject

- (IBAction) applyFilter:(id)sender
{
NSString *expression = [[self representedObject] Expression];

...but that still doesn't really help with the normal bindings :-(


Just to be clear, "binding" is a specific technology that has  
nothing to do
with outlet setting. Better to use proper terminology or suggestions  
may not

be correct.


Uh ...OK. Sorry, I thought that would also be referred to as binding.  
But apparently it's just called a "connection".



Anyway, in your original post, you say:


When the button is pressed it turns out that filterExpression (and
therefor also the stringValue of it) is nil.


Are you certain that filterExpression is nil? Just because it's  
string value

is nil, doesn't mean the outlet is nil.


I"ve tested with a

if (filterExpression == nil) NSLog(...)

and by running it through the debugger stopping at a breakpoint in  
that function.


But anyway ...that NSTextField is nil although the connection is set  
in IB.
Which I can only assume has something to do it being a  
NSCollectionViewItem.



It just means the field thinks that
it's empty. If it *isn't* nil, then make sure that the field editor  
has
committed changes. Remember that in the UI, when editing a text  
field, you
aren't editing the text field, but the field editor. Edits aren't  
normally
committed until either the field is exited or effected by certain  
binding

options (such as 'continuously updates value").


Yeah ...that's clear.

cheers
--
Torsten
___

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: Tight loop processing

2008-04-10 Thread Mike R. Manzano
Depending on the nature of your simulation, and if you don't mind  
being Leopard-only, you might break it down into a series of  
NSOperations and let Cocoa handle the rest for you.


Mike


On Apr 10, 2008, at 11:00 AM, Don Arnel wrote:


Hey all...

This is my first time posting to this list. I've been a Windows  
developer for many many years and have just recently started to play  
around with Macs. I feel like a beginner all over again! Anyway


I've got a Cocoa application which runs a simulation loop 1000s of  
times. Of course, this prevents any user interaction with the rest  
of the program while the simulation is running. When I was  
programming for Windows there was a call in Visual Basic  
(app.DoEvents()) which would process any pending events. You could  
put DoEvents() inside long loops to prevent blocking user input.  Is  
there a similar way to handle this in Cocoa?


Thanks for any help!
- Don
___

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/alephx01%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: Tips to deploy applications to multiple Mac OS X versions

2008-04-10 Thread Chris Suter
One caveat, though, is that you should probably have a runtime check  
for the minimum OS version you expect so that you don't end up with  
a crash if someone tries to use your nifty Leopard features on  
Tiger. Adding something to main() would probably be easiest, either  
checking against NSAppKitVersionNumber or calling Gestalt() to get  
the OS version.


There's something you can put in the Info.plist that does this for  
free. I forget exactly what it is but I'm sure it's easily found.


- Chris



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: Tight loop processing

2008-04-10 Thread Ken Thomases

On Apr 10, 2008, at 4:13 PM, Wade Tregaskis wrote:

Threads are almost always the right way to do what the OP wants.


Agreed.  Furthermore, if you have the luxury of targeting Leopard,  
look into NSOperation and NSOperationQueue.  Using those properly,  
you can get maximum concurrency for the hardware on which you're  
running.


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: System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-10 Thread Dave Camp

On Apr 10, 2008, at 3:06 PM, E. Wing wrote:

On 4/9/08, Dave Camp <[EMAIL PROTECTED]> wrote:

After designing the UI for a new System Preferences pane I've
discovered that the window size in Leopard is 75 pixels wider than it
was in Tiger or earlier OS releases. The net result appears to be  
that

my shiny new UI is clipped on the right side in Tiger. Ugh. I've sent
feedback that the docs are incorrect here and need to be updated...

In the mean time, what is the correct way to handle this?



There's a Developer example that shows how to handle this (create two
different views, one for each version).
http://developer.apple.com/samplecode/PrefsPane/index.html


That's not an option for me, I've got way too many views (it's a  
rather substantial pref pane).


For the moment, I'm going with making the window wider while my pane  
is active... I might re-evaluate adding code to manually resize  
various bits of UI at a later date. It's a non-trivial task.


Thanks,
Dave
___

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]


Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Michael Vannorsdel
Is it possible to build a binary that uses the extra registers and  
features of x86_64 but without making a 64 bit binary?

___

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]


YACCOB - Yet Another Custom Cell OutlineView Binding problem

2008-04-10 Thread Paolo Ottanà

Hi everybody,
I am stuck with a (maybe trivial) problem, but I did not find a  
solution suitable for my case in the old messages and on the net.
My situation is this: I want to use a custom button cell inside an  
OutlineView to add some color and text to the basic checkbox and draw  
a set of Node objects. I would like to use a treecontroller to manage  
my Nodes array and use a binding to link the cell value to a Node  
property containing data like: color, enabled value, title string,  
title string color, etc...


Trying to understand what to do I implemented this:

I subclassed NSButtonCell (MyCustomCell) and redefined  
setRepresentedObject: and setObjectValue:


I created in IB an NSOutlineView, dragged in  a NSButtonCell and set  
the cell class to MyCustomCell. I set OutlineView delegate to  
MyDocument and implemented in MyDocument  
outlineView:willDisplayCell:forTableColumn:item:


I created a Node class with methods isLeaf: children: childrenCount:  
and some custom properties (KVC compliant) like nodeName(NSString)  
nodeColor(NSColor), nodeEnabled(bool).


I filled with some Node a NSMutableArray inside MyDocument and binded  
it to a NSTreeController ContentArray via IB


Then I binded the tablecolumn Value to the TreeController using the  
key "nodeEnabled". All worked fine and the normal button cells were  
drawn correctly.


Then I tried to bind to the column the key "nodeColor". My idea is to  
intercept the NSColor as it is set inside the cell and use it to do  
some drawing.


The problem is that:
in MyCustomCell setRepresentedObject: is called only once with object  
nil (not the displayed Node)
setObjectValue is called multiple times (once per visible cell) but  
object value is always nil (not the color)
outlineView:willDisplayCell:forTableColumn:item: is called multiple  
times but cell seems not a MyCustomCell instance but a simple  
NSButtonCell. Calling [item representedObject] seems to return a valid  
ptr to the displayed node, BUT after exiting the method I get an  
assertion "Cannot create BOOL from object NSCalibratedRGBColorSpace 1  
1 1 1 of class NSCachedRGBColor" and the OutlineView is not displayed  
at all. I surely miss some basic understanding of cells/tables and  
some methods implementation... :-(


How can I bind correctly a Node property (or a dictionary containing  
more properties) to my custom cell inside the Outline view so that I  
can use the properties to do some drawing/coloring? Is it possible  
using bindings or I am totally out of the right path?


Sorry if I am not so clear but I am a total Cocoa newby.

Thanks in advance for any help or any pointer to interesting  
documents...


Paull
___

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: Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Nick Zitzmann


On Apr 10, 2008, at 4:46 PM, Michael Vannorsdel wrote:
Is it possible to build a binary that uses the extra registers and  
features of x86_64 but without making a 64 bit binary?



I'm pretty sure the answer is no. What are you trying to accomplish?

Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Michael Vannorsdel
Just an optimized build for core 2 and xeon, but I have to link with  
10.4SDK and it has some header bugs when building for 64 bit Intel  
(mostly from TARGET_CPU_X86 not defined).  I don't really need 64 bit  
addressing but would like to use the additional registers and 64 bit  
integer math.



On Apr 10, 2008, at 4:51 PM, Nick Zitzmann wrote:



On Apr 10, 2008, at 4:46 PM, Michael Vannorsdel wrote:
Is it possible to build a binary that uses the extra registers and  
features of x86_64 but without making a 64 bit binary?



I'm pretty sure the answer is no. What are you trying to accomplish?

___

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: Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Clark Cox
On Thu, Apr 10, 2008 at 3:46 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote:
> Is it possible to build a binary that uses the extra registers and features
> of x86_64 but without making a 64 bit binary?

No. May I ask why you don't want to make a 64-bit binary?

-- 
Clark S. Cox III
[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: Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Nick Zitzmann


On Apr 10, 2008, at 5:00 PM, Michael Vannorsdel wrote:
Just an optimized build for core 2 and xeon, but I have to link with  
10.4SDK and it has some header bugs when building for 64 bit Intel  
(mostly from TARGET_CPU_X86 not defined).  I don't really need 64  
bit addressing but would like to use the additional registers and 64  
bit integer math.



You can probably get around that by using preprocessor defines. In any  
case, if you're targeting 64-bit in Tiger, then don't forget that only  
a very small handful of libraries had 64-bit support in Tiger. If  
you're compiling a 64-bit GUI application, then you must target  
Leopard, at least for the 64-bit builds.


Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: recursive dir searching

2008-04-10 Thread Rainer Brockerhoff
At 11:09 -0700 10/04/08, [EMAIL PROTECTED] wrote:
>From: "Wesley Smith" <[EMAIL PROTECTED]>
>Date: Tue, 8 Apr 2008 17:20:25 -0600
>Message-ID: <[EMAIL PROTECTED]>
>
>I've been trying to use
>NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager]
>enumeratorAtPath:dir];
>
>to recursively search for a file in a given directory but am coming
>across some minor details that I'm not sure what the best way to deal
>with is.

I just posted some code (with sample app) which you might find useful for 
recursive directory searching:
http://www.brockerhoff.net/src/
(scroll down to "FolderSweep").

MIT license (with attribution), so feel free to use it.

HTH,
-- 
Rainer Brockerhoff  <[EMAIL PROTECTED]>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
 In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
___

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: Making use of Core 2 features without 64bit addressing

2008-04-10 Thread Clark Cox
On Thu, Apr 10, 2008 at 4:00 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote:
> Just an optimized build for core 2 and xeon, but I have to link with 10.4SDK

Are you sure that you have to use the 10.4 SDK? Just use the 10.5 SDK,
but set the deployment target to 10.4 for your 32-bit architectures.

Alternatively, you could probably use different SDK's for different
architectures. Your i386 and/or ppc builds can use the 10.4 SDK, while
your x86_64 and/or ppc64 builds can use the 10.5 SDK.

> and it has some header bugs when building for 64 bit Intel (mostly from
> TARGET_CPU_X86 not defined).  I don't really need 64 bit addressing but
> would like to use the additional registers and 64 bit integer math.

You can't have one without the other.

>
>
>
>  On Apr 10, 2008, at 4:51 PM, Nick Zitzmann wrote:
>
>
> >
> > On Apr 10, 2008, at 4:46 PM, Michael Vannorsdel wrote:
> >
> > > Is it possible to build a binary that uses the extra registers and
> features of x86_64 but without making a 64 bit binary?
> > >
> >
> >
> > I'm pretty sure the answer is no. What are you trying to accomplish?
> >
>
>  ___
>
>  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/clarkcox3%40gmail.com
>
>  This email sent to [EMAIL PROTECTED]
>



-- 
Clark S. Cox III
[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: Tips to deploy applications to multiple Mac OS X versions

2008-04-10 Thread Ben Lachman


On Apr 10, 2008, at 6:19 PM, Chris Suter wrote:
One caveat, though, is that you should probably have a runtime  
check for the minimum OS version you expect so that you don't end  
up with a crash if someone tries to use your nifty Leopard  
features on Tiger. Adding something to main() would probably be  
easiest, either checking against NSAppKitVersionNumber or calling  
Gestalt() to get the OS version.


There's something you can put in the Info.plist that does this for  
free. I forget exactly what it is but I'm sure it's easily found.


LSMinimumSystemVersion is the key.

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009

___

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: Highlight color of a NSTableView row

2008-04-10 Thread Eric Gorr


On Apr 10, 2008, at 6:00 AM, Cathy Shive wrote:

If you're targeting Leopard, there is an NSTableView method you can  
override for this (a public one!)


-(void)highlightSelectionInClipRect:(NSRect)theClipRect

You have to actually draw the highlights, it's not simply a matter  
of setting the color.  If you look at the post Ben linked to, there  
is sample code you can download that will show you what to do.




The problem I am having with this is that it is leaving white spaces  
between the columns, which correspond to where the grid lines would be  
- I have them turned off. Is there anything I can do about that?


Here is what my function looks like so far based on Ben's code...

- (void)highlightSelectionInClipRect:(NSRect)clipRect
{
NSRange aVisibleRowIndexes  = [self rowsInRect:clipRect];
NSIndexSet *aSelectedRowIndexes = [self selectedRowIndexes];
int aRow= aVisibleRowIndexes.location;
int anEndRow= aRow +  
aVisibleRowIndexes.length;


NSColor *aColor = [NSColor colorWithCalibratedRed:0.929 green: 
0.953 blue:0.996 alpha:1.0];


[aColor set];

// draw highlight for the visible, selected rows
for (aRow; aRow < anEndRow; aRow++)
{
if([aSelectedRowIndexes containsIndex:aRow])
{
NSRect aRowRect = NSInsetRect([self rectOfRow:aRow], 2, 1);
NSRectFill(aRowRect);
}
}
}
___

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: ObjC static member variable

2008-04-10 Thread Chris Hanson

On Apr 10, 2008, at 12:42 PM, vance wrote:

Yes that works but then it becomes a global variable.

I was wondering if ObjC can handle static member variables. If not I  
will have to hack it up and declare the variable outside of the class


A C++ static member variable is a global variable too, its scope is  
just managed by its declaring class.


Objective-C only has direct support for instance variables.

You can implement either global-for-all-subclasses class variables or  
unique-per-subclass class variables yourself using class methods and  
either a single file-static variable (for a global-for-all-subclasses  
class variable) or a file-static map table keyed by class (for a  
unique-per-subclass class variable).


However, as with all global variables, think long and hard about  
whether you really need them and how they will be used.  Often the  
implementation of a "singleton" design pattern is a code smell, gets  
in the way of comprehensive unit testing and makes test-driven  
development and refactoring harder than it should be.


  -- 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: Highlight color of a NSTableView row

2008-04-10 Thread Eric Gorr


On Apr 10, 2008, at 8:00 PM, Eric Gorr wrote:



On Apr 10, 2008, at 6:00 AM, Cathy Shive wrote:

If you're targeting Leopard, there is an NSTableView method you can  
override for this (a public one!)


-(void)highlightSelectionInClipRect:(NSRect)theClipRect

You have to actually draw the highlights, it's not simply a matter  
of setting the color.  If you look at the post Ben linked to, there  
is sample code you can download that will show you what to do.




Playing with this a bit more, it appears that I need to also do:

- (id)_highlightColorForCell:(NSCell *)cell
{
// we need to override this to return nil
// or we'll see the default selection rectangle when the app is running
// in any OS before leopard

	// you can also return a color if you simply want to change the  
table's default selection color

return nil;
}

Or it will ignore my highlight drawing entirely. It appears this is an  
undocumented API or, at least, I cannot locate it in the documentation.


Once I tossed this in, there weren't white spaces between the columns.

So, is there a way to do this without using undocumented APIs?

___

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: Highlight color of a NSTableView row

2008-04-10 Thread Corbin Dunn
If you're targeting Leopard, there is an NSTableView method you can  
override for this (a public one!)


-(void)highlightSelectionInClipRect:(NSRect)theClipRect


Ideally this should be the only method you have to override for Tiger  
also. You may have to coordinate with the cell (or use a custom cell)  
to get the cell to not draw a conflicting highlight (hence, that is  
why some people say to override _highlightColorForCell: -- this color  
isn't used by NSTableView -- it is used by the cell)





You have to actually draw the highlights, it's not simply a matter  
of setting the color.  If you look at the post Ben linked to, there  
is sample code you can download that will show you what to do.




The problem I am having with this is that it is leaving white spaces  
between the columns, which correspond to where the grid lines would  
be - I have them turned off. Is there anything I can do about that?





   NSRect aRowRect = NSInsetRect([self rectOfRow:aRow], 2, 1);


Your insetting the width and height, hence you get spacing.

corbin
___

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: Highlight color of a NSTableView row

2008-04-10 Thread Corbin Dunn


Playing with this a bit more, it appears that I need to also do:

- (id)_highlightColorForCell:(NSCell *)cell
{
// we need to override this to return nil
	// or we'll see the default selection rectangle when the app is  
running

// in any OS before leopard

	// you can also return a color if you simply want to change the  
table's default selection color

   return nil;
}

Or it will ignore my highlight drawing entirely. It appears this is  
an undocumented API or, at least, I cannot locate it in the  
documentation.


If a method starts with an underscore, don't even bother looking it up  
in the documentation :) -- not only is it undocumented, but it is  
unsupported and might change in the future.


The proper thing to do:

1. Subclass NSCell, NSTextFieldCell, or whatever other cell you want.
2. Override:

- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView  
*)controlView


and return nil.

That is the correct thing to do for Tiger, Leopard, etc.

corbin
___

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: Highlight color of a NSTableView row

2008-04-10 Thread Eric Gorr


On Apr 10, 2008, at 8:28 PM, Corbin Dunn wrote:

If you're targeting Leopard, there is an NSTableView method you  
can override for this (a public one!)


-(void)highlightSelectionInClipRect:(NSRect)theClipRect


Ideally this should be the only method you have to override for  
Tiger also. You may have to coordinate with the cell (or use a  
custom cell) to get the cell to not draw a conflicting highlight  
(hence, that is why some people say to override  
_highlightColorForCell: -- this color isn't used by NSTableView --  
it is used by the cell)


The only information I am displaying in the cells is text and, for one  
column only, a NSImage. Does this mean I can avoid using a custom cell?


How would I go about coordinating with the cell?

You have to actually draw the highlights, it's not simply a matter  
of setting the color.  If you look at the post Ben linked to,  
there is sample code you can download that will show you what to do.




The problem I am having with this is that it is leaving white  
spaces between the columns, which correspond to where the grid  
lines would be - I have them turned off. Is there anything I can do  
about that?





  NSRect aRowRect = NSInsetRect([self rectOfRow:aRow], 2, 1);


Your insetting the width and height, hence you get spacing.


I'm insetting the rect of the entire row...there shouldn't be any  
spaces between the columns, just some extra space left at the  
beginning and end of the row.


___

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: Highlight color of a NSTableView row

2008-04-10 Thread Eric Gorr


On Apr 10, 2008, at 8:30 PM, Corbin Dunn wrote:



Playing with this a bit more, it appears that I need to also do:

- (id)_highlightColorForCell:(NSCell *)cell
{
// we need to override this to return nil
	// or we'll see the default selection rectangle when the app is  
running

// in any OS before leopard

	// you can also return a color if you simply want to change the  
table's default selection color

  return nil;
}

Or it will ignore my highlight drawing entirely. It appears this is  
an undocumented API or, at least, I cannot locate it in the  
documentation.


If a method starts with an underscore, don't even bother looking it  
up in the documentation :) -- not only is it undocumented, but it is  
unsupported and might change in the future.


The proper thing to do:

1. Subclass NSCell, NSTextFieldCell, or whatever other cell you want.
2. Override:

- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView: 
(NSView *)controlView


and return nil.


How would I go about subclassing NSTextFieldCell & NSImageCell and  
then using these cell with my NSTableView?




___

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

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

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

This email sent to [EMAIL PROTECTED]


how should I go about downloading files

2008-04-10 Thread Laimonas Simutis
Hey,

This is my first cocoa projects so I am kind of finding my way around
the framework. The question I have is maybe more related to the design
practices with cocoa.

I make a HTTP call to a server which gives me back a list of urls
pointing to mp3 files. For each url handling I created FileDownloader
class that inside uses NSURLDownload class to download the mp3 file.
All works fine but I have a problem with finding a solution for
"queuing" the downloads. I want to control how many files will be
downloaded concurrently (usually it will be one or two). However right
now what I have is basically this:

NSArray *arr = ... get this puppy from parsing the server response

int i;
for(i=0; i<[arr count]; i++)
{
NSString *url = [arr objectAtIndex:i];

// now fetch the file
FileDownloader *downloader = [[FileDownloader alloc] init];
[downloader setDelegate:self];
[downloader downloadItem:url];
}

The problem with the above is that I spawn as many downloaders as the
urls returned by the server since downloadItem does't block. What
would be the best way to go about queueing these guys up? That way I
can have a predetermined set of progress indicators and stuff like
that.

Let me know if the question is too broad and i will try to narrow it down.

I find this delegate stuff in cocoa all over the places and it is
rather foreign concept to me, although I am getting used to it.


L
___

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]


Question about NSTreeController/NSOutlineView instance cleanup

2008-04-10 Thread Markus Spoettl

Hi,

  I have a simple test application (modeled after the SourceView  
sample) which is a NSDocument based application. The NSDocument  
derived class contains a root NSMutableArray which serves as the  
content for an NSOutlineView which is attached to the content through  
binding.


@interface MyDocument : NSDocument {
[...]
NSMutableArray *treeContent;
[...]
}

treeContent is never accessed directly (except for initialization and  
deallocation), it's managed by a NSTreeController instance that is  
part of the document's nib file.


The problem now is i -(void)dealloc: for MyDocument:

- (void)dealloc
{
[treeContent release];

   [super dealloc];
}

This causes the following debugger log:

--
2008-04-10 17:50:02.641 AppDocTest[7852:813] An instance 0x160ad0 of  
class TreeNode is being deallocated while key value observers are  
still registered with it. Observation info is being leaked, and may  
even become mistakenly attached to some other object. Set a breakpoint  
on NSKVODeallocateBreak to stop here in the debugger. Here's the  
current observation info:

 (
children, Options:  Context: 0xa00be78c,  
Property: 0x160530>
Options:  Context: 0xa00be78c, Property:  
0x14f140>

)
--

If I interpret this correctly I'm removing my tree content from under  
the NSTreeController while it's still using it. If found that when I add


[treeContent removeAllObjects];

before [treeContent release] this log entry goes away, but I'm not at  
all convinced this is the right procedure. So what is? How do I tell  
the NSTreeController to remove all ties to my nodes because we are  
shutting down?


I'm very new to Cocoa so there might be something I did wrong in the  
setup. I very closely followed the SourceView sample though which  
works with a NSWindowController instead of NSDocument and does not  
produce this log entry) Thanks for any pointers.


Regards
Markus
--
__
Markus Spoettl
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how should I go about downloading files

2008-04-10 Thread Michael Vannorsdel
You can start new downloads from the queue in your downloadDidFinish:  
delegate method.



On Apr 10, 2008, at 7:04 PM, Laimonas Simutis wrote:



The problem with the above is that I spawn as many downloaders as the
urls returned by the server since downloadItem does't block. What
would be the best way to go about queueing these guys up? That way I
can have a predetermined set of progress indicators and stuff like
that.

Let me know if the question is too broad and i will try to narrow it  
down.


I find this delegate stuff in cocoa all over the places and it is
rather foreign concept to me, although I am getting used to 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]


Why might DO/NSConnection fail?

2008-04-10 Thread Brad Peterson
Hi all,

I've got a user reporting a crash in one of our
components. 

The truly weird thing, for me, is that this is a crash
in the DO portion of our code, which would seem to
indicate that NSConnection wasn't able to find the DO
server. (Now, this is odd in and of itself, since the
server launches this other app, but...)

I don't understand why this would be a hard crash like
this, though.

Has anyone else ever seen this? Any ideas (heck, even
guesses) would be very much appreciated.

Thank you,

B

>> Exception:  EXC_BREAKPOINT (0x0006)
>> Code[0]:0x0002
>> Code[1]:0x
>> 
>> 
>> Thread 0 Crashed:
>> 0   com.apple.Foundation   0x928314b3
_NSRaiseError + 227
>> 1   com.apple.Foundation   0x9284dbfc
-[NSConnection 
>> sendInvocation:] + 3125
>> 2   com.apple.Foundation   0x928044d8 
>> -[NSObject(NSForwardInvocation) forward::] + 469

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Why might DO/NSConnection fail?

2008-04-10 Thread Michael Vannorsdel
I've seen a similar crash when a user had a download accelerator input  
manager installed.



On Apr 10, 2008, at 7:45 PM, Brad Peterson wrote:


Hi all,

I've got a user reporting a crash in one of our
components.

The truly weird thing, for me, is that this is a crash
in the DO portion of our code, which would seem to
indicate that NSConnection wasn't able to find the DO
server. (Now, this is odd in and of itself, since the
server launches this other app, but...)

I don't understand why this would be a hard crash like
this, though.

Has anyone else ever seen this? Any ideas (heck, even
guesses) would be very much appreciated.


___

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: Question about NSTreeController/NSOutlineView instance cleanup

2008-04-10 Thread Markus Spoettl

On Apr 10, 2008, at 6:07 PM, Markus Spoettl wrote:
If I interpret this correctly I'm removing my tree content from  
under the NSTreeController while it's still using it. If found that  
when I add


   [treeContent removeAllObjects];



Small correction this (calling removeAllObject) doesn't remove the  
problem, I don't know why it appear that way at first. Overall it  
makes more sense that way because I guess that it would be called  
automatically when disposed of.


So the question remains, how to tell NSTreeController to release all  
ties to the node hierarchy so it can be cleaned up?


Regards
Markus
--
__
Markus Spoettl

___

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]


NSArrayController's "selectionIndex" weirdness

2008-04-10 Thread Johnny Lundy

Hello all,

In a TableView column bound to an NSArrayController which has  
playerArray, a mutable array, as its content.


An NSButton binding selectionIndex of the controller as the Argument  
1, and the Selector Name to the method below, here's what I get in the  
method:


- (void) nightKill:(NSUInteger) theWhackedOne
{
NSLog(@"SelectionIndex=%@",theWhackedOne);
[playerArray removeObjectAtIndex:theWhackedOne];
return;
}

When array item 0 is selected in the TableView, and the button  
clicked, the method is invoked. Cool.


The NSLog (with the format as "%@" you see above displays

SelectionIndex=0

Which is correct. It also displays 1, 2, 3, and 4 as the subsequent  
items are selected.


But the removeObjectAtIndex errors with rangeError, a large integer.

The selectionIndex is an NSUInteger, right? But in the GUI debugger,  
the value of theWhackedOne is some huge integer. Also, if I change the  
NSLog to format as "%d" instead of "%@", I get that huge integer.


"[theWhackedOne intValue]" gives an error - invalid assignment type -  
can't take the intValue of an integer, I guess.




How can this be? It apparently wants me to cast this object as an  
integer, but it is already an integer. When formatting it with NSLog  
as an object, I get the correct value (the index of the selected item  
in the array), but when using it as an integer I get a huge number  
that looks like a pointer.


I would appreciate any insight. The NSLog is giving the correct values  
but nothing else can change this parameter to the correct integer.

___

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: Question about NSTreeController/NSOutlineView instance cleanup

2008-04-10 Thread Quincey Morris


On Apr 10, 2008, at 18:52, Markus Spoettl wrote:

So the question remains, how to tell NSTreeController to release all  
ties to the node hierarchy so it can be cleaned up?


The first thing to check is how you are initializing the treeContent  
variable. What method are you using to create it, and are you  
retaining 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: NSArrayController's "selectionIndex" weirdness

2008-04-10 Thread Quincey Morris


On Apr 10, 2008, at 19:09, Johnny Lundy wrote:


- (void) nightKill:(NSUInteger) theWhackedOne
{
NSLog(@"SelectionIndex=%@",theWhackedOne);
[playerArray removeObjectAtIndex:theWhackedOne];
return;
}


The array controller is sending you a NSNumber whose value is the  
selection index. That's why it NSLogs correctly with the %@ (object)  
format specifier.


You need:


- (void) nightKill:(NSNumber *) theWhackedOne
{
NSLog(@"SelectionIndex=%@",theWhackedOne);
[playerArray removeObjectAtIndex:[theWhackedOne integerValue]];
return;
}



___

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: Question about NSTreeController/NSOutlineView instance cleanup

2008-04-10 Thread Markus Spoettl
The first thing to check is how you are initializing the treeContent  
variable. What method are you using to create it, and are you  
retaining it?


OK, this is what I do:

- (id)init
{
self = [super init];
if (self) {
treeContent = [[NSMutableArray alloc] init];
}
return self;
}

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

I thought I don't have to retain treeContent since I automatically do  
that with alloc-init, right?


When treeContent is released, I assume it automatically releases all  
TreeNode objects in it and that's what is reported in the log entry to  
be unexpected. I get as many warnings as root node entries in  
treeContent but none for child objects further down the hierarchy.


Markus
--
__
Markus Spoettl

___

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

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

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

This email sent to [EMAIL PROTECTED]


  1   2   >