iPad Programming Tutorial

2010-04-25 Thread ML
Hi All,

Does anyone know of a resource that helps understand how to NOT use interface 
builder for developing applications? 

I am trying to create a iPad SplitView application and I dont quite understand 
if I want to put code to create additional interface elements in: - 
(void)configureView or - (void)viewDidLoad

Say I wanted to add a UITextView and display it.

Wouldn't I do something like:

CGRect bounds = [[UIScreen mainScreen] applicationFrame];

UITextView *theTextView = [[UITextView alloc] initWithFrame:bounds];
[theTextView setContentView:theTextView];
[theTextView makeKeyAndOrderFront:nil];
[theTextView makeFirstResponder:theTextView];

[theTextView show];

But I dont know if it displays, I was thinking that maybe this is something to 
do with that fact the project uses Interface Builder and I dont want to.

-ML
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: iPad Programming Tutorial

2010-04-26 Thread ML

How about a good book that explains what IB does, how to set delegates, first 
responders, connect things up, etc

I think that misunderstanding prevents me from using IB as much as I really 
should.

- Original Message -
From: "Matt Moriarity" 
To: "Rick Mann" 
Cc: "ML" , "Cocoa-Dev List" 

Sent: Monday, April 26, 2010 7:44:34 AM
Subject: Re: iPad Programming Tutorial

I'm going to have to agree with Rick, IB is the way to go.
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Where to find?

2010-05-10 Thread ML

Can anyone point me in a direction of the proper way to find a users home 
directory and where to find where applications are installed or can I always 
assume /Applications?

Thank You,

-ML
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: Where to find?

2010-05-10 Thread ML

Hi Guys,

>> Can anyone point me in a direction of the proper way to find a users home 
>> directory

> Look at NSHomeDirectory() or NSHomeDirectoryForUser() ?

Oh, I am using currentUserHomeDirectory = NSHomeDirectoryForUser(NSUserName());
but I was told that this was not proper to be used anymore by another developer.

>> and where to find where applications are installed or can I always assume 
>> /Applications?

>There is no place "where applications are installed" on the Mac. An 
>application can be anywhere a user decides >to put them. On the desktop, on a 
>server, on a disk image. What would you use this information for? Why would 
>>you even care?

Ah, well, What I am trying to do is ensure what version and what application of 
ours they are running. Our app is a plugin and it can be put in a few locations 
and I want to know. I *can* always check the paths manually and decide, but 
yes, perhaps LaunchServices would be best.

Kyle, thank you for the link as well.

-ML
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: Where to find?

2010-05-10 Thread ML

Uli,

On 11.05.2010, at 00:15, ML wrote:
>> Ah, well, What I am trying to do is ensure what version and what application 
>> of ours they are running. Our app >>is a plugin and it can be put in a few 
>> locations and I want to know. I *can* always check the paths manually >>and 
>> decide, but yes, perhaps LaunchServices would be best.

>If your application is a plug-in, it is probably a bundle. In that case 
>NSBundle can be used to give you the >path to your file. Or if you want the 
>path to your host application, you can ask NSBundle for the mainBundle.

Indeed it is a bundle.

Thanks for the reference on NSBundle. I think that should work for me.

-ML
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Accessibility for NSTableView

2010-04-23 Thread Houdah - ML Pierre Bernard
Hi!

I have a table view which lists files.  I would like to make the represented 
objects available through Accessibility. I.e. I want to add 
NSAccessibilityURLAttribute and NSAccessibilityFilenameAttribute to the table 
rows.

So far, I have come up with this:

- (id)accessibilityHitTest:(NSPoint)point;
{
NSObject *row = [super accessibilityHitTest:point];

if (row != nil) {
@try {
NSNumber *rowNumber = [row valueForKey:@"row"];

NSObject *dataSource = [self dataSource];
ResultItem *resultItem = [dataSource tableView:self 
objectValueForTableColumn:nil row:[rowNumber intValue]];

[row accessibilitySetOverrideValue:[resultItem pathURL] 
forAttribute:NSAccessibilityURLAttribute];
[row accessibilitySetOverrideValue:[resultItem path] 
forAttribute:NSAccessibilityFilenameAttribute];
}
@catch (NSException *exception) {
NSLog(@"exception: %@", exception);
}
}

return row;
}

