Re: Question on NSTableViewDataSource Protocol

2014-05-15 Thread Graham Cox

On 16 May 2014, at 11:18 am, Varun Chandramohan  
wrote:

> [_tableContents removeAllObjects];


I wouldn't do this, because it invalidates the value of 'row', which may be 
assumed by the table code to remain valid. Implementation details may change on 
different systems, and so this might be OK on 10.9, but fail on earlier. The 
assertion seems definitely to do with an invalid row index.

--Graham



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: where to put persistent storage for command-line app

2014-05-15 Thread Roland King
~/Library/Application Support 

is what I consider to be the standard place for persistent storage. I'd always 
start getting library from URLSForDirectory:inDomains: for the 
NSLibraryDirectory and go from there. 

Also, if you sandbox the tool at some point, you'll get a NSLibraryDirectory 
directory which has that structure (/Library/Application Support) 
which would make sandboxing a little more direct. 

On 16 May, 2014, at 2:11 pm, Rui Pacheco  wrote:

> Isn't /Application Support/ the standard?
> 
> 
> On 16 May 2014 05:47, William Squires  wrote:
> 
>> Should I put it in /Library/Application\ Support/ or /Library/Preferences,
>> or somewhere else?
>> 
>> 
>> ___
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/rui.pacheco%40gmail.com
>> 
>> This email sent to rui.pach...@gmail.com
> 
> 
> 
> 
> -- 
> 
> Rui Pacheco
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: where to put persistent storage for command-line app

2014-05-15 Thread Rui Pacheco
Isn't /Application Support/ the standard?


On 16 May 2014 05:47, William Squires  wrote:

> Should I put it in /Library/Application\ Support/ or /Library/Preferences,
> or somewhere else?
>
>
> ___
>
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/rui.pacheco%40gmail.com
>
> This email sent to rui.pach...@gmail.com




-- 

Rui Pacheco
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Question on NSTableViewDataSource Protocol

2014-05-15 Thread Jerry Krinock

On 2014 May 15, at 18:18, Varun Chandramohan  
wrote:

> This is bad idea as I am doing this inside " performInsertWithDragInfo" 
> before I return from tableView:(NSTableView *)tableView 
> acceptDrop:(id)info row:(NSInteger)row 
> dropOperation:(NSTableViewDropOperation)dropOperation which looks wrong to me.

I don’t see anything wrong with that.

> Am I missing something?

Well, whenever you have code that does not work in earlier systems, there’s a 
good chance that you’re dealing with a bug in the system.  However, this line 
of code in your data source method that adds a row…

>  [_tableContents removeAllObjects];

followed by, it looks like, repopulating _tableContents from scratch looks to 
me like a brute force, problematic and definitely non-standard way of adding a 
row to a table / object to a data model.  Avoid touching the existing objects.  
That might help with the assertion issue.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: where to put persistent storage for command-line app

2014-05-15 Thread Kyle Sluder
On May 15, 2014, at 8:47 PM, William Squires  wrote:
> 
> Should I put it in /Library/Application\ Support/ or /Library/Preferences, or 
> somewhere else?

Definitely not in ~/Library/Preferences, unless you are using NSUserDefaults.

What kind of persistent storage are you talking about? Traditionally, command 
line utilities store their preferences in plaintext dot files in the user’s 
home directory. If your command line tool is intended to be invoked directly, 
you should either honor that convention or use NSUserDefaults for your 
preferences.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

where to put persistent storage for command-line app

2014-05-15 Thread William Squires
Should I put it in /Library/Application\ Support/ or /Library/Preferences, or 
somewhere else?


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Question on NSTableViewDataSource Protocol

2014-05-15 Thread Varun Chandramohan
Hi All,

I was playing around with dragging items into NSTableView and I ran into a 
interesting problem. When I drag an item into my table, the following delegate 
gets called.


- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id)info 
row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation {

[self performInsertWithDragInfo:info row:row];

return YES;

}

Since I am returning YES, we are accepting this drop. In 
"performInsertWithDragInfo", I have a requirement to save the new add into a 
file and then parse through NSArray which is my data source and might make some 
modifications. After the modifications, I reload the datasource and repopulate 
the tableview.


[_tableContents removeAllObjects];

for (NSString *fileStr in filtered) {

NSURL *fileURL = [NSURL URLWithString:[fileStr 
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

DesktopEntity *entity = [DesktopEntity entityForURL:fileURL];

if ([entity isKindOfClass:[DesktopEntity class]])

[_tableContents addObject:entity];

}

[ltableView reloadData];

This is bad idea as I am doing this inside " performInsertWithDragInfo" before 
I return from tableView:(NSTableView *)tableView 
acceptDrop:(id)info row:(NSInteger)row 
dropOperation:(NSTableViewDropOperation)dropOperation which looks wrong to me. 
However I did not observe any issues on 10.9 where I extensively tested this. 
When I ran the same code on 10.7 I started noticing issues.

May 16 09:49:55 Mac-107-Test-Machine GUD[13022]: *** Assertion failure in 
-[NSTableRowData _addRowViewForVisibleRow:withPriorView:], 
/SourceCache/AppKit/AppKit-1138.51/TableView.subproj/NSTableRowData.m:2484
May 16 09:49:55 Mac-107-Test-Machine GUD[13022]: Row 1 should be in the valid 
visible section
I don't know why this is not seen in 10.9.
Is there any delegate that would get called after acceptDrop? In the 
documentation I saw tableView:draggingSession:endedAtPoint:operation: but I 
don't think its relevant here. Am I missing something?

Regards,
Varun
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Alex Zavatone
Of course.  That's why I said "it appears you're doing this on iOS".  

But it's always nice to not have to read in and figure out which platform the 
person is targeting.

If anyone's ever been on a dev team and had a back and forth with QA 
continually asking for more info, you know what I'm talking about.

Just mention the platform as if you were submitting a bug report to make the 
specifics clear to the people who are taking their time to help out.

If someone has a problem in Xcode and it's in version 3.x, wouldn't you like to 
know that before you consider spending any of your time to help?

Cheers.

On May 15, 2014, at 3:32 PM, Kyle Sluder wrote:

> On Thu, May 15, 2014, at 12:10 PM, Alex Zavatone wrote:
>> It appears as if you're doing this on iOS (even though you didn't mention
>> the platform).
> 
> Considering UIAlertView only exists on iOS, along with any other UI*
> prefixed class names, I would think that iOS would be obvious.
> 
> --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: DNS Lookup

2014-05-15 Thread Mike Abdullah

On 15 May 2014, at 14:15, Appa Rao Mulpuri  wrote:

> Hi List,
> 
> In Webkit, do we have any provision to provide application level DNS lookup 
> map to route the particular URLs to a IP address?
> 
> Similar like /private/etc/hosts file, trying to maintain a map at application 
> level with DNS name as key and array of IP addresses, which will provide the 
> webpage.  When ever my application trigger a request to load a embedded web 
> page, it would lookup at the DNS name and pick any of the responding IP 
> address from the map.
> 
> Understood, this is kind of Hackers way,  looking for some workable APIs. 
> Appreciated any third party libraries are available.

WebKit uses the Cocoa URL loading system. You can register your own custom 
NSURLProtocol to override and handle URLs in almost any way you like.


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

NSDatePicker : Displaying and binding to nil.

2014-05-15 Thread Jonathan Mitchell
NSDatePicker cannot display or bind to a nil dateValue so I have put together 
something that might be of use when binding to NSDate instances that might be 
nil.

https://github.com/ThesaurusSoftware/TFDatePicker

Subclassing NSDatePickerCell is made difficult because NSDatePickerCell does 
not call - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView 
*)controlView to draw its interior.
I therefore obscure the controls persistent dateValue by setting the fore and 
background colours equal.

