Re: Changes in -performSelectorOnMainThread: from iOS 6 to 7?

2014-02-14 Thread Rick Mann
performSlectorOnMainThread still exists. Although I'm re-writing my app from 
the ground up, I'm posting an interim release which will continue to use this 
approach. The behaviors between the OSes are different, and I was looking for 
some indication as to why.

On Feb 14, 2014, at 11:32 , Fritz Anderson  wrote:

> On 12 Feb 2014, at 1:29 PM, Rick Mann  wrote:
> 
>> I think you misunderstand my question. I know about the new concurrency 
>> types. I'm not interested in that. I want to know why my old code works 
>> better on iOS 7 than 6.
> 
> Given that the new concurrency method goes back a couple of years (iOS 5), 
> surely your interest in how the old way works is academic?
> 
>   — F
> 
> -- 
> Xcode 5 Start to Finish — due in stores March/April 2014
> 


-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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: Display selectd sub-menuItem in NSPopUpButton

2014-02-14 Thread Leonardo
Hi John,
Thank you for the code. I suppose I missed something because it doesn¹t work
as expected.
I did:

I created a popUpMenu on IB and put it on the window and connected to the
outlet popUpButton.
I connected the popUp outlet to the delegate¹s action popUpButtonAction.

I created a menu with a single menuItem anc connected to ³selectionMenu².
I created a menu with menuitems and submenus and connected it to
³flyOutMenu².

What did I forget?

When I select a submenu item, the popUP menu marks its sate as YES but it
doesn¹t display it on the closed popUp.
When I re-click on the popUp, the only one item selected is the one under
the mouse.

Anyway, I succeeded as I explained on my previous email to the list.
I click on a smple button and build a NSPopUpButtonCell and pop it up with
performClickWithFrame:
I use an NSTextField to show the latest selected item¹s title.
I would like to re-click and pre-select that meu item but I didn¹t succeed
yet.


Regards
-- Leonardo



Da: John Joyce 
Data: Sat, 15 Feb 2014 02:22:06 +0900
A: Keary Suska 
Cc: Leonardo , List Developer Cocoa

Oggetto: Re: Display selectd sub-menuItem in NSPopUpButton

_popUpButton 

___

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: PDFPage init methods not called

2014-02-14 Thread Antonio Nunes
On 14 Feb 2014, at 15:09, jonat...@mugginsoft.com wrote:

> PDFPage has two declared initialiser methods:
> 
> - init
> - InitWithImage:(NSImage *)image
> 
> When creating a PDFDocument with -initWithURL: neither of the above are 
> called on my PDFPage subclass.
> 
> A bit of digging reveals that what is called is the undocumented:
> 
> - (id)initWithPageRef:(id)pageRef
> 
> This seems peculiar. Will defining an override on -initWithPageRef: count as 
> the use of private API?
> 
> I suspect that this is just an oversight in the header.

I would be highly surprised if using that method would not be considered use of 
private API. The two public init methods are useful when you want to create 
pages yourself. When opening a PDF document you’ll have to resort to other 
options to perform custom setup of pages. Is there a particular reason that you 
really need to be active during the init process? I find that I can do whatever 
I need by iterating through a document’s pages shortly after loading the 
document. You could declare a method on your subclass, say “finishSetup”, and 
then call that on each page as you iterate throughout the pages once you have 
obtained the document from initWithURL:.

- António

___

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: Changes in -performSelectorOnMainThread: from iOS 6 to 7?

2014-02-14 Thread Fritz Anderson
On 12 Feb 2014, at 1:29 PM, Rick Mann  wrote:

> I think you misunderstand my question. I know about the new concurrency 
> types. I'm not interested in that. I want to know why my old code works 
> better on iOS 7 than 6.

Given that the new concurrency method goes back a couple of years (iOS 5), 
surely your interest in how the old way works is academic?

— F

-- 
Xcode 5 Start to Finish — due in stores March/April 2014


___

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: Display selectd sub-menuItem in NSPopUpButton

2014-02-14 Thread Leonardo
Thank you Keary.
In the meantime I dismissed that NSPopUpButton and put a simple button + a
NSTextField aside. They look as a group.
When I click on the button I create on the fly a NSPopUpButtonCell and pop
it up with performClickWithFrame:
Then when the user selects a menu item, the menu item invokes its
target-action and I get the menuItem tag and title then I put that title
within the NSTextField. I release the NSPopUpButtonCell. Done.

The thing I have still to do is: when the user pops up the menu, I should
select and display the latest selected menuItem, opening all of its parents'
menu. And I don't know how to do that. Do you have an idea?

The purpose is: I have a short hierarchical tree of objects, and the user
should be able to choose an object quickly, without opening other panels.


Regards
-- Leonardo