Sadly, this is not working. Neither attribute is visible in the Accessibility 
Inspector.

Best,
Pierre Bernard
Houdah Software s.à r.l.

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: Temporarily enabling layer backing for NSView

2011-06-18 Thread Houdah - ML Pierre Bernard
Try calling -display after -setWantsLayer:

The view needs to be drawn once into the layer before being able to animate.

Another way of achieving the desired result is to draw the initial and target 
view into images and then animate the swapping of image views.

Best,
Pierre Bernard
Houdah Software s.à r.l.

On Jun 18, 2011, at 6:33 AM, Indragie Karunaratne wrote:

> Super late reply here, but I just tried that and it still doesn't work. It 
> seems to work every now and then randomly but other times it doesn't work at 
> all. Sounds like some sort of timing issue.
> 
> On 2011-05-18, at 1:04 AM, Josh Abernathy wrote:
> 
>> Try doing the animation one runloop after calling -setWantsLayer:, kinda 
>> like this (typed in Mail):
>> 
>> - (void)doAnimation {
>>   [parentView setWantsLayer:YES];
>>   [self performSelector:@selector(noSeriouslyDoTheAnimation) withObject:nil 
>> afterDelay:0];
>> }
>> 
>> - (void) noSeriouslyDoTheAnimation {
>>   CATransition *transition = [CATransition animation];
>>   transition.type = kCATransitionPush;
>>   transition.subtype = kCATransitionFromLeft;
>>   transition.timingFunction = [CAMediaTimingFunction 
>> functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
>>   [CATransaction begin];
>>   [CATransaction setCompletionBlock:^(void) {
>>  [parentView setWantsLayer:NO];
>>   }];
>>   [parentView setAnimations:[NSDictionary dictionaryWithObject:transition 
>> forKey:@"subviews"]];
>>   [[parentView animator] replaceSubview:firstView with:secondView];
>>   [CATransaction commit];
>> }
>> 
>> 
>> On May 17, 2011, at 7:59 PM, Indragie Karunaratne wrote:
>> 
>>> Hi all,
>>> 
>>> I'm trying to use CATransition in my app to provide an animated slide 
>>> transition when swapping views. I don't want to permanently layer back my 
>>> views because they cause various glitches (no subpixel antialiasing, resize 
>>> issues when backed with a CATiledLayer, etc.) To get around this, I want to 
>>> temporarily layer back my view, run the animation, and then disable layer 
>>> backing after the animation completes. This is my code thus far:
>>> 
>>> CATransition *transition = [CATransition animation];
>>> transition.type = kCATransitionPush;
>>> transition.subtype = kCATransitionFromLeft;
>>> transition.timingFunction = [CAMediaTimingFunction 
>>> functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
>>> [parentView setWantsLayer:YES];
>>> [CATransaction begin];
>>> [CATransaction setCompletionBlock:^(void) {
>>>  [parentView setWantsLayer:NO];
>>> }];
>>> [parentView setAnimations:[NSDictionary dictionaryWithObject:transition 
>>> forKey:@"subviews"]];
>>> [[parentView animator] replaceSubview:firstView with:secondView];
>>> [CATransaction commit];
>>> 
>>> With this code, the animation doesn't run (the views just get swapped 
>>> without animation but the completion block is still called). The problem 
>>> seems to be the fact that I'm calling -setWantsLayer: immediately before 
>>> the animation begins. If I call this method in -awakeForNib, the animation 
>>> will run. I'm thinking that this might be some sort of runloop issue, but I 
>>> have no idea what I can do to work around this. I've tried moving my 
>>> -setWantsLayer: call to various places within the animation method but this 
>>> has no effect.
>>> 
>>> Any help is greatly appreciated.
>>> Thanks,
>>> Indragie
>>> 
>>> http://indragie.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/joshaber%40gmail.com
>>> 
>>> This email sent to josha...@gmail.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/pierre.bernard%40lists.houdah.com
> 
> This email sent to pierre.bern...@lists.houdah.com

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: making a clickable link in NSTableView

2011-06-19 Thread Houdah - ML Pierre Bernard
Hi!

Here is the solution I got from DTS:

http://dl.dropbox.com/u/2381634/DTS/TableViewLinks-updated.zip

At a later WWDC they introduced a more evolved version of the same code:

http://developer.apple.com/library/mac/#samplecode/CocoaTipsAndTricks/Introduction/Intro.html

Best,
Pierre Bernard
Houdah Software s.à r.l.


On Jun 19, 2011, at 1:08 PM, Rick C. wrote:

> Hello,
> 
> I currently have a NSTableView which displays a list of files and normally 
> the table view is not clickable or selectable.  In this list of files I 
> actually display the file path as a subtitle to the file name.  What I would 
> like to do is to turn that file path into a clickable link that when clicked 
> would do the equivalent of Reveal in Finder.  Ideally the file path in my 
> table view would look the way it does currently but when the mouse hovers 
> over it then the cursor would change to a hand indicating it's a link.  I'm 
> assuming I would have to turn the file path into an NSURL but could someone 
> point me in the right direction how to make all of this happen?  Thanks!
> 
> rc___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/pierre.bernard%40lists.houdah.com
> 
> This email sent to pierre.bern...@lists.houdah.com

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


NSRuleEditor: Criteria for new row

2009-12-22 Thread Houdah - ML Pierre Bernard
When I hit the "+" button on a row in NSRuleEditor, a new row is created. How 
can I take influence on the criteria used for that row.

It seems NSRuleEditor defaults to selecting the first criterion sequentially 
from the list of possible values. I would much rather have the new row match 
the row where the "+" was clicked.

Pierre

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: NSRuleEditor: Criteria for new row

2009-12-23 Thread Houdah - ML Pierre Bernard
I was able to fake it by subclassing a private method:

- (void)_addOptionFromSlice:(id)slice ofRowType:(unsigned int)type
{
int rowIndex = [(NSRuleEditorViewSlice*)slice rowIndex];

NSArray *criteriaForRow = [self criteriaForRow:rowIndex];
NSArray *displayValuesForRow = [self displayValuesForRow:rowIndex];

self.template = [NSArray arrayWithObjects:criteriaForRow, 
displayValuesForRow, nil];

[super _addOptionFromSlice:slice ofRowType:type];
}

- (void)insertRowAtIndex:(NSInteger)rowIndex 
withType:(NSRuleEditorRowType)rowType asSubrowOfRow:(NSInteger)parentRow 
animate:(BOOL)shouldAnimate
{
[super insertRowAtIndex:rowIndex withType:rowType 
asSubrowOfRow:parentRow animate:shouldAnimate];

NSArray *template = self.template;

if (template != nil) {
[self setCriteria:[template objectAtIndex:0] 
andDisplayValues:[template objectAtIndex:1] forRowAtIndex:rowIndex];
}
}

Pierre

On Dec 23, 2009, at 12:37 AM, Peter Ammon wrote:

> 
> On Dec 22, 2009, at 10:57 AM, Houdah - ML Pierre Bernard wrote:
> 
>> When I hit the "+" button on a row in NSRuleEditor, a new row is created. 
>> How can I take influence on the criteria used for that row.
>> 
>> It seems NSRuleEditor defaults to selecting the first criterion sequentially 
>> from the list of possible values. I would much rather have the new row match 
>> the row where the "+" was clicked.
>> 
>> Pierre
> 
> Sorry, this isn't possible right now.
> 

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


UINavigationController for desktop Cocoa?

2009-06-11 Thread Houdah - ML Pierre Bernard

Hi!

Has anyone already re-implemented UINavigationController for desktop  
Cocoa. That should be a cool thing to have.


Pierre

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend



___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


★★★★ Cocoa project for sale

2009-07-13 Thread Houdah - ML Pierre Bernard

HoudahStudy 2.0 (aka Ebbinghaus).
Study card software.
Late alpha / early beta. CoreData, CoreAnimation, GC, properties, …

Ebbinghaus 1.0 was freeware
2.0 is a complete rewrite. Not yet released.

Inquire via email to pierre.bern...@houdah.com
Current build available upon 
request___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


NSUndoManager vs @synthesize

2009-08-03 Thread Houdah - ML Pierre Bernard

Hi!

Do I still need to write my own accessors in order to perform  
NSUndoManager registration?


Could my model objects observe themselves and register undoable  
changes in observeValueForKeyPath:ofObject:change:context:  ?


How does CoreData go about registering changes with the undo manager?  
Is this done by @synthesize setter or by the NSManagedObjectContext  
watching the model objects?


Pierre
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


NSDateFormatter formats from NSLocale

2009-08-11 Thread Houdah - ML Pierre Bernard

Hi!

I am trying to format dates for display. So far I have been using this  
formatter:


	NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]  