If anyone can think of a better approach I would be glad to hear it.

Jonathan













___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Client certificate extraction out of SSL/TLS Connection on server side

2014-05-15 Thread Ben Kennedy
As a workaround, couldn't you just empirically determine the value of that 
constant (presuming it hasn't changed in five years and is not expected to 
change), and then define a new constant of your own accordingly?

b

Sent from my iPhone

> On May 15, 2014, at 1:06 PM, Jens Alfke  wrote:
> 
> I went back and looked into some earlier code of mine that can do this (the 
> MYNetwork framework, available on Github). The good news is that I know what 
> stream property to set. The bad news is that it’s not in any public header, 
> even though this omission has been known for five years or more. And the 
> really bad news is that using the constant this way will invalidate your app 
> from the iOS or Mac app store :(
> 
> #if !TARGET_OS_IPHONE
> // You can't do client-side SSL auth using CFStream without this constant,
> // but it was accidentally not declared in a public header.
> // Unfortunately you can't use this on iPhone without Apple rejecting your app
> // for using "private API". :-(
> extern const CFStringRef _kCFStreamPropertySSLClientSideAuthentication; // in 
> CFNetwork
> #endif
> 
> —Jens
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/ben%40zygoat.ca
> 
> This email sent to b...@zygoat.ca

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Update: this sequence of steps is a workaround that avoids the problem:

1. Setting the view that should remain invisible hidden;
2. Setting clipsToBounds on its parent to NO;
3. Now create and show the alert;
4. On a tap on the 'OK' button, reverse 1 and 2, meaning:
5. Set clipsToBounds on the parent to YES;
6. Setting the view that should remain invisible's hidden property to NO.

This is not problematic because the UIAlertView takes over the entire 
interface, so there is no harm in making it impossible for the hidden view to 
animate into my visible area.

Nevertheless, it does seem strange I need these steps to have a normal 
UIAlertView experience in my use case, so I'm still very interested in helpful 
feedback!







Op May 15, 2014, om 8:23 PM heeft Diederik Meijer | Ten Horses 
 het volgende geschreven:

> Hi David,
> 
> Many thanks for your quick response!
> 
> UIAlertView is called here:
> 
> -(void)welcomeAlert {
>if (![[NSUserDefaults standardUserDefaults] 
> objectForKey:@"welcomeAlertShown"] || [[[NSUserDefaults standardUserDefaults] 
> valueForKey:@"welcomeAlertShown"] isEqual:@"NO"]) {
>UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Welcome to 365 
> days of Flow!" message:@"\nPlease swipe left or right to browse\n\nTap the 
> screen to find the menu for more options" delegate:nil 
> cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
>[av show];
>[[NSUserDefaults standardUserDefaults] setValue:@"YES" 
> forKey:@"welcomeAlertShown"];
>[[NSUserDefaults standardUserDefaults] synchronize];
>}
> }
> 
> 
> 
> So indeed, simply by 'show'.
> 
> 
> View hierarchy is as follows:
> 
> ViewController's view
>   UIImageView for fullscreen background image (image changes when user 
> scrolls, the UIScrollView below)
>   UIImageView for transparent PNG background image (image changes when 
> user scrolls, the UIScrollView below)
>   UIView (the centred iPhone5-like view)
>   UIScrollView
>   3 UILabels (for the date strings)
>   3 UIImageViews (for the images)
>   UIView (separate view with sharing buttons, shown/hidden by 
> button click)
>   UIView (Date selector view with UIPickerView, kept offscreen, 
> animates into
> 
> Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png
> 
> As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, 
> I have no problems with the alert, but then my last UIView (Date selector 
> view) becomes visible, which is something I can't have…
> 
> To me it seems the view hierarchy is slightly complex, but not to any kind of 
> extreme.
> 
> Many thanks again,
> 
> Diederik
> 
> 
> 
> 
> 
> Op May 15, 2014, om 6:53 PM heeft David Duncan  het 
> volgende geschreven:
> 
>> 
>> On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
>>  wrote:
>> 
>>> Dear list,
>>> 
>>> I implemented a very straightforward UIAlertView.
>>> 
>>> For some reason, on iPad, a light rectangular appears behind the alertview, 
>>> here is what it looks like:
>>> 
>>> http://www.tenhorses.com/apps/alertScreenshot.jpg
>>> 
>>> What makes it strange is that that light rectangle is not visible when I 
>>> take a screenshot, see jpg
>>> 
>>> This only happens on iPad, not on iPhone.
>>> 
>>> The centre part (the white card on the larger background) is a UIView that 
>>> has a number of subviews.
>>> 
>>> This UIView has clipsToBounds set to yes, because I have subviews flying in 
>>> with animations.
>>> 
>>> If I set clipsToBounds to NO, then the alertview is shown normally without 
>>> any issues.
>>> 
>>> Has anybody run into this and is there a way to fix this?
>> 
>> When it doesn’t appear in screenshots it usually means its a transient 
>> compositing error (as the screenshot re-composites the screen).
>> 
>> I’m not certain what exactly would cause this, but you might be served by 
>> better describing your view hierarchy (and I assume you are showing your 
>> alert with the -show method, and that it is a plain UIAlertView and not a 
>> subclass).
>> 
>>> 
>>> Many thanks,
>>> 
>>> Diederik
>>> 
>>> 
>>> ___
>>> 
>>> 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:
>>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
>>> 
>>> This email sent to david.dun...@apple.com
>> 
>> --
>> David Duncan
>> 
>> 
> 
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenh

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Kyle Sluder
On Thu, May 15, 2014, at 12:10 PM, Alex Zavatone wrote:
> It appears as if you're doing this on iOS (even though you didn't mention
> the platform).

Considering UIAlertView only exists on iOS, along with any other UI*
prefixed class names, I would think that iOS would be obvious.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Alex Zavatone
It appears as if you're doing this on iOS (even though you didn't mention the 
platform).  In this case, can't you run this through the Simulator and turn on 
the coloring options under the Debug menu?