> Da: Keary Suska 
> Data: Fri, 14 Feb 2014 08:29:08 -0700
> A: Leonardo , "Cocoa-Dev (Apple)"
> 
> Oggetto: Re: Display selectd sub-menuItem in NSPopUpButton
> 
> On Feb 14, 2014, at 5:02 AM, Leonardo wrote:
> 
>> I have filled my NSPopUpButton with menu and submenus.
>> 
>> When I select a menuItem on the root menu (so, not a sub-menuItem), it
>> propery displays the menuItem selected. And when I re-click on the popUp
>> button, I get the selected menuItem under the mouse.
>> 
>> But if I select a sub-menuItem, it doesn't display it. And if I re-click on
>> the popUp button, I don't get it under the mouse. Any time I click on the
>> button, I have to look for the selected item diving in the menu hierarchy.
>> 
>> Any solution? 
> 
> I basic problem is that NSPopupButton does not support submenus. You can get
> the submenu item title to appear when the menu is dismissed but the side
> effect is that the item will be added to the top menu. I didn't go any further
> with that approach. It is too bad, because I would argue that there are good
> use cases for hierarchical menus in popup buttons.
> 
> I don't have any real solutions, however, although I can suggest that you
> could "hide" the side effect with a "recents" section of the menu. Otherwise
> you will have to subclass NSPopupButtonCell and take over title and menu
> handling, AFAICT.
> 
> HTH,
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 


___

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

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

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

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

Re: Display selectd sub-menuItem in NSPopUpButton

2014-02-14 Thread Keary Suska
On Feb 14, 2014, at 5:02 AM, Leonardo wrote:

> I have filled my NSPopUpButton with menu and submenus.
> 
> When I select a menuItem on the root menu (so, not a sub-menuItem), it
> propery displays the menuItem selected. And when I re-click on the popUp
> button, I get the selected menuItem under the mouse.
> 
> But if I select a sub-menuItem, it doesn't display it. And if I re-click on
> the popUp button, I don't get it under the mouse. Any time I click on the
> button, I have to look for the selected item diving in the menu hierarchy.
> 
> Any solution? 

I basic problem is that NSPopupButton does not support submenus. You can get 
the submenu item title to appear when the menu is dismissed but the side effect 
is that the item will be added to the top menu. I didn't go any further with 
that approach. It is too bad, because I would argue that there are good use 
cases for hierarchical menus in popup buttons.

I don't have any real solutions, however, although I can suggest that you could 
"hide" the side effect with a "recents" section of the menu. Otherwise you will 
have to subclass NSPopupButtonCell and take over title and menu handling, 
AFAICT.

HTH,

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


___

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

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

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

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

PDFPage init methods not called

2014-02-14 Thread jonat...@mugginsoft.com
PDFPage has two declared initialiser methods:

- init
- InitWithImage:(NSImage *)image

When creating a PDFDocument with -initWithURL: neither of the above are called 
on my PDFPage subclass.

A bit of digging reveals that what is called is the undocumented:

- (id)initWithPageRef:(id)pageRef

This seems peculiar. Will defining an override on -initWithPageRef: count as 
the use of private API?

I suspect that this is just an oversight in the header.

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

OpenCL Basic Programming Question

2014-02-14 Thread Gerriet M. Denkmann
I am trying to build the Basic Programming Sample in: 


I have myKernel.cl:

__kernel void squareq(  __global float* input, __global float* output )
{
int i = get_global_id(0);
printf("i %d\n",i); //  never seen
output[i] = input[i] * input[i];
}  

and myKernel.cl.h:

void squareq_kernel( cl_ndrange *range, float* input,  float* output);

main.c has:

#define NUM_VALUES 999 
size_t bufferSize = sizeof(cl_float) * NUM_VALUES; 
float* test_in = (float*)malloc( bufferSize ); 
for( NSUInteger i = 0; i < NUM_VALUES; i++ ) test_in[i] = i;
cl_float *mem_in = gcl_malloc( bufferSize, test_in, CL_MEM_READ_ONLY | 
CL_MEM_COPY_HOST_PTR ); 
cl_float *mem_out = gcl_malloc( bufferSize, NULL, CL_MEM_WRITE_ONLY );  
dispatch_sync(queue, ^void
{
cl_ndrange range =  {   1,
{0, 0, 0},  
 
{NUM_VALUES, 0, 
0}, 
{0, 0, 0}   
 
};  
squareq_kernel( &range, mem_in, mem_out );   <- 
EXC_BAD_ACCESS (code=2, address=0x13228)
}
);

Builds without warnings, but crashes when run (see above).

What am I doing wrong?

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

Display selectd sub-menuItem in NSPopUpButton

2014-02-14 Thread Leonardo
I have filled my NSPopUpButton with menu and submenus.

When I select a menuItem on the root menu (so, not a sub-menuItem), it
propery displays the menuItem selected. And when I re-click on the popUp
button, I get the selected menuItem under the mouse.

But if I select a sub-menuItem, it doesn't display it. And if I re-click on
the popUp button, I don't get it under the mouse. Any time I click on the
button, I have to look for the selected item diving in the menu hierarchy.

Any solution? 


Regards
-- Leonardo


___

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

NSPDFPanel accessory view validation

2014-02-14 Thread jonat...@mugginsoft.com
NSPDFPanel can display an accessory view.

Is there any way to validate the accessory view input prior to closing the 
panel?

In my case the user can can specify that a password should be required when 
opening the resultant PDF.
I want to prevent the panel closing when the password requirement has been 
specified but the password has not been supplied.

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