autorelease];


[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
[dateFormatter setTimeStyle:kCFDateFormatterMediumStyle];


Now, I want to add leading zeros to days and month values. It seems  
there is no way of teaching the above formatter to do so. It goes with  
whatever format the user has set in System Preferences.


Thus I am trying the below formatter:

	NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]  
autorelease];


[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateFormat:@"dd/mm/yy hh:MM:ss a"];

This works fine, except for the fact that I have now hardcoded the  
fact that I display day/month/year rather than month/day/year.


It would seem that NSLocale should know about the user's preferences.  
Yet I can find no way to query it for date format.


Pierre
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: NSDateFormatter formats from NSLocale

2009-08-11 Thread Houdah - ML Pierre Bernard

Hi Sean,

I want to respect the user's locale, yet ignore his/her preferences as  
to formatting.


I thought about modifying the format I get from the standard styles. I  
would however expect NSLocale to know the correct order of elements in  
the date format.


Pierre

So you want to use the user's preference and yet you don't.  The  
choice

of leading zeros or no is part of the user's choice.  But if you must,
you could get the user's format string and carefully alter it to add
leading zeros.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada




___

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

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

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

This email sent to arch...@mail-archive.com


Re: NSDateFormatter formats from NSLocale

2009-08-11 Thread Houdah - ML Pierre Bernard
Figured out one way to get the desired result. But really don't like  
it. I'd much rather have NSLocal tell me if day or months value should  
go first.