On May 15, 2014, at 2:23 PM, Diederik Meijer | Ten Horses wrote:

> Hi David,
> 
> Many thanks for your quick response!
> 
> UIAlertView is called here:
> 
> -(void)welcomeAlert {
>if (![[NSUserDefaults standardUserDefaults] 
> objectForKey:@"welcomeAlertShown"] || [[[NSUserDefaults standardUserDefaults] 
> valueForKey:@"welcomeAlertShown"] isEqual:@"NO"]) {
>UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Welcome to 365 
> days of Flow!" message:@"\nPlease swipe left or right to browse\n\nTap the 
> screen to find the menu for more options" delegate:nil 
> cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
>[av show];
>[[NSUserDefaults standardUserDefaults] setValue:@"YES" 
> forKey:@"welcomeAlertShown"];
>[[NSUserDefaults standardUserDefaults] synchronize];
>}
> }
> 
> 
> 
> So indeed, simply by 'show'.
> 
> 
> View hierarchy is as follows:
> 
> ViewController's view
>   UIImageView for fullscreen background image (image changes when user 
> scrolls, the UIScrollView below)
>   UIImageView for transparent PNG background image (image changes when 
> user scrolls, the UIScrollView below)
>   UIView (the centred iPhone5-like view)
>   UIScrollView
>   3 UILabels (for the date strings)
>   3 UIImageViews (for the images)
>   UIView (separate view with sharing buttons, shown/hidden by 
> button click)
>   UIView (Date selector view with UIPickerView, kept offscreen, 
> animates into
> 
> Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png
> 
> As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, 
> I have no problems with the alert, but then my last UIView (Date selector 
> view) becomes visible, which is something I can't have…
> 
> To me it seems the view hierarchy is slightly complex, but not to any kind of 
> extreme.
> 
> Many thanks again,
> 
> Diederik
> 
> 
> 
> 
> 
> Op May 15, 2014, om 6:53 PM heeft David Duncan  het 
> volgende geschreven:
> 
>> 
>> On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
>>  wrote:
>> 
>>> Dear list,
>>> 
>>> I implemented a very straightforward UIAlertView.
>>> 
>>> For some reason, on iPad, a light rectangular appears behind the alertview, 
>>> here is what it looks like:
>>> 
>>> http://www.tenhorses.com/apps/alertScreenshot.jpg
>>> 
>>> What makes it strange is that that light rectangle is not visible when I 
>>> take a screenshot, see jpg
>>> 
>>> This only happens on iPad, not on iPhone.
>>> 
>>> The centre part (the white card on the larger background) is a UIView that 
>>> has a number of subviews.
>>> 
>>> This UIView has clipsToBounds set to yes, because I have subviews flying in 
>>> with animations.
>>> 
>>> If I set clipsToBounds to NO, then the alertview is shown normally without 
>>> any issues.
>>> 
>>> Has anybody run into this and is there a way to fix this?
>> 
>> When it doesn’t appear in screenshots it usually means its a transient 
>> compositing error (as the screenshot re-composites the screen).
>> 
>> I’m not certain what exactly would cause this, but you might be served by 
>> better describing your view hierarchy (and I assume you are showing your 
>> alert with the -show method, and that it is a plain UIAlertView and not a 
>> subclass).
>> 
>>> 
>>> Many thanks,
>>> 
>>> Diederik
>>> 
>>> 
>>> ___
>>> 
>>> 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:
>>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
>>> 
>>> This email sent to david.dun...@apple.com
>> 
>> --
>> David Duncan
>> 
>> 
> 
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Hi David,

Many thanks for your quick response!

UIAlertView is called here:

-(void)welcomeAlert {
if (![[NSUserDefaults standardUserDefaults] 
objectForKey:@"welcomeAlertShown"] || [[[NSUserDefaults standardUserDefaults] 
valueForKey:@"welcomeAlertShown"] isEqual:@"NO"]) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Welcome to 365 
days of Flow!" message:@"\nPlease swipe left or right to browse\n\nTap the 
screen to find the menu for more options" delegate:nil cancelButtonTitle:@"OK" 
otherButtonTitles:nil, nil];
[av show];
[[NSUserDefaults standardUserDefaults] setValue:@"YES" 
forKey:@"welcomeAlertShown"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}



So indeed, simply by 'show'.


View hierarchy is as follows:

ViewController's view
UIImageView for fullscreen background image (image changes when user 
scrolls, the UIScrollView below)
UIImageView for transparent PNG background image (image changes when 
user scrolls, the UIScrollView below)
UIView (the centred iPhone5-like view)
UIScrollView
3 UILabels (for the date strings)
3 UIImageViews (for the images)
UIView (separate view with sharing buttons, shown/hidden by 
button click)
UIView (Date selector view with UIPickerView, kept offscreen, 
animates into

Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png

As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, I 
have no problems with the alert, but then my last UIView (Date selector view) 
becomes visible, which is something I can't have…

To me it seems the view hierarchy is slightly complex, but not to any kind of 
extreme.

Many thanks again,

Diederik





Op May 15, 2014, om 6:53 PM heeft David Duncan  het 
volgende geschreven:

> 
> On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
>  wrote:
> 
>> Dear list,
>> 
>> I implemented a very straightforward UIAlertView.
>> 
>> For some reason, on iPad, a light rectangular appears behind the alertview, 
>> here is what it looks like:
>> 
>> http://www.tenhorses.com/apps/alertScreenshot.jpg
>> 
>> What makes it strange is that that light rectangle is not visible when I 
>> take a screenshot, see jpg
>> 
>> This only happens on iPad, not on iPhone.
>> 
>> The centre part (the white card on the larger background) is a UIView that 
>> has a number of subviews.
>> 
>> This UIView has clipsToBounds set to yes, because I have subviews flying in 
>> with animations.
>> 
>> If I set clipsToBounds to NO, then the alertview is shown normally without 
>> any issues.
>> 
>> Has anybody run into this and is there a way to fix this?
> 
> When it doesn’t appear in screenshots it usually means its a transient 
> compositing error (as the screenshot re-composites the screen).
> 
> I’m not certain what exactly would cause this, but you might be served by 
> better describing your view hierarchy (and I assume you are showing your 
> alert with the -show method, and that it is a plain UIAlertView and not a 
> subclass).
> 
>> 
>> Many thanks,
>> 
>> Diederik
>> 
>> 
>> ___
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
>> 
>> This email sent to david.dun...@apple.com
> 
> --
> David Duncan
> 
> 

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Client certificate extraction out of SSL/TLS Connection on server side

2014-05-15 Thread Jens Alfke
I went back and looked into some earlier code of mine that can do this (the 
MYNetwork framework, available on Github). The good news is that I know what 
stream property to set. The bad news is that it’s not in any public header, 
even though this omission has been known for five years or more. And the really 
bad news is that using the constant this way will invalidate your app from the 
iOS or Mac app store :(

#if !TARGET_OS_IPHONE
// You can't do client-side SSL auth using CFStream without this constant,
// but it was accidentally not declared in a public header.
// Unfortunately you can't use this on iPhone without Apple rejecting your app
// for using "private API". :-(
extern const CFStringRef _kCFStreamPropertySSLClientSideAuthentication; // in 
CFNetwork
#endif

—Jens
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread David Duncan

On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
 wrote:

> Dear list,
> 
> I implemented a very straightforward UIAlertView.
> 
> For some reason, on iPad, a light rectangular appears behind the alertview, 
> here is what it looks like:
> 
> http://www.tenhorses.com/apps/alertScreenshot.jpg
> 
> What makes it strange is that that light rectangle is not visible when I take 
> a screenshot, see jpg
> 
> This only happens on iPad, not on iPhone.
> 
> The centre part (the white card on the larger background) is a UIView that 
> has a number of subviews.
> 
> This UIView has clipsToBounds set to yes, because I have subviews flying in 
> with animations.
> 
> If I set clipsToBounds to NO, then the alertview is shown normally without 
> any issues.
> 
> Has anybody run into this and is there a way to fix this?

When it doesn’t appear in screenshots it usually means its a transient 
compositing error (as the screenshot re-composites the screen).

I’m not certain what exactly would cause this, but you might be served by 
better describing your view hierarchy (and I assume you are showing your alert 
with the -show method, and that it is a plain UIAlertView and not a subclass).

> 
> Many thanks,
> 
> Diederik
> 
> 
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

--
David Duncan


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Not getting mouseDown: called when control-clicking in view in menu item

2014-05-15 Thread Tim Hewett
I have a NSMenuItem with a custom view (inheriting from NSImageView) which 
needs to react to mouseDown: events. An NSTrackingArea has been setup for the 
view’s frame to enable this.

When getting the events the modifierFlags are used to change behaviour, but 
this doesn’t work when control is held down - no mouseDown: event occurs at all 
(no problem with other modifier keys).

If mouseDown: is called with no modifier keys held down and then control is 
pressed, this can be seen in the modifier flags when the mouseUp: event occurs.

The TrackView in the MenuItemView sample code has been tested and gets 
mouseDown: events including when control is held down, the only difference 
seems to be that the view in that sample is defined in a XIB while the problem 
code’s view is created programmatically. 

Is there a way that this app can get mouseDown: events when control is being 
held down?
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
Well, that's not fun. It's been a while since I tried it out, though. Well, 
write up some bugs, and if you have a sample app showing what you need, it'll 
at least get addressed. Speech is a priority although the forms of that 
priority might be different than we expect. And, if you are one of us going to 
WWDC in a couple of weeks, be ready to talk with whatever group you'll need to; 
that's how I found out the cause of the memory leak bug by one of the team 
members bringing up the source code right there.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On May 15, 2014, at 8:38 AM, "Gerriet M. Denkmann"  
> wrote:
> 
> 
>> On 15 May 2014, at 22:12, Gary L. Wade  wrote:
>> 
>> If you need the phonemes, look at the willSpeakPhoneme delegate method. You 
>> can use it in conjunction with the other delegates in a manner like NSString 
>> enumerates sentences and words―not a perfect comparison, but it should help 
>> you conceptually.
> 
> Unfortunately the documentation says about 
> speechSynthesizer:willSpeakPhoneme: 
> "This method is not sent for modern voices." And this seems indeed to be the 
> case.
> 
> Another problem with: speechSynthesizer:willSpeakWord:ofString: - while it 
> works fine for German or Chinese, it gives complete garbage for Thai.
> 
>> 
>> If I recall, the feedback window solves a very narrow need, one that didn't 
>> help me much, so I didn't explore it, especially since the delegate methods 
>> gave me what I needed.
>> 
>> I wouldn't doubt that NSSpeechSynthesizer gets deprecated in favor of the AV 
>> variety based on the way Apple has historically ported underlying 
>> technologies between platforms, but if not or you need to support older 
>> OSes, be careful about some of its property retrieval methods, especially 
>> the phoneme dictionary per voice, since in at least one OS and earlier it 
>> returned a retained object vs an autoreleased object against the Objective-C 
>> memory naming contract.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On May 15, 2014, at 5:53 AM, "Gerriet M. Denkmann"  
>>> wrote:
>>> 
>>> 
 On 15 May 2014, at 15:53, Gary L. Wade  
 wrote:
 
 Also, I haven’t tried this sequence myself, but I noticed in your sample 
 code you’re
 calling phonemesFromText: right after startSpeakingString:.  Maybe
 phonemesFromText: is short-circuiting the speaking?
>>> 
>>> Right on! 
>>> Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to 
>>> hear all my new voices.
>>> 
>>> But: phonemesFromText: still returns an empty string.
>>> This is a pity, because getting the phonemes is the goal of the whole 
>>> exercise.
>>> 
>>> With or without delegate.
>>> 
>>> Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever 
>>> with any voice.
>>> 
>>> 
 It’s been a while
 since I’ve worked on my app, but I remember some calls will stop any
 current speaking.
 --
 Gary L. Wade
 http://www.garywade.com/
 
 On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:
 
 
> 
>> On 15 May 2014, at 08:41, Jens Alfke  wrote:
>> 
>> On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
>> wrote:
>> 
>>> But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
>>> has 24 voices (which is nice) but all 24 have VoiceLanguage =
>>> VoiceLocaleIdentifier = en_US (which seems rather odd).
>> 
>> The non-English voices are optional downloads ― you can get them via
>> the Dictation/Speech system pref pane. Pull down the System Voice pop-up
>> and choose Customize…
> 
> Thanks. Just did that.
> 
> Did set System Voice to "Anna" (a German voice).
> Now, when I select some (German) text and do Control-Click → Speech →
> Start Speaking it just works. Very good.
> 
> But this:
> 
> NSString *voiceIdentifier =
> @"com.apple.speech.synthesis.voice.anna.premium";
> NSString *text = @"Der Osten ist rot.";
> NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
> initWithVoice: voiceIdentifier ];//non-nil
> BOOL ok = [ syn startSpeakingString: text ];//returns YES, but 
> does
> NOT speak
> NSString *pp = [ syn phonemesFromText: text ];//returns empty 
> string
> 
> does not work as expected.
> Same problem with all other voices I just downloaded. Only the default
> (en-US) voices work as they should.
> 
> What am I missing?
> 
> 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Obtain an NSDate object from any casually entered user string

2014-05-15 Thread Sean McBride
On Thu, 15 May 2014 07:53:01 -0500, Charles Srstka said:

>> 3. But sometimes the date of NSDataDetector is 12h ahead (again
>ignoring fractions of a second):
>> 
>> "2014-05-15 07:52:18.658" →  "2014-05-15 19:52:18  +0700"
>> "2014-05-14 05:59:46.490 +0700" → "2014-05-14 17:59:46.490 +0700"
>> 
>> But not always - these work ok:
>> "2014-05-15 08:22:48.135"
>> "2014-05-15 09:15:35 +0700"
>> Also, all times after about 13:00 are correct.
>> 
>> This arbitrary advancement of 12h is obviously NOT acceptable.
>> What am I doing wrong?
>
>That's the trouble with accepting arbitrary user input. If a user enters
>a time of "1:23", s/he might mean 1:23 AM, 1:23 PM, or 1:23 military
>time, and there's no real way to determine which is intended without
>reading the user's mind. So, the system has to guess. Sometimes it may
>not guess correctly.

True.  But it's a pretty strange guess that "2014-05-15 07:52:18.658" is 
afternoon.  If the user uses an am/pm system, then it's 50/50.  If the user 
uses a 24 hour system, there's no ambiguity.  So it's more probably a morning 
time.

Also, the guessing logic should check if the user uses 24 hour clock, which 
maybe it does or maybe not.

Cheers,

-- 

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann

On 15 May 2014, at 22:12, Gary L. Wade  wrote:

> If you need the phonemes, look at the willSpeakPhoneme delegate method. You 
> can use it in conjunction with the other delegates in a manner like NSString 
> enumerates sentences and words—not a perfect comparison, but it should help 
> you conceptually.

Unfortunately the documentation says about speechSynthesizer:willSpeakPhoneme: 
"This method is not sent for modern voices." And this seems indeed to be the 
case.

Another problem with: speechSynthesizer:willSpeakWord:ofString: - while it 
works fine for German or Chinese, it gives complete garbage for Thai.

> 
> If I recall, the feedback window solves a very narrow need, one that didn't 
> help me much, so I didn't explore it, especially since the delegate methods 
> gave me what I needed.
> 
> I wouldn't doubt that NSSpeechSynthesizer gets deprecated in favor of the AV 
> variety based on the way Apple has historically ported underlying 
> technologies between platforms, but if not or you need to support older OSes, 
> be careful about some of its property retrieval methods, especially the 
> phoneme dictionary per voice, since in at least one OS and earlier it 
> returned a retained object vs an autoreleased object against the Objective-C 
> memory naming contract.
> --
> Gary L. Wade (Sent from my iPhone)
> http://www.garywade.com/
> 
>> On May 15, 2014, at 5:53 AM, "Gerriet M. Denkmann"  
>> wrote:
>> 
>> 
>>> On 15 May 2014, at 15:53, Gary L. Wade  wrote:
>>> 
>>> Also, I haven’t tried this sequence myself, but I noticed in your sample 
>>> code you’re
>>> calling phonemesFromText: right after startSpeakingString:.  Maybe
>>> phonemesFromText: is short-circuiting the speaking?
>> 
>> Right on! 
>> Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to 
>> hear all my new voices.
>> 
>> But: phonemesFromText: still returns an empty string.
>> This is a pity, because getting the phonemes is the goal of the whole 
>> exercise.
>> 
>> With or without delegate.
>> 
>> Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever 
>> with any voice.
>> 
>> 
>>> It’s been a while
>>> since I’ve worked on my app, but I remember some calls will stop any
>>> current speaking.
>>> --
>>> Gary L. Wade
>>> http://www.garywade.com/
>>> 
>>> On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:
>>> 
>>> 
 
> On 15 May 2014, at 08:41, Jens Alfke  wrote:
> 
> On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
> wrote:
> 
>> But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
>> has 24 voices (which is nice) but all 24 have VoiceLanguage =
>> VoiceLocaleIdentifier = en_US (which seems rather odd).
> 
> The non-English voices are optional downloads — you can get them via
> the Dictation/Speech system pref pane. Pull down the System Voice pop-up
> and choose Customize…
 
 Thanks. Just did that.
 
 Did set System Voice to "Anna" (a German voice).
 Now, when I select some (German) text and do Control-Click → Speech →
 Start Speaking it just works. Very good.
 
 But this:
 
 NSString *voiceIdentifier =
 @"com.apple.speech.synthesis.voice.anna.premium";
 NSString *text = @"Der Osten ist rot.";
 NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
 initWithVoice: voiceIdentifier ];//non-nil
 BOOL ok = [ syn startSpeakingString: text ];//returns YES, but does
 NOT speak
 NSString *pp = [ syn phonemesFromText: text ];//returns empty 
 string
 
 does not work as expected.
 Same problem with all other voices I just downloaded. Only the default
 (en-US) voices work as they should.
 
 What am I missing?
 
 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Dear list,

I implemented a very straightforward UIAlertView.

For some reason, on iPad, a light rectangular appears behind the alertview, 
here is what it looks like:

http://www.tenhorses.com/apps/alertScreenshot.jpg

What makes it strange is that that light rectangle is not visible when I take a 
screenshot, see jpg

This only happens on iPad, not on iPhone.

The centre part (the white card on the larger background) is a UIView that has 
a number of subviews.

This UIView has clipsToBounds set to yes, because I have subviews flying in 
with animations.

If I set clipsToBounds to NO, then the alertview is shown normally without any 
issues.

Has anybody run into this and is there a way to fix this?

Many thanks,

Diederik


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
If you need the phonemes, look at the willSpeakPhoneme delegate method. You can 
use it in conjunction with the other delegates in a manner like NSString 
enumerates sentences and words―not a perfect comparison, but it should help you 
conceptually.

If I recall, the feedback window solves a very narrow need, one that didn't 
help me much, so I didn't explore it, especially since the delegate methods 
gave me what I needed.

I wouldn't doubt that NSSpeechSynthesizer gets deprecated in favor of the AV 
variety based on the way Apple has historically ported underlying technologies 
between platforms, but if not or you need to support older OSes, be careful 
about some of its property retrieval methods, especially the phoneme dictionary 
per voice, since in at least one OS and earlier it returned a retained object 
vs an autoreleased object against the Objective-C memory naming contract.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On May 15, 2014, at 5:53 AM, "Gerriet M. Denkmann"  
> wrote:
> 
> 
>> On 15 May 2014, at 15:53, Gary L. Wade  wrote:
>> 
>> Also, I haven’t tried this sequence myself, but I noticed in your sample 
>> code you’re
>> calling phonemesFromText: right after startSpeakingString:.  Maybe
>> phonemesFromText: is short-circuiting the speaking?
> 
> Right on! 
> Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to hear 
> all my new voices.
> 
> But: phonemesFromText: still returns an empty string.
> This is a pity, because getting the phonemes is the goal of the whole 
> exercise.
> 
> With or without delegate.
> 
> Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever 
> with any voice.
> 
> 
>> It’s been a while
>> since I’ve worked on my app, but I remember some calls will stop any
>> current speaking.
>> --
>> Gary L. Wade
>> http://www.garywade.com/
>> 
>> On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:
>> 
>> 
>>> 
 On 15 May 2014, at 08:41, Jens Alfke  wrote:
 
 On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
 wrote:
 
> But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
> has 24 voices (which is nice) but all 24 have VoiceLanguage =
> VoiceLocaleIdentifier = en_US (which seems rather odd).
 
 The non-English voices are optional downloads ― you can get them via
 the Dictation/Speech system pref pane. Pull down the System Voice pop-up
 and choose Customize…
>>> 
>>> Thanks. Just did that.
>>> 
>>> Did set System Voice to "Anna" (a German voice).
>>> Now, when I select some (German) text and do Control-Click → Speech →
>>> Start Speaking it just works. Very good.
>>> 
>>> But this:
>>> 
>>> NSString *voiceIdentifier =
>>> @"com.apple.speech.synthesis.voice.anna.premium";
>>> NSString *text = @"Der Osten ist rot.";
>>> NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
>>> initWithVoice: voiceIdentifier ];//non-nil
>>> BOOL ok = [ syn startSpeakingString: text ];//returns YES, but does
>>> NOT speak
>>> NSString *pp = [ syn phonemesFromText: text ];//returns empty string
>>> 
>>> does not work as expected.
>>> Same problem with all other voices I just downloaded. Only the default
>>> (en-US) voices work as they should.
>>> 
>>> What am I missing?
>>> 
>>> 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