Anyway, here it goes:

	NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]  
autorelease];


[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];

	NSMutableString *dateFormat = [NSMutableString stringWithString: 
[dateFormatter dateFormat]];


	[dateFormat replaceOccurrencesOfString:@"d" withString:@"dd" options: 
0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"ddd" withString:@"dd"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"ddd" withString:@"dd"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"M" withString:@"MM" options: 
0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"MMM" withString:@"MM"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"MMM" withString:@"MM"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"h" withString:@"hh" options: 
0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"hhh" withString:@"hh"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"hhh" withString:@"hh"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"m" withString:@"mm" options: 
0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"mmm" withString:@"mm"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"mmm" withString:@"mm"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"s" withString:@"ss" options: 
0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"sss" withString:@"ss"  
options:0 range:NSMakeRange(0, [dateFormat length])];
	[dateFormat replaceOccurrencesOfString:@"sss" withString:@"ss"  
options:0 range:NSMakeRange(0, [dateFormat length])];


[dateFormatter setDateFormat:dateFormat];
[dateFormatter setLenient:YES];

Pierre


On Aug 11, 2009, at 6:51 PM, Houdah - ML Pierre Bernard wrote:


Hi Sean,

I want to respect the user's locale, yet ignore his/her preferences  
as to formatting.


I thought about modifying the format I get from the standard styles.  
I would however expect NSLocale to know the correct order of  
elements in the date format.


Pierre

So you want to use the user's preference and yet you don't.  The  
choice
of leading zeros or no is part of the user's choice.  But if you  
must,