DNS Lookup

2014-05-15 Thread Appa Rao Mulpuri
Hi List,

In Webkit, do we have any provision to provide application level DNS lookup map 
to route the particular URLs to a IP address?

 Similar like /private/etc/hosts file, trying to maintain a map at application 
level with DNS name as key and array of IP addresses, which will provide the 
webpage.  When ever my application trigger a request to load a embedded web 
page, it would lookup at the DNS name and pick any of the responding IP address 
from the map.

Understood, this is kind of Hackers way,  looking for some workable APIs. 
Appreciated any third party libraries are available.

- Apparao Mulpuri



This email and any attachments are confidential, and may be legally privileged 
and protected by copyright. If you are not the intended recipient dissemination 
or copying of this email is prohibited. If you have received this in error, 
please notify the sender by replying by email and then delete the email 
completely from your system. Any views or opinions are solely those of the 
sender. This communication is not intended to form a binding contract unless 
expressly indicated to the contrary and properly authorised. Any actions taken 
on the basis of this email are at the recipient's own risk.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Obtain an NSDate object from any casually entered user string

2014-05-15 Thread Charles Srstka
On May 15, 2014, at 8:03 AM, Gerriet M. Denkmann  wrote:

> I always use a 24-hour clock.

Your users may not, though. In the US, at least, 24-hour clocks are definitely 
a minority.