you could get the user's format string and carefully alter it to add
leading zeros.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada




___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/pierre.bernard%40lists.houdah.com

This email sent to pierre.bern...@lists.houdah.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 arch...@mail-archive.com


Re: User interface validation doesn't work, right?

2009-08-23 Thread Houdah - ML Pierre Bernard

Just ran into the same problem and came up with HHValidatedButton:
http://www.bernard-web.com/pierre/blog/index.php?id=6542976061063123843

Pierre Bernard

On Jul 1, 2009, at 11:24 PM, Bill Cheeseman wrote:

For years, the "Implementing Validation" section of Apple's "User  
Interface Validation" document has said  the following:


"Before it is displayed, a user interface item checks to see if its  
target implements validateUserInterfaceItem:. If it does, then the  
enabled status of the item is determined by the return value of the  
method. You can therefore conditionally enable or disable an item by  
implementing validateUserInterfaceItem: in the target object."


This has never been true. Right?

My custom window controller implements the action method for a  
button, so it is the button's target, and it also implements - 
validateUserInterfaceItem:, all according to the User Interface  
Validation document. But my -validateUserInterfaceItem: method is  
never called.


If I want it to be called automatically, by analogy to - 
validateMenuItem:, I have to override NSWindow's -update method, by  
analogy to -[NSMenu update]. In my override of -update, I have to do  
for myself what the document claims already happens -- or I have to  
observe NSWindow's -NSWindowDidUpdateNotification. Right?



--

Bill Cheeseman
b...@cheeseman.name

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/pierre.bernard%40lists.houdah.com

This email sent to pierre.bern...@lists.houdah.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 arch...@mail-archive.com


CATiledLayer documentation

2008-08-18 Thread Houdah - ML Pierre Bernard

Hi!

I would like to create a map view using several tile images: the map  
is made of tiles; tiles are available for various zoom levels.


Seems like CATiledLayer seems the right thing to use. Problem is that  
I can't seem to find any documentation beyond a rehash of the header  
file.


Is there any documentation? Is there sample code?

Pierre

___

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

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

2008-08-18 Thread Houdah - ML Pierre Bernard

Hi Bill!

I had indeed found your sample code. Which actually happens to be the  
only sample code I could find.


Unfortunately, the sample code left me confused. Seems to me that your  
drawing method always does the same thing. I find no notion of tiling.  
Obviously there is: when I set a breakpoint on the drawing method I  
can clearly see the view being drawn bit by bit. I just don't  
understand how it works.


Of course, I would have hoped for an example with multiple image  
source containing tiles.


I wanted to access the web site of your book. I was hoping for an  
eBook to purchase. The server however hasn't been responding all day.


Best,
Pierre Bernard
Houdah Software s.à r.l.

On 18 Aug 2008, at 19:16, Bill Dudney wrote:


Hi,

I have an example on my blog of using the CATiledLayer with a big  
pdf file and the CA book (I am the author) has an example of using  
image tiles.


http://www.pragprog.com/titles/bdcora
http://bill.dudney.net/roller/objc

Good luck,

-bd-

On Aug 18, 2008, at 10:37 AM, Houdah - ML Pierre Bernard wrote:


Hi!

I would like to create a map view using several tile images: the  
map is made of tiles; tiles are available for various zoom levels.


Seems like CATiledLayer seems the right thing to use. Problem is  
that I can't seem to find any documentation beyond a rehash of the  
header file.


Is there any documentation? Is there sample code?

Pierre

___

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

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

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


CoreData mystery: configuration used to open the store is incompatible...

2008-12-15 Thread Houdah - ML Pierre Bernard

Hi!

I am puzzled! I have run into this weirdest problem. It only happens  
if I target Tiger.


I am working on an update to HoudahGeo and suddenly, my current build  
refuses to open documents. This includes both existing documents and  
documents created by the running application. The error is:


Error Domain=NSCocoaErrorDomain Code=134020 UserInfo=0x2b7b10 "The  
model configuration used to open the store is incompatible with the  
one that was used to create the store."
NSUnderlyingException = Can't find table for entity MovieReference in  
database at URL file://localhost/Users/pierre/Desktop/HoudahGeo-Leopard.hgeo 
;