> Is there a way, to make NSDataDetector aware of this fact? Some options I 
> might set?

NSDataDetector doesn't appear to have any options at *all.*

I suppose you could do stuff like postpend "AM" to the string if the hour is 
less than 12, and "PM" if it's equal to 12, before running the string through 
NSDataDetector. The amount of string manipulation you'd have to do might defeat 
the purpose of using NSDataDetector, though.

Charles

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Obtain an NSDate object from any casually entered user string

2014-05-15 Thread Gerriet M. Denkmann

On 15 May 2014, at 19:53, Charles Srstka  wrote:

> On May 14, 2014, at 10:38 PM, Gerriet M. Denkmann  
> wrote:
> 
>> 
>> On 15 May 2014, at 02:00, Ken Thomases  wrote:
>> 
>>> 
>>> On May 14, 2014, at 8:41 AM, Jonathan Mitchell wrote:
>>> 
 Is there a way to obtain an NSDate object from a casually entered user 
 string, say: 1 1 2015 or 25 jul 15?
 
 I have looked at the various NSDateFormatter and NSDate API and cannot 
 spot what I am after.
>>> 
>>> You might try NSDataDetector with type NSTextCheckingTypeDate.
>> 
>> I did just that, and are a bit puzzled.
>> 
>> 1. NSDataDetector recognises all date formats I encountered, which is rather 
>> good.
>> 
>> 
>> 2. NSDataDetector ignores fractions of a second:
>> e.g. "2014-05-14 11:33:53.126" gets converted to: "2014-05-14 11:33:53  
>> +0700", which in my case is not really a problem.
>> 
>> 
>> 3. But sometimes the date of NSDataDetector is 12h ahead (again ignoring 
>> fractions of a second):
>> 
>> "2014-05-15 07:52:18.658" →  "2014-05-15 19:52:18  +0700"
>> "2014-05-14 05:59:46.490 +0700" → "2014-05-14 17:59:46.490 +0700"
>> 
>> But not always - these work ok:
>> "2014-05-15 08:22:48.135"
>> "2014-05-15 09:15:35 +0700"
>> Also, all times after about 13:00 are correct.
>> 
>> This arbitrary advancement of 12h is obviously NOT acceptable.
>> What am I doing wrong?
> 
> That's the trouble with accepting arbitrary user input. If a user enters a 
> time of "1:23", s/he might mean 1:23 AM, 1:23 PM, or 1:23 military time, and 
> there's no real way to determine which is intended without reading the user's 
> mind. So, the system has to guess. Sometimes it may not guess correctly.
> 
> If the user specifically enters "1:23 AM" to remove the ambiguity, this 
> should solve the issue.