There is no MovieReference entity in the model. There never was.  
Actually I have seen the same message with varying entity names. I  
believe they are taken from other applications.


BTW, the model has not been updated in over a year. And most certainly  
not between saving and attempting to reopen using the same running  
application.


The stack is:

#0  0x96da7e17 in objc_exception_throw
#1  0x9496344b in -[NSSQLCore _ensureDatabaseMatchesModel]
#2  0x94962b35 in -[NSSQLCore load:]
#3	0x94958732 in -[NSPersistentStoreCoordinator  
addPersistentStoreWithType:configuration:URL:options:error:]
#4	0x915f5fe9 in -[NSPersistentDocument  
configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error 
:]
#5	0x915f6fab in - 
[NSPersistentDocument(NSPersistentDocumentDeprecated)  
configurePersistentStoreCoordinatorForURL:ofType:error:]

#6  0x915f63b6 in -[NSPersistentDocument readFromURL:ofType:error:]
#7  0x41c2 in -[Document readFromURL:ofType:error:] at Document.m:177
#8  0x913f16c6 in -[NSDocument initWithContentsOfURL:ofType:error:]
#9	0x913c1274 in -[NSDocumentController  
makeDocumentWithContentsOfURL:ofType:error:]
#10	0x913c0898 in -[NSDocumentController  
openDocumentWithContentsOfURL:display:error:]



This only happens when I target Tiger. When I target Leopard with the  
same code all works fine.

It occurs on both 10.5.5 and 10.5.6

When I compile an older version of the project, it works just fine.  
Thus I broke something with my recent changes. Yet I have no idea  
what. I did not touch the model.


Pierre
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: NSNetService & NSURLConnection on Tiger

2009-02-17 Thread Houdah - ML Pierre Bernard

Hi!

This is what I came up with:

@implementation NSNetService (ipv4)

- (NSArray*)ipv4addresses
{
NSMutableArray * ipv4addresses = [NSMutableArray array];
NSArray *addresses = [self addresses];
int aCount = [addresses count];
char addr[256];

for (int i = 0; i < aCount; i++) {
		struct sockaddr *socketAddress = (struct sockaddr *)[[addresses  
objectAtIndex:i] bytes];


if (socketAddress && socketAddress->sa_family == AF_INET) {
			if (inet_ntop(AF_INET, &((struct sockaddr_in *)socketAddress)- 
>sin_addr, addr, sizeof(addr))) {


uint16_t port = ntohs(((struct sockaddr_in *)socketAddress)- 
>sin_port);


[ipv4addresses addObject:[NSString stringWithFormat:@"%s:%d",  
addr, port]];

}
}
}

return ipv4addresses;
}

@end

Pierre

On 17 Feb 2009, at 21:32, Kyle Sluder wrote:


See the documentation for -[NSNetService addresses].  You can use that
to go from NSNetService -> NSData -> sockaddr_in -> NSURL ->
NSURLConnection.

--Kyle Sluder
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/pierre.bernard%40lists.houdah.com

This email sent to pierre.bern...@lists.houdah.com


- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend



___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


Re: NSInMemoryStoreType: Not really "persistent", is it?

2008-10-22 Thread Houdah - ML Pierre Bernard
(I did a little demo app at one point long ago that used an in  
memory store to cache results from Amazon's web services API.   The  
front end was all pure Cocoa / bindings / CD with a minimal amount  
of additional code to pull data from amazon and push it into the  
local store).


Is that demo available some place?

Pierre

___

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

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


NSRuleEditor/NSPredicateEditor selected rows

2008-10-31 Thread Houdah - ML Pierre Bernard

Hi!

NSRuleEditor has the concept of selected rows in its API. I however  
see no visual clues of which rows are selected.


Is it possible to subclass whatever cell view is used by the rule  
editor to add such a visual clue?


Pierre

___

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

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


Window title bar accessory view