I always use a 24-hour clock.

Is there a way, to make NSDataDetector aware of this fact? Some options I might 
set?

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann

On 15 May 2014, at 15:53, Gary L. Wade  wrote:

>  Also, I haven’t tried this sequence myself, but I noticed in your sample 
> code you’re
> calling phonemesFromText: right after startSpeakingString:.  Maybe
> phonemesFromText: is short-circuiting the speaking?

Right on! 
Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to hear 
all my new voices.

But: phonemesFromText: still returns an empty string.
This is a pity, because getting the phonemes is the goal of the whole exercise.

With or without delegate.

Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever with 
any voice.


>  It’s been a while
> since I’ve worked on my app, but I remember some calls will stop any
> current speaking.
> --
> Gary L. Wade
> http://www.garywade.com/
> 
> On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:
> 
> 
>> 
>> On 15 May 2014, at 08:41, Jens Alfke  wrote:
>> 
>>> On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
>>> wrote:
>>> 
 But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
 has 24 voices (which is nice) but all 24 have VoiceLanguage =
 VoiceLocaleIdentifier = en_US (which seems rather odd).
>>> 
>>> The non-English voices are optional downloads — you can get them via
>>> the Dictation/Speech system pref pane. Pull down the System Voice pop-up
>>> and choose Customize…
>> 
>> Thanks. Just did that.
>> 
>> Did set System Voice to "Anna" (a German voice).
>> Now, when I select some (German) text and do Control-Click → Speech →
>> Start Speaking it just works. Very good.
>> 
>> But this:
>> 
>> NSString *voiceIdentifier =
>> @"com.apple.speech.synthesis.voice.anna.premium";
>> NSString *text = @"Der Osten ist rot.";  
>> NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
>> initWithVoice: voiceIdentifier ];//  non-nil
>> BOOL ok = [ syn startSpeakingString: text ]; //  returns YES, 
>> but does
>> NOT speak
>> NSString *pp = [ syn phonemesFromText: text ];   //  returns empty 
>> string
>> 
>> does not work as expected.
>> Same problem with all other voices I just downloaded. Only the default
>> (en-US) voices work as they should.
>> 
>> What am I missing?
>> 
>> 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Obtain an NSDate object from any casually entered user string

2014-05-15 Thread Charles Srstka
On May 14, 2014, at 10:38 PM, Gerriet M. Denkmann  wrote:

> 
> On 15 May 2014, at 02:00, Ken Thomases  wrote:
> 
>> 
>> On May 14, 2014, at 8:41 AM, Jonathan Mitchell wrote:
>> 
>>> Is there a way to obtain an NSDate object from a casually entered user 
>>> string, say: 1 1 2015 or 25 jul 15?
>>> 
>>> I have looked at the various NSDateFormatter and NSDate API and cannot spot 
>>> what I am after.
>> 
>> You might try NSDataDetector with type NSTextCheckingTypeDate.
> 
> I did just that, and are a bit puzzled.
> 
> 1. NSDataDetector recognises all date formats I encountered, which is rather 
> good.
> 
> 
> 2. NSDataDetector ignores fractions of a second:
> e.g. "2014-05-14 11:33:53.126" gets converted to: "2014-05-14 11:33:53  
> +0700", which in my case is not really a problem.
> 
> 
> 3. But sometimes the date of NSDataDetector is 12h ahead (again ignoring 
> fractions of a second):
> 
> "2014-05-15 07:52:18.658" →  "2014-05-15 19:52:18  +0700"
> "2014-05-14 05:59:46.490 +0700" → "2014-05-14 17:59:46.490 +0700"
> 
> But not always - these work ok:
> "2014-05-15 08:22:48.135"
> "2014-05-15 09:15:35 +0700"
> Also, all times after about 13:00 are correct.
> 
> This arbitrary advancement of 12h is obviously NOT acceptable.
> What am I doing wrong?

That's the trouble with accepting arbitrary user input. If a user enters a time 
of "1:23", s/he might mean 1:23 AM, 1:23 PM, or 1:23 military time, and there's 
no real way to determine which is intended without reading the user's mind. So, 
the system has to guess. Sometimes it may not guess correctly.

If the user specifically enters "1:23 AM" to remove the ambiguity, this should 
solve the issue.

Charles


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann

On 15 May 2014, at 15:53, Gary L. Wade  wrote:

> German Anna, Chinese Mei-Jia, and Korean Yuna all speak my English text
> (Shakespeare, actually, in my test case) with accents from each language.
> I also verified Mei-Jia speaks Chinese from a Chinese play in my app, too.
> Do you get any calls in your delegate methods (you have set the delegate
> on your speech synthesizer instance, right)?  
No, no delegate yet.

> One difference I’ve done is
> to initWithVoice: with nil and later call setVoice:.  Also, I haven’t
> tried this sequence myself, but I noticed in your sample code you’re
> calling phonemesFromText: right after startSpeakingString:.  Maybe
> phonemesFromText: is short-circuiting the speaking?  
An interesting point. But when I replace Anna with Bruce (one of the 
preinstalled voices), he speaks and I also get the phonemes. (still not using 
any delegate).

Must be something else.

Just added a delegate with 
speechSynthesizer:didEncounterErrorAtIndex:ofString:message: and 
speechSynthesizer:willSpeakWord:ofString:

but neither of these gets called with Anna.
With Bruce the latter method does get called.

Still puzzled.


> It’s been a while since I’ve worked on my app, but I remember some calls will 
> stop any
> current speaking.
> --
> Gary L. Wade
> http://www.garywade.com/
> 
> On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:
> 
> 
>> 
>> On 15 May 2014, at 08:41, Jens Alfke  wrote:
>> 
>>> On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
>>> wrote:
>>> 
 But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
 has 24 voices (which is nice) but all 24 have VoiceLanguage =
 VoiceLocaleIdentifier = en_US (which seems rather odd).
>>> 
>>> The non-English voices are optional downloads — you can get them via
>>> the Dictation/Speech system pref pane. Pull down the System Voice pop-up
>>> and choose Customize…
>> 
>> Thanks. Just did that.
>> 
>> Did set System Voice to "Anna" (a German voice).
>> Now, when I select some (German) text and do Control-Click → Speech →
>> Start Speaking it just works. Very good.
>> 
>> But this:
>> 
>> NSString *voiceIdentifier =
>> @"com.apple.speech.synthesis.voice.anna.premium";
>> NSString *text = @"Der Osten ist rot.";  
>> NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
>> initWithVoice: voiceIdentifier ];//  non-nil
>> BOOL ok = [ syn startSpeakingString: text ]; //  returns YES, 
>> but does
>> NOT speak
>> NSString *pp = [ syn phonemesFromText: text ];   //  returns empty 
>> string
>> 
>> does not work as expected.
>> Same problem with all other voices I just downloaded. Only the default
>> (en-US) voices work as they should.
>> 
>> What am I missing?
>> 
>> 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Share and store RSA - public key in java server and vice versa

2014-05-15 Thread Roland King
I try not to 'screw' the Apple crypto libraries, I use them where possible and 
file bug reports to improve them where they are lacking. 

Lots of people do end up embedding OpenSSL, a fact not lost on the recipients 
of bug reports I'm sure, I've thus far managed not to have to. I'd prefer Apple 
improved their crypto library API so I didn't have to mess around with it. 

On 15 May, 2014, at 7:46 pm, ChanMaxthon  wrote:

> Eh screw the OS X/iOS crypto libraries... I would just embed my own copy of 
> OpenSSL or GNUTLS myself. (My toolkit library have already included GNU MP, 
> the library GNUTLS is based on) Or if I really have the time reimplement RSA 
> algorithms and key generation using Acceleration.framework
> 
> Sent from my iPad
> 
> On May 15, 2014, at 11:43 AM, Roland King  wrote:
> 
>> 
>> On 15 May, 2014, at 7:25 am, Jens Alfke  wrote:
>> 
>>> 
>>> On May 14, 2014, at 3:48 PM, Roland King  wrote:
>>> 
 I'm just pointing out the advice which is constantly and consistently 
 given by Apple (particularly Quinn) on the developer forum that getting 
 the bits of a private key on iOS is unsupported and subject to change, and 
 to do the job on a server which you trust and return the information. 
 Here's one such thread, there are dozens of them. 
 
 https://devforums.apple.com/message/951417#951417
>>> 
>>> Thanks for the link. I added a rant explaining exactly why this is a 
>>> terrible idea. Who knows whether it’ll do any good; I’ve completely given 
>>> up on Apple ever getting its crypto act together.
>>> 
>>> —Jens
>> 
>> That's quite the reply - I've hit the "Email Updates" on the thread and I'm 
>> sitting with a new bag of popcorn waiting to see what happens next. 
>> 
>> Since that method of extracting private keys was recently broken on OSX I 
>> fear that iOS is not far behind. 

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Share and store RSA - public key in java server and vice versa

2014-05-15 Thread ChanMaxthon
* Correction: GNUTLS depends on GNU MP which is already included.

Sent from my iPad

> On May 15, 2014, at 7:46 PM, ChanMaxthon  wrote:
> 
> Eh screw the OS X/iOS crypto libraries... I would just embed my own copy of 
> OpenSSL or GNUTLS myself. (My toolkit library have already included GNU MP, 
> the library GNUTLS is based on) Or if I really have the time reimplement RSA 
> algorithms and key generation using Acceleration.framework
> 
> Sent from my iPad
> 
>> On May 15, 2014, at 11:43 AM, Roland King  wrote:
>> 
>> 
>>> On 15 May, 2014, at 7:25 am, Jens Alfke  wrote:
>>> 
>>> 
 On May 14, 2014, at 3:48 PM, Roland King  wrote:
 
 I'm just pointing out the advice which is constantly and consistently 
 given by Apple (particularly Quinn) on the developer forum that getting 
 the bits of a private key on iOS is unsupported and subject to change, and 
 to do the job on a server which you trust and return the information. 
 Here's one such thread, there are dozens of them. 
 
 https://devforums.apple.com/message/951417#951417
>>> 
>>> Thanks for the link. I added a rant explaining exactly why this is a 
>>> terrible idea. Who knows whether it’ll do any good; I’ve completely given 
>>> up on Apple ever getting its crypto act together.
>>> 
>>> —Jens
>> 
>> That's quite the reply - I've hit the "Email Updates" on the thread and I'm 
>> sitting with a new bag of popcorn waiting to see what happens next. 
>> 
>> Since that method of extracting private keys was recently broken on OSX I 
>> fear that iOS is not far behind.
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/xcvista%40me.com
> 
> This email sent to xcvi...@me.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Share and store RSA - public key in java server and vice versa

2014-05-15 Thread ChanMaxthon
Eh screw the OS X/iOS crypto libraries... I would just embed my own copy of 
OpenSSL or GNUTLS myself. (My toolkit library have already included GNU MP, the 
library GNUTLS is based on) Or if I really have the time reimplement RSA 
algorithms and key generation using Acceleration.framework

Sent from my iPad

> On May 15, 2014, at 11:43 AM, Roland King  wrote:
> 
> 
>> On 15 May, 2014, at 7:25 am, Jens Alfke  wrote:
>> 
>> 
>>> On May 14, 2014, at 3:48 PM, Roland King  wrote:
>>> 
>>> I'm just pointing out the advice which is constantly and consistently given 
>>> by Apple (particularly Quinn) on the developer forum that getting the bits 
>>> of a private key on iOS is unsupported and subject to change, and to do the 
>>> job on a server which you trust and return the information. Here's one such 
>>> thread, there are dozens of them. 
>>> 
>>> https://devforums.apple.com/message/951417#951417
>> 
>> Thanks for the link. I added a rant explaining exactly why this is a 
>> terrible idea. Who knows whether it’ll do any good; I’ve completely given up 
>> on Apple ever getting its crypto act together.
>> 
>> —Jens
> 
> That's quite the reply - I've hit the "Email Updates" on the thread and I'm 
> sitting with a new bag of popcorn waiting to see what happens next. 
> 
> Since that method of extracting private keys was recently broken on OSX I 
> fear that iOS is not far behind. 
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
German Anna, Chinese Mei-Jia, and Korean Yuna all speak my English text
(Shakespeare, actually, in my test case) with accents from each language.
I also verified Mei-Jia speaks Chinese from a Chinese play in my app, too.
 Do you get any calls in your delegate methods (you have set the delegate
on your speech synthesizer instance, right)?  One difference I’ve done is
to initWithVoice: with nil and later call setVoice:.  Also, I haven’t
tried this sequence myself, but I noticed in your sample code you’re
calling phonemesFromText: right after startSpeakingString:.  Maybe
phonemesFromText: is short-circuiting the speaking?  It’s been a while
since I’ve worked on my app, but I remember some calls will stop any
current speaking.
--
Gary L. Wade
http://www.garywade.com/

On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann"  wrote:


>
>On 15 May 2014, at 08:41, Jens Alfke  wrote:
>
>> On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann 
>>wrote:
>> 
>>> But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
>>>has 24 voices (which is nice) but all 24 have VoiceLanguage =
>>>VoiceLocaleIdentifier = en_US (which seems rather odd).
>> 
>> The non-English voices are optional downloads — you can get them via
>>the Dictation/Speech system pref pane. Pull down the System Voice pop-up
>>and choose Customize…
>
>Thanks. Just did that.
>
>Did set System Voice to "Anna" (a German voice).
>Now, when I select some (German) text and do Control-Click → Speech →
>Start Speaking it just works. Very good.
>
>But this:
>
>NSString *voiceIdentifier =
>@"com.apple.speech.synthesis.voice.anna.premium";
>NSString *text = @"Der Osten ist rot.";
>NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
>initWithVoice: voiceIdentifier ];  //  non-nil
>BOOL ok = [ syn startSpeakingString: text ];   //  returns YES, but does
>NOT speak
>NSString *pp = [ syn phonemesFromText: text ]; //  returns empty string
>
>does not work as expected.
>Same problem with all other voices I just downloaded. Only the default
>(en-US) voices work as they should.
>
>What am I missing?
>
>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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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