2008-11-18 Thread Houdah - ML Pierre Bernard

Hi!

I would like to replicate the accessory views found in the top right  
of window title bars. Examples include Coda, iCal, Safari,...


How can I add subviews to the window's title bar?

Pierre
___

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

Please do not post admin requests or moderator comments to the list.
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: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard

Hi Andrew,

No I am not talking about the toolbar.

I am referring to the lock icon and the new green certificate  
information text displayed by Safari in the window's title bar.

iCal displays a pop-up menu where one can pick the time zone.

Pierre


On 19 Nov 2008, at 03:52, Andrew Merenbach wrote:


On Nov 18, 2008, at 6:26 PM, Houdah - ML Pierre Bernard wrote:


Hi!

I would like to replicate the accessory views found in the top  
right of window title bars. Examples include Coda, iCal, Safari,...


How can I add subviews to the window's title bar?

Pierre


Greetings, Pierre,

I think that what you're referring to is the toolbar (class  
NSToolbar), as I don't see anything besides that at the top of my  
iCal or Safari windows.  (On Leopard, the Unified Title/Toolbar  
setting in Interface Builder, or through code, makes the title bar,  
which is actually separate, look connected to the toolbar.)


If you can afford to target Leopard-only and are willing to put up  
with a slightly buggy interface, you can use Interface Builder to  
set up the toolbar in the window itself and store it in the nib or  
xib that way.  Otherwise, if for whatever reason that won't work for  
you*, you may wish to use a toolbar delegate to handle the  
configuration of the toolbar.  The docs have much more info, as well  
as "dos" and "dont's" of toolbars (for instance: anything in a  
toolbar, last I checked, should have a menu item equivalent; thus if  
you have a Reset button or a Send button or whatnot in your toolbar,  
there should be a Reset or Send menu item, accessible from the menu  
bar).  Hope this helps!


* Selectable toolbar items are one example of why the Interface  
Builder approach may no work for you -- such items are not currently  
configurable in IB.  (They're the sort of item used in the iTunes  
preferences window, where they act like push-buttons of which only  
one can be selected at a time.)


Cheers,
Andrew



___

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

Please do not post admin requests or moderator comments to the list.
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: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard

Hi Kyle!

Thanks a lot.

This sounds like a great idea. I will give it a try ASAP.

Pierre

On 19 Nov 2008, at 04:03, Kyle Sluder wrote:


On Tue, Nov 18, 2008 at 9:26 PM, Houdah - ML Pierre Bernard
<[EMAIL PROTECTED]> wrote:
I would like to replicate the accessory views found in the top  
right of

window title bars. Examples include Coda, iCal, Safari,...


Are you talking about things like the little lock icon in HTTPS Safari
windows?  If so, use -[NSWindow standardWindowButton:] to get an
NSButton instance, and then use -[NSView superview] to get at the
window frame view.  Then use -[NSView addSubview:] to add your custom
view and position it accordingly.

--Kyle Sluder


___

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

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

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

This email sent to [EMAIL PROTECTED]


Drag & Drop: PREVENT file move

2008-12-11 Thread Houdah - ML Pierre Bernard

Hi!

My application shows a list of files in a table view.

I have implemented drag and drop so that users may drag files from the  
list. I could envision them dragging the files onto other applications  
for viewing or dragging them on a removable media to create archive  
copies.


The problem occurs when the user drags the file to another folder on  
the same disk. By default, the Finder then wants to move the file. I  
need to prevent just that as it will cause havoc. For one, I would  
lose track of the file.


Is there a way for the originating application to control the allowed  
drag operations?


Best,
Pierre Bernard
___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com


CoreImage: bend frame with shadow

2009-03-08 Thread Houdah - ML Pierre Bernard

Hi!

I remember someone posting code to their blog / web site showing how  
to frame a slightly bend image and add a shadow to it: Much like a  
sticker peeling off.


I can't find the link anymore.

Best,
Pierre Bernard

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend



___

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

Please do not post admin requests or moderator comments to the list.
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 arch...@mail-archive.com