CoreData SQLite error code:14?

2015-03-02 Thread Rick Mann
The first couple attempts at reading my Core Data store (a SQLite file) results 
in this error:

CoreData: error: (14) I/O error for database at 
/Users/rmann/Library/Developer/CoreSimulator/Devices/07B4E70B-C9B7-4B0A-9436-670008A8BEDD/data/Applications/75434C34-E2C6-4686-9443-598BC02F24D0/Documents/db.sqlite3.
  SQLite error code:14, 'unable to open database file'

But after that, it seems to be read just fine. Online the only discussions I 
can see around that error have to do with WAL mode and earlier OS versions.

Any idea what I'm seeing? Thanks!

-- 
Rick Mann
rm...@latencyzero.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

persistentDomainNames in sandbox

2015-03-02 Thread Rick C.
Hi,

Calling [[NSUserDefaults standardUserDefaults] persistentDomainNames] in a 
sandbox gives me 29 objects against 821 non-sandboxed (sample count from the 
machine I’m on right now).  Is there any way to get the full array in a sandbox?

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

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

Re: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Jens Alfke

> On Mar 2, 2015, at 4:52 PM, Keary Suska  wrote:
> 
> That depends on what you mean by "validate." If you simply mean checking 
> whether it well-formed, you can do that easily with a regular expression 
> match, such as (written in email):
>   ^http://(?:[a-z0-9-]+\.){1,}[a-z]{2,4}

It’s really much better to ask the system frameworks to do this kind of 
checking/parsing, since they are more likely than you are to know all the 
nuances of the RFCs. For instance, your regex above won’t work with 
international domain names, or capitalized forms of domain names, or top-level 
domains longer than 4 characters, or single-component domains like “foo”...

(I’m not saying this to pick on you, just warning people who might come across 
this thread in a web-search and copy and paste your regex. I’m sure it would 
also take me a while to write a regex that could reliably match domain names, 
assuming I even decided to try; that’s part of my point.)

—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: iOS App trust on first launch

2015-03-02 Thread Rick Mann

> On Mar 2, 2015, at 18:22 , Greg Parker  wrote:
> 
> 
>> On Mar 2, 2015, at 12:34 AM, Rick Mann  wrote:
>> 
>> Xcode should handle this for me, in some way. I should be able to bless my 
>> phone to accept apps from my Xcode.
> 
> Did you file a bug report?

20016533


-- 
Rick Mann
rm...@latencyzero.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: iOS App trust on first launch

2015-03-02 Thread Greg Parker

> On Mar 2, 2015, at 12:34 AM, Rick Mann  wrote:
> 
> Xcode should handle this for me, in some way. I should be able to bless my 
> phone to accept apps from my Xcode.

Did you file a bug report?


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

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: Inconvenient exception impossible to get rid of?

2015-03-02 Thread Graham Cox

> On 3 Mar 2015, at 11:42 am, Uli Kusterer  wrote:
> 
> Sounds like an actual bug, at least I don’t get this behaviour in my popvers. 
> Are you sure your NSPopover is still valid at the point? What does calling 
> malloc_size() on the pointer return? If it’s 0, it’s already been disposed.

I'm not able to obtain the NSPopover pointer at the time of the exception - the 
block is invoked automatically, not by my code.


> 
> Are you using the same view controller for several popover pop-up events? I 
> usually create a new one and let the NSPopover release it. I also usually 
> release the NSPopover when I get an NSPopoverDidCloseNotification (or 
> whatever it is, going from memory here). Any of these different from what 
> you’re doing? It seems like you’re re-using both the popover and its view 
> controller for different occasions. That sounds like it should be fine, but 
> as I’m not doing it, it may be worth trying if somehow Apple isn’t expecting 
> that.
> 


This got me thinking.

I'm sharing the NSPopover instance, though I am creating a new view controller 
each time (that isn't obvious from my code due to the way its factored, but 
it's true). So what I did was assign this new controller to the popover and ask 
it to display. If the old popover (which is the same instance) is still 
visible, it will be closed, but I've swapped out its -viewController property. 
That's bad, apparently.

So I changed the code to create a new NSPopover instance each time, and all is 
well. I can release it straight away, because it seems to retain itself as long 
as it's visible, and on close cleans up after itself. I think I was thinking 
that this wasn't the case, and so I had to keep a reference to it to clean it 
up on receiving a close notification, but it's a bit smarter in this respect 
than I assumed. The NSPopover class deals with closing transient popovers when 
a new one is told to display - again, smarter than I'd assumed.

So my code is now simpler, I don't need the popover property in order to reuse 
the popover, and it all works better.

--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: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Jens Alfke

> On Mar 2, 2015, at 3:55 PM, Juanjo Conti  wrote:
> 
> Ok, I wanted to validate that the url is an absolute one. Is there
> something in Swift standard lib to do this?

I typically check whether url.scheme is a non-nil, non-empty string. You may 
also want to check the scheme if you need to restrict input to HTTP URLs, for 
instance. (For example, “a:b” is a perfectly valid absolute URL, but probably 
not one your app will find useful.) Keep in mind that URL schemes are 
case-insensitive, so “HTTP:” means the same as “http:”.

Also, this has nothing to do with the Swift library. NSURL is part of the 
Foundation framework, so this is independent of whether you’re using Swift or 
Objective-C.

—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: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Keary Suska
On Mar 2, 2015, at 4:55 PM, Juanjo Conti  wrote:

> Ok, I wanted to validate that the url is an absolute one. Is there
> something in Swift standard lib to do this?

That depends on what you mean by "validate." If you simply mean checking 
whether it well-formed, you can do that easily with a regular expression match, 
such as (written in email):
^http://(?:[a-z0-9-]+\.){1,}[a-z]{2,4}

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: Inconvenient exception impossible to get rid of?

2015-03-02 Thread Keary Suska
On Mar 2, 2015, at 4:14 PM, Graham Cox  wrote:

> I'm getting an exception thrown by the NSPopover code when a popover is going 
> away. Due to the way popovers are handled, the exception is not one I'm able 
> to catch, so the app is terminated. This is a very big punishment for what 
> seems a trivial transgression that doesn't even matter at this time, nor one 
> I have any apparent control over.
> 
> Here's the upper part of the stack trace of the exception:
> 
> 2015-03-03 09:59:07.164 LogicBoard[44305:3418051] *** Terminating app due to 
> uncaught exception 'NSInternalInconsistencyException', reason: 'The 
> contentViewController ((null)) or contentViewController.view is nil.'
> *** First throw call stack:
> (
>   0   CoreFoundation  0x7fff90bdc66c 
> __exceptionPreprocess + 172
>   1   libobjc.A.dylib 0x7fff869f776e 
> objc_exception_throw + 43
>   2   CoreFoundation  0x7fff90bdc51d 
> +[NSException raise:format:] + 205
>   3   AppKit  0x7fff8958e89d -[NSPopover 
> showRelativeToRect:ofView:preferredEdge:] + 249
>   4   AppKit  0x7fff89bff304 
> __53-[NSPopover showRelativeToRect:ofView:preferredEdge:]_block_invoke + 94
>   5   AppKit  0x7fff895ac6aa -[NSPopover 
> _executeClosingBlock] + 31
>   6   AppKit  0x7fff895ac517 -[NSPopover 
> _finishClosingAndShouldNotify:] + 197
>   7   AppKit  0x7fff89491204 -[NSWindow 
> _windowTransformAnimationDidEnd:] + 380
>   8   libdispatch.dylib   0x00010025c2bb 
> _dispatch_call_block_and_release + 12
>   9   libdispatch.dylib   0x000100256d43 
> _dispatch_client_callout + 8
>   10  libdispatch.dylib   0x000100265d9f 
> _dispatch_main_queue_callback_4CF + 1370
>   11  CoreFoundation  0x7fff90b2fc79 
> __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
>   12  CoreFoundation  0x7fff90aec30f 
> __CFRunLoopRun + 2159
> 
> 
> What it's complaining about is that the viewController, or its view, is nil. 
> The thing is, I do supply this controller and the view is there - in fact 
> it's been successfully displayed, interacted with and dismissed by this point 
> - this stack trace is the result of dismissing the popover after I'm done 
> with it. At this time, it shouldn't care whether it has a view controller or 
> a view - presumably it will release the view controller it holds anyway at 
> this time, so it appears as if the exception is completely spurious.
> 
> This is happening on 10.10. It's been a while since I worked on this code, 
> last time was under 10.8, and I don't recall that I was getting this 
> exception in the same situation there.
> 
> This is the code that displays the popover. It's not very interesting, and 
> the try/catch block here doesn't trap the above exception, because it's 
> actually nothing to do with it, even though at first glance it appears to be 
> thrown by the same function.
> 
> - (void)  displayPopoverForDeviceLayer:(LB_DeviceLayer*) dvl
> {
>   NSRect popRect = dvl.frame;
>   NSViewController* devViewController = [dvl 
> viewControllerForAuxiliaryContent];
>   
>   if( devViewController )
>   {
>   self.auxiliaryContentPopover.contentViewController = 
> devViewController;
>   self.auxiliaryContentPopover.behavior = 
> NSPopoverBehaviorSemitransient;
>   
>   NSView* contentView = devViewController.view;
>   
>   NSAssert( contentView, @"no view supplied by controller");  
> //< never asserts, there is always a controller and view here
>   
>   self.auxiliaryContentPopover.contentSize = 
> contentView.frame.size;
>   
>   @try
>   {
>   [self.auxiliaryContentPopover 
> showRelativeToRect:popRect ofView:self preferredEdge:NSMaxXEdge];
>   }
>   @catch (NSException *exception)
>   {
>   NSLog(@"huh?!"); //< never invoked
>   }
>   }
> }
> 
> Is this just a case of the popover code on 10.10 being over-zealous about 
> asserting that it has a controller, even though it doesn't need one once the 
> popover is dismissed?
> 
> I'm at a loss as to how to sort this problem out - the closure block for the 
> popover is invoked automatically, not by my code, so I'm not seeing any way 
> to fix this.

Maybe it wants the view around for some closing animation. Does making animates 
NO change anything? Also, are you really unable to keep the view or view 
controller around until the popover is completely closed (maybe 
NSPopoverDidCloseNotification, but I can't day for sure).

HTH,

Re: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Uli Kusterer
I think you want NSURLComponents.

> On 03 Mar 2015, at 00:55, Juanjo Conti  wrote:
> 
> Ok, I wanted to validate that the url is an absolute one. Is there
> something in Swift standard lib to do this?
> 
> Thanks in advance!
> 
> On Mon, Mar 2, 2015 at 7:46 PM, Mike Abdullah  wrote:
> 
>> 
>>> On 2 Mar 2015, at 23:22, Juanjo Conti  wrote:
>>> 
>>> According the docs (
>>> 
>> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/
>> )
>>> NSURL(string: aString) will return nil if aString is malformed.
>>> 
>>> But I've tried this in the a playground and no nil is returned:
>>> 
>>> NSURL(string: "")!
>>> NSURL(string: "")!
>>> 
>>> Why is this? are the docs wrong?
>> 
>> Go read the specs NSURL references. An empty string and “” are both
>> valid by its definition.
>> 
>> Pretty much all NSURL is looking for is you’re not using any unsupported
>> characters, or mis-using reserved characters. Anything more, and you’ve got
>> to test the resulting URL yourself. Perhaps you can elaborate what you
>> consider to be a valid URL in your case.
>> 
>> 
> 
> 
> -- 
> 
> Juanjo Conti http://goog_2023646312>@carouselapps.com
> >
> 
> Software Engineer - Carousel Apps 
> 
> -- 
> Carousel Apps Limited, registered in England & Wales with registered number 
> 7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
> Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
> App Ltd or any of its subsidiary, holding or affiliated companies or 
> entities (together "Watu") is confidential and may be privileged or 
> otherwise protected. If you receive it in error please inform us and then 
> delete it from your system. You should not copy it or disclose its contents 
> to anyone. Messages sent to and from Watu may be monitored to ensure 
> compliance with our internal policies and to protect our business. Emails 
> are not secure and cannot be guaranteed to be error free. Anyone who 
> communicates with us by email is taken to accept these risks.
> ___
> 
> 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/witness.of.teachtext%40gmx.net
> 
> This email sent to witness.of.teacht...@gmx.net

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


___

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: Inconvenient exception impossible to get rid of?

2015-03-02 Thread Uli Kusterer
On 03 Mar 2015, at 00:14, Graham Cox  wrote:
> I'm getting an exception thrown by the NSPopover code when a popover is going 
> away. Due to the way popovers are handled, the exception is not one I'm able 
> to catch, so the app is terminated. This is a very big punishment for what 
> seems a trivial transgression that doesn't even matter at this time, nor one 
> I have any apparent control over.
> 
> Here's the upper part of the stack trace of the exception:

 Sounds like an actual bug, at least I don’t get this behaviour in my popvers. 
Are you sure your NSPopover is still valid at the point? What does calling 
malloc_size() on the pointer return? If it’s 0, it’s already been disposed.

 Are you using the same view controller for several popover pop-up events? I 
usually create a new one and let the NSPopover release it. I also usually 
release the NSPopover when I get an NSPopoverDidCloseNotification (or whatever 
it is, going from memory here). Any of these different from what you’re doing? 
It seems like you’re re-using both the popover and its view controller for 
different occasions. That sounds like it should be fine, but as I’m not doing 
it, it may be worth trying if somehow Apple isn’t expecting that.

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


___

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: Application windows are expected to have a root view controller at the end of application launch

2015-03-02 Thread Rick Mann

> On Mar 2, 2015, at 08:51 , David Duncan  wrote:
> 
> 
>> On Mar 1, 2015, at 10:36 PM, Rick Mann  wrote:
>> 
>> I'm adding background downloading on remote notification, so I removed all 
>> my UI code from appDidFinishLaunching. Now I get this error: "Application 
>> windows are expected to have a root view controller at the end of 
>> application launch"
>> 
>> So, I have to create UI even though I won't be displaying it?
> 
> 
> You should only get this if you have created a window and made it visible.

Hmm. I didn't believe that I did, because I don't makeKeyAndVisible until 
later, but...it's a pre-storyboard app, and maybe it's being created when the 
main NIB is loaded.

-- 
Rick Mann
rm...@latencyzero.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: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Juanjo Conti
Ok, I wanted to validate that the url is an absolute one. Is there
something in Swift standard lib to do this?

Thanks in advance!

On Mon, Mar 2, 2015 at 7:46 PM, Mike Abdullah  wrote:

>
> > On 2 Mar 2015, at 23:22, Juanjo Conti  wrote:
> >
> > According the docs (
> >
> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/
> )
> > NSURL(string: aString) will return nil if aString is malformed.
> >
> > But I've tried this in the a playground and no nil is returned:
> >
> > NSURL(string: "")!
> > NSURL(string: "")!
> >
> > Why is this? are the docs wrong?
>
> Go read the specs NSURL references. An empty string and “” are both
> valid by its definition.
>
> Pretty much all NSURL is looking for is you’re not using any unsupported
> characters, or mis-using reserved characters. Anything more, and you’ve got
> to test the resulting URL yourself. Perhaps you can elaborate what you
> consider to be a valid URL in your case.
>
>


-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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

Inconvenient exception impossible to get rid of?

2015-03-02 Thread Graham Cox
I'm getting an exception thrown by the NSPopover code when a popover is going 
away. Due to the way popovers are handled, the exception is not one I'm able to 
catch, so the app is terminated. This is a very big punishment for what seems a 
trivial transgression that doesn't even matter at this time, nor one I have any 
apparent control over.

Here's the upper part of the stack trace of the exception:

2015-03-03 09:59:07.164 LogicBoard[44305:3418051] *** Terminating app due to 
uncaught exception 'NSInternalInconsistencyException', reason: 'The 
contentViewController ((null)) or contentViewController.view is nil.'
*** First throw call stack:
(
0   CoreFoundation  0x7fff90bdc66c 
__exceptionPreprocess + 172
1   libobjc.A.dylib 0x7fff869f776e 
objc_exception_throw + 43
2   CoreFoundation  0x7fff90bdc51d 
+[NSException raise:format:] + 205
3   AppKit  0x7fff8958e89d -[NSPopover 
showRelativeToRect:ofView:preferredEdge:] + 249
4   AppKit  0x7fff89bff304 
__53-[NSPopover showRelativeToRect:ofView:preferredEdge:]_block_invoke + 94
5   AppKit  0x7fff895ac6aa -[NSPopover 
_executeClosingBlock] + 31
6   AppKit  0x7fff895ac517 -[NSPopover 
_finishClosingAndShouldNotify:] + 197
7   AppKit  0x7fff89491204 -[NSWindow 
_windowTransformAnimationDidEnd:] + 380
8   libdispatch.dylib   0x00010025c2bb 
_dispatch_call_block_and_release + 12
9   libdispatch.dylib   0x000100256d43 
_dispatch_client_callout + 8
10  libdispatch.dylib   0x000100265d9f 
_dispatch_main_queue_callback_4CF + 1370
11  CoreFoundation  0x7fff90b2fc79 
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
12  CoreFoundation  0x7fff90aec30f 
__CFRunLoopRun + 2159


What it's complaining about is that the viewController, or its view, is nil. 
The thing is, I do supply this controller and the view is there - in fact it's 
been successfully displayed, interacted with and dismissed by this point - this 
stack trace is the result of dismissing the popover after I'm done with it. At 
this time, it shouldn't care whether it has a view controller or a view - 
presumably it will release the view controller it holds anyway at this time, so 
it appears as if the exception is completely spurious.

This is happening on 10.10. It's been a while since I worked on this code, last 
time was under 10.8, and I don't recall that I was getting this exception in 
the same situation there.

This is the code that displays the popover. It's not very interesting, and the 
try/catch block here doesn't trap the above exception, because it's actually 
nothing to do with it, even though at first glance it appears to be thrown by 
the same function.

- (void)displayPopoverForDeviceLayer:(LB_DeviceLayer*) dvl
{
NSRect popRect = dvl.frame;
NSViewController* devViewController = [dvl 
viewControllerForAuxiliaryContent];

if( devViewController )
{
self.auxiliaryContentPopover.contentViewController = 
devViewController;
self.auxiliaryContentPopover.behavior = 
NSPopoverBehaviorSemitransient;

NSView* contentView = devViewController.view;

NSAssert( contentView, @"no view supplied by controller");  
//< never asserts, there is always a controller and view here

self.auxiliaryContentPopover.contentSize = 
contentView.frame.size;

@try
{
[self.auxiliaryContentPopover 
showRelativeToRect:popRect ofView:self preferredEdge:NSMaxXEdge];
}
@catch (NSException *exception)
{
NSLog(@"huh?!"); //< never invoked
}
}
}

Is this just a case of the popover code on 10.10 being over-zealous about 
asserting that it has a controller, even though it doesn't need one once the 
popover is dismissed?

I'm at a loss as to how to sort this problem out - the closure block for the 
popover is invoked automatically, not by my code, so I'm not seeing any way to 
fix this.

--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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ben

> On 2 Mar 2015, at 19:10, Uli Kusterer  wrote:
> 
> On 02 Mar 2015, at 19:26, Ben  wrote:
>> - Granularity of selection. For example single or multiple disconnected 
>> cells. NSTableView only gives me row or column.
>> - Scrollable floating headers on both axis. This I did sort-of manage with 
>> NSTableView by styling the first column to look like a header, but it was 
>> not great.
> 
> So you're effectively implementing something like a spreadsheet?

Sort of, yes. Basically it's for browsing database contents with more focused 
UI selections than a simple table offers. The problem is that when you begin by 
saying "spreadsheet", so many people jump to the conclusion "you're building 
Excel and a fancy calculation engine too!". I am sorry if my writing has lead 
anyone in the wrong direction.

Incidentally, since you and Ken Thomases mentioned it, by responsive scrolling, 
I meant the "smooth 60fps" type of responsive. However, I am taking into 
account the capital-R Responsive guidelines for over-drawing and preparing 
contents outside the user-visible area.


Thank you all for the pointers though. It's getting late here, but I will 
continue my work tomorrow.

- Ben
___

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: NSTextField highlight

2015-03-02 Thread edward taffel

> On Mar 2, 2015, at 5:34 PM, Ken Thomases  wrote:
> 
> On Mar 2, 2015, at 3:51 PM, edward taffel  wrote:
> 
>> has anyone had success in changing NSTextField’s default highlight? e.g., 
>> given bright text on a dark background, the default highlight is not 
>> serviceable. i had hoped subclassing NSTextFieldCell & overriding 
>> -(id)_highlightColorForCell:(NSCell*)cell would work, as it does in 
>> instances of NSTextFieldCell in NSTableView. googling has not returned any 
>> simple direction—perhaps i’ve missed something.
> 
> Have you set the cell's backgroundStyle to NSBackgroundStyleDark?
> 
> Regards,
> Ken
> 

i haven’t fiddled w/ NSBackgroundStyleDark yet: i’ll give it a try & see what 
happens; but, given what i read in the doc, & as i’m dealing w/ a shade 
range—not just black or white, i may still need to look for a method to affect 
the highlight.

many thanks,
edward


___

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: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Mike Abdullah

> On 2 Mar 2015, at 23:22, Juanjo Conti  wrote:
> 
> According the docs (
> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/)
> NSURL(string: aString) will return nil if aString is malformed.
> 
> But I've tried this in the a playground and no nil is returned:
> 
> NSURL(string: "")!
> NSURL(string: "")!
> 
> Why is this? are the docs wrong?

Go read the specs NSURL references. An empty string and “” are both valid 
by its definition.

Pretty much all NSURL is looking for is you’re not using any unsupported 
characters, or mis-using reserved characters. Anything more, and you’ve got to 
test the resulting URL yourself. Perhaps you can elaborate what you consider to 
be a valid URL in your case.


___

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: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread pscott

On 3/2/2015 2:22 PM, Juanjo Conti wrote:

According the docs (
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/)
NSURL(string: aString) will return nil if aString is malformed.

But I've tried this in the a playground and no nil is returned:

NSURL(string: "")!
NSURL(string: "")!

Why is this? are the docs wrong?

Thanks in advance,
The doc also states the URL format string conforms to RFC2396, which 
defines the term "relative URI reference". That's what you are providing 
in this case, a relative URI reference; even a blank relative URI 
reference is allowed.


Paul



smime.p7s
Description: S/MIME Cryptographic Signature
___

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

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

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

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

Re: NSTextField highlight

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 3:51 PM, edward taffel  wrote:

> has anyone had success in changing NSTextField’s default highlight? e.g., 
> given bright text on a dark background, the default highlight is not 
> serviceable. i had hoped subclassing NSTextFieldCell & overriding 
> -(id)_highlightColorForCell:(NSCell*)cell would work, as it does in instances 
> of NSTextFieldCell in NSTableView. googling has not returned any simple 
> direction—perhaps i’ve missed something.

Have you set the cell's backgroundStyle to NSBackgroundStyleDark?

Regards,
Ken


___

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

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

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

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

Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Juanjo Conti
According the docs (
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/)
NSURL(string: aString) will return nil if aString is malformed.

But I've tried this in the a playground and no nil is returned:

NSURL(string: "")!
NSURL(string: "")!

Why is this? are the docs wrong?

Thanks in advance,
-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Charles Jenkins
Thanks, Martin.

The docs say you can put anything you want into the attributes 
dictionary—without mentioning that cutting and pasting will screw it all up. 
But it makes sense why, if cutting and pasting involves a translation into some 
non-native format. I’ll try to learn how to override cutting and pasting to 
make them include the full attributes.

-- 

Charles

On March 2, 2015 at 16:43:51, Martin Wierschin (mar...@nisus.com) wrote:

> I’m having problems with text attributes getting mangled by copy-and-paste 
> operations within the selfsame text view. Obviously text pasted in from 
> outside the app would have an unpredictable set of attributes, but you’d 
> think copying and pasting in the same text view would leave you with a 
> consistent set of attributes.  
…  
> I’d like to know if this behavior is expected or a bug  


I didn’t look long at your code, but from what I saw, the behavior is expected. 
You’re applying custom keys to the NSTextView/NSTextStorage that will not be 
serialized when copy-pasting.  

By default when you select some text in NSTextView and trigger a copy action, 
the selected text will be vended on the pasteboard via some common data format 
(eg: HTML, RTF, DOCX, etc) so the content can be pasted into another 
application. Naturally these common data formats have no understanding of your 
custom attribute keys, and thus cannot encode them.  

If you need to preserve you own custom attributes when copy-pasting within your 
app, you’ll need to override the copy-paste methods in your NSTextView subclass 
to add a custom pasteboard data type with higher priority.  

~Martin  

___

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: Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Steve Mills
On Mar 2, 2015, at 15:13:01, Mike Abdullah  wrote:
> 
> Or you can bump up the -imageVersion

Ah, cool. Thanks! That allows me to stick with shorter imageUIDs.

--
Steve Mills
Drummer, Mac geek

___

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: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Martin Wierschin
> I’m having problems with text attributes getting mangled by copy-and-paste 
> operations within the selfsame text view. Obviously text pasted in from 
> outside the app would have an unpredictable set of attributes, but you’d 
> think copying and pasting in the same text view would leave you with a 
> consistent set of attributes.
…
> I’d like to know if this behavior is expected or a bug


I didn’t look long at your code, but from what I saw, the behavior is expected. 
You’re applying custom keys to the NSTextView/NSTextStorage that will not be 
serialized when copy-pasting. 

By default when you select some text in NSTextView and trigger a copy action, 
the selected text will be vended on the pasteboard via some common data format 
(eg: HTML, RTF, DOCX, etc) so the content can be pasted into another 
application. Naturally these common data formats have no understanding of your 
custom attribute keys, and thus cannot encode them.

If you need to preserve you own custom attributes when copy-pasting within your 
app, you’ll need to override the copy-paste methods in your NSTextView subclass 
to add a custom pasteboard data type with higher priority.

~Martin


___

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

NSTextField highlight

2015-03-02 Thread edward taffel
has anyone had success in changing NSTextField’s default highlight? e.g., given 
bright text on a dark background, the default highlight is not serviceable. i 
had hoped subclassing NSTextFieldCell & overriding 
-(id)_highlightColorForCell:(NSCell*)cell would work, as it does in instances 
of NSTextFieldCell in NSTableView. googling has not returned any simple 
direction—perhaps i’ve missed something.

tia,
edward
___

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: Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Mike Abdullah
Or you can bump up the -imageVersion

> On 2 Mar 2015, at 21:54, Steve Mills  wrote:
> 
> On Mar 2, 2015, at 14:23:03, Dave Fernandes  
> wrote:
>> 
>> Your IKImageBrowserItem must change its returned imageUID when the 
>> imageRepresentation changes so that the IKImageBrowserView knows to recache 
>> the image.
> 
> Ah. I was using a shorter string because using the full path seemed wasteful 
> and slow, especially when there could be tens of thousands of images in the 
> browser that all begin with the same very long path. But, it's what Apple 
> suggests, and it does fix the problem, so I'll go with that. Thanks!
> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> 
> ___
> 
> 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/mabdullah%40karelia.com
> 
> This email sent to mabdul...@karelia.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: Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Dave Fernandes
Oops, yes imageVersion is what you should use. It’s been a long time since I 
looked at this code (Leopard, I think).

> On Mar 2, 2015, at 4:13 PM, Mike Abdullah  wrote:
> 
> Or you can bump up the -imageVersion
> 
>> On 2 Mar 2015, at 21:54, Steve Mills  wrote:
>> 
>> On Mar 2, 2015, at 14:23:03, Dave Fernandes  
>> wrote:
>>> 
>>> Your IKImageBrowserItem must change its returned imageUID when the 
>>> imageRepresentation changes so that the IKImageBrowserView knows to recache 
>>> the image.
>> 
>> Ah. I was using a shorter string because using the full path seemed wasteful 
>> and slow, especially when there could be tens of thousands of images in the 
>> browser that all begin with the same very long path. But, it's what Apple 
>> suggests, and it does fix the problem, so I'll go with that. Thanks!
>> 
>> --
>> Steve Mills
>> Drummer, Mac geek
>> 
>> 
>> ___
>> 
>> 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/mabdullah%40karelia.com
>> 
>> This email sent to mabdul...@karelia.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: Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Steve Mills
On Mar 2, 2015, at 14:23:03, Dave Fernandes  wrote:
> 
> Your IKImageBrowserItem must change its returned imageUID when the 
> imageRepresentation changes so that the IKImageBrowserView knows to recache 
> the image.

Ah. I was using a shorter string because using the full path seemed wasteful 
and slow, especially when there could be tens of thousands of images in the 
browser that all begin with the same very long path. But, it's what Apple 
suggests, and it does fix the problem, so I'll go with that. Thanks!

--
Steve Mills
Drummer, Mac geek


___

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: Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Dave Fernandes
Your IKImageBrowserItem must change its returned imageUID when the 
imageRepresentation changes so that the IKImageBrowserView knows to recache the 
image.

Dave

> On Mar 2, 2015, at 12:37 PM, Steve Mills  wrote:
> 
> Is there any way to force IKImageBrowserView to throw out a cached thumbnail 
> and regenerate it on a changed imageRepresentation? I can definitely see that 
> imageRepresentation is returning a different url, but the browser still draws 
> the old one, even after calling reloadData.
> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> 
> ___
> 
> 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/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Uli Kusterer
On 02 Mar 2015, at 19:26, Ben  wrote:
> - Granularity of selection. For example single or multiple disconnected 
> cells. NSTableView only gives me row or column.
> - Scrollable floating headers on both axis. This I did sort-of manage with 
> NSTableView by styling the first column to look like a header, but it was not 
> great.

 So you're effectively implementing something like a spreadsheet?
___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Uli Kusterer
On 02 Mar 2015, at 17:43, Ken Thomases  wrote:
> On Mar 2, 2015, at 9:45 AM, Uli Kusterer  wrote:
> 
>> Are you re-setting *all* the views or only hiding views that scroll out and 
>> moving unused views to newly exposed areas? We've been doing stuff like that 
>> in various spots and performance is fine. One thing that might help is to 
>> make each table-row layer-backed, then you get zero-cost moving as it simply 
>> gets drawn in another location on the graphics card. …
>> 
>> - Make all rows layer-backed
> 
> Careful.  As noted in my previous reply, if you use layer-backed views, the 
> root layer must be the scroll view or an ancestor.  Making only the rows 
> layer-backed will disable responsive scrolling.

I read it as lowercase "responsive scrolling", not Apple's "Responsive 
Scrolling" feature that pre-loads complicated stuff like maps in the 
background. I was mainly listing what we actually do and works for us, we've 
never needed Apple's Responsive Scrolling to have responsively scrolling lists.
___

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: iOS App trust on first launch

2015-03-02 Thread Rick Mann
It's not an enterprise account. But if you delete the last app from that cert, 
it happens. 

Sent from my iPhone

> On Mar 2, 2015, at 09:49, Doug Hill  wrote:
> 
> I believe if you use an Enterprise Provisioning Profile you will be asked the 
> Trust question everytime you install after deleting. If so, I’m not aware of 
> a way to get around that question.
> 
> I would also suggest sending questions about Xcode debugging and provisioning 
> to the Xcode users mailing list as that’s probably the more correct forum 
> about these tools issues.
> 
> Good luck!
> 
> Doug Hill
> http://chartcube.com/
> 
> 
>>> On Mar 2, 2015, at 12:35 AM, Rick Mann  wrote:
>>> 
>>> On Mar 2, 2015, at 00:29 , Quincey Morris 
>>>  wrote:
>>> 
 On Mar 2, 2015, at 00:13 , Rick Mann  wrote:
 
 The current workaround is to launch the app by tapping on it on the 
 device, then tap "Trust" in the resulting dialog. Then you can launch it. 
 But I need to debug my app's first run, and I see no way to do that.
>>> 
>>> I may be misremembering, but I believe that after you’ve responded to the 
>>> dialog you can delete the app on the device and "first-run" it from Xcode 
>>> successfully after that. I think the dialog-producing issue is not with the 
>>> app itself being new, but its provisioning profile being new, and that 
>>> isn’t an issue until you really use a new provisioning profile, even if the 
>>> app is deleted and re-copied.
>> 
>> Yeah, that's definitely not how it's behaving for me. It asks every time I 
>> first-run after deleting it.
>> 
>> But as I mentioned in my other post, the disgusting workaround is to create 
>> and install another app with the same developer ID.
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ben

> On 2 Mar 2015, at 17:42, Quincey Morris  
> wrote:
> 
> On Mar 2, 2015, at 02:44 , Ben  > wrote:
>> 
>> Since NSCell is apparently on the way out, I've been trying to build a new 
>> control I need using views. It's a cut-down spreadsheet-alike grid
> 
> I don’t see that anyone has yet asked the question of why the grid needs to 
> have subviews. Implementing the rows and columns yourself means inventing 
> your own duplicate API for managing them, but it’s likely not a lot of code, 
> assuming you only need textual editing of one cell at a time (and can 
> therefore use a single re-usable, movable text field for the editing).
> 
> So, why can’t your spreadsheet-like grid be a single custom view that draws 
> its own text and graphics in a grid-like pattern directly?
> 
>> PS. I have tried using/subclassing NSTableView and have filed a bug for the 
>> functionality that I'm after
> 
> Purely for interest’s sake, can you tell us what functionality is missing, 
> for your use-case?
> 


I hadn't considered asking my delegate for text and images directly. That could 
be a simpler way to do things - I will look into it.


The functionality that I'm missing is:

- Granularity of selection. For example single or multiple disconnected cells. 
NSTableView only gives me row or column.
- Scrollable floating headers on both axis. This I did sort-of manage with 
NSTableView by styling the first column to look like a header, but it was not 
great.

Maybe I will have another look at digging into NSTableView again.


___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Quincey Morris
On Mar 2, 2015, at 02:44 , Ben  wrote:
> 
> Since NSCell is apparently on the way out, I've been trying to build a new 
> control I need using views. It's a cut-down spreadsheet-alike grid

I don’t see that anyone has yet asked the question of why the grid needs to 
have subviews. Implementing the rows and columns yourself means inventing your 
own duplicate API for managing them, but it’s likely not a lot of code, 
assuming you only need textual editing of one cell at a time (and can therefore 
use a single re-usable, movable text field for the editing).

So, why can’t your spreadsheet-like grid be a single custom view that draws its 
own text and graphics in a grid-like pattern directly?

> PS. I have tried using/subclassing NSTableView and have filed a bug for the 
> functionality that I'm after

Purely for interest’s sake, can you tell us what functionality is missing, for 
your use-case?



___

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

Force IKImageBrowserView to regenerate a cell's image?

2015-03-02 Thread Steve Mills
Is there any way to force IKImageBrowserView to throw out a cached thumbnail 
and regenerate it on a changed imageRepresentation? I can definitely see that 
imageRepresentation is returning a different url, but the browser still draws 
the old one, even after calling reloadData.

--
Steve Mills
Drummer, Mac geek


___

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

Force a find in an NSTextView

2015-03-02 Thread Fritz Anderson
Target OS X 10.10.

How does a view controller force an NSTextView to perform a search if it 
doesn’t own the text view?



My application is a debugging tool to break an attributed string into style 
runs and display the runs in a table. I’d like to double-click a row in the 
table, and select the corresponding text in the NSTextView that displays the 
string. Eventually, I’ll have to carry the character ranges in the table data 
and use those, but this _should_ have been easy as a first attempt, and now my 
blood is up.

The text view uses a find bar, the scroll view positions it at the top. The 
text view is not editable, so the Replace UI isn’t shown. The bar shows, hides, 
and functions as expected. The table and text are on different sides of a 
split-view controller; their window controller tells the table controller about 
the text view.

There’s no problem in responding to the double-click. The table’s controller 
fills the find pasteboard with the text content of the run; other applications 
show the run’s text in their search interfaces.

My current approach is this: (Swift)

@IBAction func tableDoubleClicked(sender: NSClickGestureRecognizer) {
loadFindPasteboard(sender)  // App-specific, does what it says.
self.tag = 2
attributedTextView.performTextFinderAction(self)
}

-performTextFinderAction: is defined in NSResponder; NSTextFinder uses the 
sender’s tag to determine the verb. (Smelly, yes — it expects an NSControl or 
menu item, but duck-typing is not completely dead.) 2 is “find next.”

This works. Once. Thereafter, it’s erratic. The search field updates correctly, 
but the selection matches the previous search string. (Again, the find PB 
updates as expected in other apps.) Then the search field stops updating at 
all, but pulses the selection as if a find-next had been performed. Maybe the 
field doesn’t update, but the search result does. Using the find-panel 
interface has the same result.

Evidently I’m in some sort of cache race that may be reasonable given the 
expected use of NSTextFinder, but you’d hope a factored view controller of that 
name could be used to… find text. I don’t see a way to force the flush, or to 
force the text view’s finder to reload.

Ideas? Or should I give up and do the range highlighting I’ll have to do anyway 
eventually?


— F


___

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

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

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

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

Re: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 9:45 AM, Uli Kusterer  wrote:

> Are you re-setting *all* the views or only hiding views that scroll out and 
> moving unused views to newly exposed areas? We've been doing stuff like that 
> in various spots and performance is fine. One thing that might help is to 
> make each table-row layer-backed, then you get zero-cost moving as it simply 
> gets drawn in another location on the graphics card. …
> 
> - Make all rows layer-backed

Careful.  As noted in my previous reply, if you use layer-backed views, the 
root layer must be the scroll view or an ancestor.  Making only the rows 
layer-backed will disable responsive scrolling.

Regards,
Ken


___

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

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

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

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

Re: Application windows are expected to have a root view controller at the end of application launch

2015-03-02 Thread David Duncan

> On Mar 1, 2015, at 10:36 PM, Rick Mann  wrote:
> 
> I'm adding background downloading on remote notification, so I removed all my 
> UI code from appDidFinishLaunching. Now I get this error: "Application 
> windows are expected to have a root view controller at the end of application 
> launch"
> 
> So, I have to create UI even though I won't be displaying it?


You should only get this if you have created a window and made it visible.
--
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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ken Thomases
On Mar 2, 2015, at 8:54 AM, Ben  wrote:

> From a time profile, the majority of my code being called is funnelled 
> through a single method which handles the adding/positioning/removing of 
> views within the visible area. The slow areas are:
> 
> 8% - Instantiating new views (happens early on, views are cached for reuse)
> 20% - Positioning new/reused views (a single -setFrame: call once for each 
> view)
> 25% - Adding newly-visible subviews (-addSubview:)
> 17% - Enumerating off-screen columns for view removal 
> (-removeFromSuperviewWithoutNeedingDisplay)
> 25% - Enumerating off-screen rows for view removal 
> (-removeFromSuperviewWithoutNeedingDisplay)
> Remainder is misc small stuff. This method as a whole takes 19% of running 
> time.

What are you considering "visible" or "the visible area"?  For responsive 
scrolling, you don't want to limit it to the document view's visible rect.  You 
want to use the preparedContentRect and override -prepareContentInRect: to be 
told when that is changing.

Review this list of the "secondary" requirements to participate in responsive 
scrolling, from the AppKit release notes for 10.9 (not currently available 
online):

The list of secondary requirements are:

* Do not override -scrollWheel: in an NSScrollView, NSClipView subclass, or in 
the document view. (See the event modal notes in this section)

* Do not override -drawRect: in an NSScrollView subclass

* Do not override -lockFocus: in an NSScrollView, NSClipView subclass, or in 
the document view.

Layer backed secondary requirements:

* The root layer must be either the NSScrollView or an ancestor view

Traditional drawing secondary requirements:

* copiesOnScroll must be set to YES on the NSClipView

* The documentView must override -isOpaque and return YES

Regards,
Ken


___

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

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

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

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

Re: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ben

> On 2 Mar 2015, at 15:45, Uli Kusterer  wrote:
> 
> On 02 Mar 2015, at 15:54, Ben  > wrote:
>>> On 2 Mar 2015, at 14:10, Mike Abdullah >> > wrote:
 On 2 Mar 2015, at 11:44, Ben >>> > wrote:
 
 Hi list,
 
 Since NSCell is apparently on the way out, I've been trying to build a new 
 control I need using views. It's a cut-down spreadsheet-alike grid, 
 similar to MBTableGrid here: https://github.com/brendand/mbtablegrid 
 
 
 Unfortunately, I am running into the to-be-expected performance trouble 
 with keeping a couple of hundred subviews in my control at the same time. 
 It particularly hurts when scrolling. Stuff I've tried includes:
 
 - Removing the off-screen views when possible (still leaves about 150 on 
 screen)
 - Keeping a queue of reusable views to avoid allocating new ones
 - Attempting to have one view per grid item type and treat it like an 
 NSCell (i.e., lockFocus into the parent view and draw there)
 
 Clearly a smooth-scrolling view-based grid is possible - after all, 
 NSTableView can do it. It's a shame I can't use it for this.
 
 Does anyone have any suggestions on how to achieve decent 
 drawing/scrolling performance here?
>>> 
>>> Can you offer any more explanation as to *what* is slow in your 
>>> experiments? What is about the number of views that seems to be bogging 
>>> your control down?
>> 
>> Certainly:
>> 
>> From a time profile, the majority of my code being called is funnelled 
>> through a single method which handles the adding/positioning/removing of 
>> views within the visible area. The slow areas are:
>> 
>> 8% - Instantiating new views (happens early on, views are cached for reuse)
>> 20% - Positioning new/reused views (a single -setFrame: call once for each 
>> view)
>> 25% - Adding newly-visible subviews (-addSubview:)
>> 17% - Enumerating off-screen columns for view removal 
>> (-removeFromSuperviewWithoutNeedingDisplay)
>> 25% - Enumerating off-screen rows for view removal 
>> (-removeFromSuperviewWithoutNeedingDisplay)
>> Remainder is misc small stuff. This method as a whole takes 19% of running 
>> time.
> 
> Are you re-setting *all* the views or only hiding views that scroll out and 
> moving unused views to newly exposed areas? We've been doing stuff like that 
> in various spots and performance is fine. One thing that might help is to 
> make each table-row layer-backed, then you get zero-cost moving as it simply 
> gets drawn in another location on the graphics card. My checklist for a 
> view-based table view would be:
> 
> - Create (height/ row height) +1 row views and keep them around
> - Make all rows layer-backed
> - When scrolling, make sure you only modify the position, not the height, and 
> do not call setNeedsDisplay: on any views whose contents haven't actually 
> changed
> - when a view goes out of view, re-use it for the newly-exposed area, and 
> only then request a redraw, or otherwise hide it.
> - Mark as many views as you can as opaque.
> - Try to update items relatively to each other. I.e. just assume the 
> bottom-most view is already positioned right and place the newly-exposed 
> row's view under it, don't loop over all rows over and over again.
> 
> That said, we used to do the same without layer-backing in the Carbon and 
> Classic days and Macs had sufficient performance, so that this is taking too 
> long for you seems weird. Are these custom views? Are you rounding 
> coordinates to integers to ensure they don't subtly change size due to 
> rounding errors?
> 
> Also, I remember using PXListView (https://github.com/Perspx/PXListView 
> ) a few years ago and contributing a 
> bunch of performance fixes. It's not the code we're using these days (and it 
> has changed a bit since then), but it might do one or the other optimization 
> you're not doing, so may be a good point of reference.

Thanks for the pointers and link, there are a few of these I'm not doing yet so 
will give them a try.

- Ben



___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Uli Kusterer
On 02 Mar 2015, at 15:54, Ben  wrote:
>> On 2 Mar 2015, at 14:10, Mike Abdullah  wrote:
>>> On 2 Mar 2015, at 11:44, Ben  wrote:
>>> 
>>> Hi list,
>>> 
>>> Since NSCell is apparently on the way out, I've been trying to build a new 
>>> control I need using views. It's a cut-down spreadsheet-alike grid, similar 
>>> to MBTableGrid here: https://github.com/brendand/mbtablegrid
>>> 
>>> Unfortunately, I am running into the to-be-expected performance trouble 
>>> with keeping a couple of hundred subviews in my control at the same time. 
>>> It particularly hurts when scrolling. Stuff I've tried includes:
>>> 
>>> - Removing the off-screen views when possible (still leaves about 150 on 
>>> screen)
>>> - Keeping a queue of reusable views to avoid allocating new ones
>>> - Attempting to have one view per grid item type and treat it like an 
>>> NSCell (i.e., lockFocus into the parent view and draw there)
>>> 
>>> Clearly a smooth-scrolling view-based grid is possible - after all, 
>>> NSTableView can do it. It's a shame I can't use it for this.
>>> 
>>> Does anyone have any suggestions on how to achieve decent drawing/scrolling 
>>> performance here?
>> 
>> Can you offer any more explanation as to *what* is slow in your experiments? 
>> What is about the number of views that seems to be bogging your control down?
> 
> Certainly:
> 
> From a time profile, the majority of my code being called is funnelled 
> through a single method which handles the adding/positioning/removing of 
> views within the visible area. The slow areas are:
> 
> 8% - Instantiating new views (happens early on, views are cached for reuse)
> 20% - Positioning new/reused views (a single -setFrame: call once for each 
> view)
> 25% - Adding newly-visible subviews (-addSubview:)
> 17% - Enumerating off-screen columns for view removal 
> (-removeFromSuperviewWithoutNeedingDisplay)
> 25% - Enumerating off-screen rows for view removal 
> (-removeFromSuperviewWithoutNeedingDisplay)
> Remainder is misc small stuff. This method as a whole takes 19% of running 
> time.

Are you re-setting *all* the views or only hiding views that scroll out and 
moving unused views to newly exposed areas? We've been doing stuff like that in 
various spots and performance is fine. One thing that might help is to make 
each table-row layer-backed, then you get zero-cost moving as it simply gets 
drawn in another location on the graphics card. My checklist for a view-based 
table view would be:

- Create (height/ row height) +1 row views and keep them around
- Make all rows layer-backed
- When scrolling, make sure you only modify the position, not the height, and 
do not call setNeedsDisplay: on any views whose contents haven't actually 
changed
- when a view goes out of view, re-use it for the newly-exposed area, and only 
then request a redraw, or otherwise hide it.
- Mark as many views as you can as opaque.
- Try to update items relatively to each other. I.e. just assume the 
bottom-most view is already positioned right and place the newly-exposed row's 
view under it, don't loop over all rows over and over again.

That said, we used to do the same without layer-backing in the Carbon and 
Classic days and Macs had sufficient performance, so that this is taking too 
long for you seems weird. Are these custom views? Are you rounding coordinates 
to integers to ensure they don't subtly change size due to rounding errors?

Also, I remember using PXListView (https://github.com/Perspx/PXListView 
) a few years ago and contributing a 
bunch of performance fixes. It's not the code we're using these days (and it 
has changed a bit since then), but it might do one or the other optimization 
you're not doing, so may be a good point of reference.

Cheers,
-- Uli
http://stacksmith .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: NSTextView Copy-and-Paste Problem

2015-03-02 Thread Charles Jenkins
Can I convince anyone to look at my demo app and tell me what if anything I'm 
doing wrong?

I can hardly believe copying and pasting in a text view would lose or replace 
attributes like this . . . seems like a very serious bug someone would have 
noticed long before me.

-- 

Charles

On February 28, 2015 at 06:25:39, Charles Jenkins (cejw...@gmail.com) wrote:

I’m having problems with text attributes getting mangled by copy-and-paste 
operations within the selfsame text view. Obviously text pasted in from outside 
the app would have an unpredictable set of attributes, but you’d think copying 
and pasting in the same text view would leave you with a consistent set of 
attributes.

I fought the Swift battle to create a quick-and-dirty demonstration app which, 
if you are so inclined, you can check out from GitHub:

https://github.com/CharlesJenkins/TextViewRevealer/tree/master

(This is my first foray into GitHub, so let me know if something is missing 
from my project.)

I’d like to know if this behavior is expected or a bug, or if there is 
something else I’m supposed to do in my code to make copying and pasting work 
better by faithfully copying text attributes.

— 

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 copy one project product to another project Resources on build (relative path)

2015-03-02 Thread Juanjo Conti
Thanks, seems I managed to achieve it with option 1.

On Mon, Mar 2, 2015 at 11:16 AM, Steve Mills  wrote:

> On Mar 2, 2015, at 07:02:47, Juanjo Conti 
> wrote:
> >
> > I did what you said and then went to A target and add an item (B product)
> > to Copy Bundle Resources. In the xml file I still see the absolute path.
> > What am I missing?
>
> Ah. It can't be relative to the project, because the file you're adding is
> in its own project's build products folder. I'd suggest one of two
> solutions.
>
> 1) Put both projects into a single workspace. That makes cross-project
> links much easier.
>
> 2) Have the project that builds the bundle copy the final result to a
> known folder that is relative to project B, e.g.:
>
> ~/Projects/MyLibs/MyBundleThatIUseInOtherProjects.bundle
> ~/Projects/MyApp/MyApp.xcodeproj
>
> That way the bundle can easily be added as a relative path. And when you
> sync your source on another machine (you didn't mention if you're using an
> SCM or not, but it would be silly not to) and build the bundle, it will go
> to a known relative folder.
>
> --
> Steve Mills
> Drummer, Mac geek
>
>


-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Ben

> On 2 Mar 2015, at 14:10, Mike Abdullah  wrote:
> 
>> 
>> On 2 Mar 2015, at 11:44, Ben  wrote:
>> 
>> Hi list,
>> 
>> Since NSCell is apparently on the way out, I've been trying to build a new 
>> control I need using views. It's a cut-down spreadsheet-alike grid, similar 
>> to MBTableGrid here: https://github.com/brendand/mbtablegrid
>> 
>> Unfortunately, I am running into the to-be-expected performance trouble with 
>> keeping a couple of hundred subviews in my control at the same time. It 
>> particularly hurts when scrolling. Stuff I've tried includes:
>> 
>> - Removing the off-screen views when possible (still leaves about 150 on 
>> screen)
>> - Keeping a queue of reusable views to avoid allocating new ones
>> - Attempting to have one view per grid item type and treat it like an NSCell 
>> (i.e., lockFocus into the parent view and draw there)
>> 
>> Clearly a smooth-scrolling view-based grid is possible - after all, 
>> NSTableView can do it. It's a shame I can't use it for this.
>> 
>> Does anyone have any suggestions on how to achieve decent drawing/scrolling 
>> performance here?
> 
> Can you offer any more explanation as to *what* is slow in your experiments? 
> What is about the number of views that seems to be bogging your control down?

Certainly:

From a time profile, the majority of my code being called is funnelled through 
a single method which handles the adding/positioning/removing of views within 
the visible area. The slow areas are:

 8% - Instantiating new views (happens early on, views are cached for reuse)
20% - Positioning new/reused views (a single -setFrame: call once for each view)
25% - Adding newly-visible subviews (-addSubview:)
17% - Enumerating off-screen columns for view removal 
(-removeFromSuperviewWithoutNeedingDisplay)
25% - Enumerating off-screen rows for view removal 
(-removeFromSuperviewWithoutNeedingDisplay)
Remainder is misc small stuff. This method as a whole takes 19% of running time.

The grid typically has up to 50 columns and 1000 rows. There is a hard upper 
limit of 2000 columns and no reasonable limit on rows. I intend to paginate 
these.

In my test project, I am assuming around 10 columns and 40 rows visible, giving 
400 views visible. Maybe slightly more to allow for those just offscreen.

None of the above even begins to think about memory usage (Idle ~40MB, under 
fast scrolling up to 300MB)

Thanks,

Ben





___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Steve Mills
On Mar 2, 2015, at 08:25:05, Steve Mills  wrote:
> 
> Have you profiles it to see what's taking all the time?

Yerg. "profiled"

--
Steve Mills
Drummer, Mac geek

___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Steve Mills
On Mar 2, 2015, at 04:44:12, Ben  wrote:
> 
> Since NSCell is apparently on the way out, I've been trying to build a new 
> control I need using views. It's a cut-down spreadsheet-alike grid, similar 
> to MBTableGrid here: https://github.com/brendand/mbtablegrid
> 
> Unfortunately, I am running into the to-be-expected performance trouble with 
> keeping a couple of hundred subviews in my control at the same time. It 
> particularly hurts when scrolling. Stuff I've tried includes:
> 
> - Removing the off-screen views when possible (still leaves about 150 on 
> screen)
> - Keeping a queue of reusable views to avoid allocating new ones
> - Attempting to have one view per grid item type and treat it like an NSCell 
> (i.e., lockFocus into the parent view and draw there)

Have you profiles it to see what's taking all the time?

--
Steve Mills
Drummer, Mac geek


___

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 copy one project product to another project Resources on build (relative path)

2015-03-02 Thread Steve Mills
On Mar 2, 2015, at 07:02:47, Juanjo Conti  wrote:
> 
> I did what you said and then went to A target and add an item (B product)
> to Copy Bundle Resources. In the xml file I still see the absolute path.
> What am I missing?

Ah. It can't be relative to the project, because the file you're adding is in 
its own project's build products folder. I'd suggest one of two solutions.

1) Put both projects into a single workspace. That makes cross-project links 
much easier.

2) Have the project that builds the bundle copy the final result to a known 
folder that is relative to project B, e.g.:

~/Projects/MyLibs/MyBundleThatIUseInOtherProjects.bundle
~/Projects/MyApp/MyApp.xcodeproj

That way the bundle can easily be added as a relative path. And when you sync 
your source on another machine (you didn't mention if you're using an SCM or 
not, but it would be silly not to) and build the bundle, it will go to a known 
relative folder.

--
Steve Mills
Drummer, Mac geek


___

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: Responsive scrolling control with lots of subviews

2015-03-02 Thread Mike Abdullah

> On 2 Mar 2015, at 11:44, Ben  wrote:
> 
> Hi list,
> 
> Since NSCell is apparently on the way out, I've been trying to build a new 
> control I need using views. It's a cut-down spreadsheet-alike grid, similar 
> to MBTableGrid here: https://github.com/brendand/mbtablegrid
> 
> Unfortunately, I am running into the to-be-expected performance trouble with 
> keeping a couple of hundred subviews in my control at the same time. It 
> particularly hurts when scrolling. Stuff I've tried includes:
> 
> - Removing the off-screen views when possible (still leaves about 150 on 
> screen)
> - Keeping a queue of reusable views to avoid allocating new ones
> - Attempting to have one view per grid item type and treat it like an NSCell 
> (i.e., lockFocus into the parent view and draw there)
> 
> Clearly a smooth-scrolling view-based grid is possible - after all, 
> NSTableView can do it. It's a shame I can't use it for this.
> 
> Does anyone have any suggestions on how to achieve decent drawing/scrolling 
> performance here?

Can you offer any more explanation as to *what* is slow in your experiments? 
What is about the number of views that seems to be bogging your control 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 copy one project product to another project Resources on build (relative path)

2015-03-02 Thread Juanjo Conti
Discard my last email. I've re read yours and understood it.

I did what you said and then went to A target and add an item (B product)
to Copy Bundle Resources. In the xml file I still see the absolute path.
What am I missing?

On Mon, Mar 2, 2015 at 1:02 AM, Joar Wingfors  wrote:

> Select the reference to project B in project A. Open the File inspector.
> Change the "Location" pop-up from "Absolute" to "Relative to Project".
>
> Joar
>
>
> > On 1 mar 2015, at 19:27, Juanjo Conti  wrote:
> >
> > Hi!
> >
> > I have a project, let' call it A which contains another one, let's call
> it
> > B.
> >
> > A producto of B is used by A, so I'm copying it in A build phase to
> > Resources folder.
> >
> > The problem is that in A.xcodeproj/project.pbxproj I see the absolute
> path
> > of the product been copied:
> >
> > 81CBEDD41A9FA5740015BEE2 /* ProductName */ = {isa = PBXFileReference;
> > explicitFileType = wrapper.cfbundle; name = ProductName; path =
> >
> "/Users/xxx/Library/Developer/Xcode/DerivedData/Worspace-dygmdtnwaxtdegfcwjuatbfcygfg/Build/Products/Debug/ProductName";
> > sourceTree = ""; };
> >
> > The problem with this is that if I want to build A in another machine, it
> > fails.
> >
> > How can I achieve this in a way not dependent of my machine?
> >
> > Thanks in advance,
> >
> > --
> >
> > Juanjo Conti http://goog_2023646312>@carouselapps.com
> > >
> >
> > Software Engineer - Carousel Apps 
> >
> > --
> > Carousel Apps Limited, registered in England & Wales with registered
> number
> > 7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket
> > Street, London SE1 3HN. Any communication sent by or on behalf of
> Carousel
> > App Ltd or any of its subsidiary, holding or affiliated companies or
> > entities (together "Watu") is confidential and may be privileged or
> > otherwise protected. If you receive it in error please inform us and then
> > delete it from your system. You should not copy it or disclose its
> contents
> > to anyone. Messages sent to and from Watu may be monitored to ensure
> > compliance with our internal policies and to protect our business. Emails
> > are not secure and cannot be guaranteed to be error free. Anyone who
> > communicates with us by email is taken to accept these risks.
> > ___
> >
> > 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/joar%40joar.com
> >
> > This email sent to j...@joar.com
>
>


-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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

Responsive scrolling control with lots of subviews

2015-03-02 Thread Ben
Hi list,

Since NSCell is apparently on the way out, I've been trying to build a new 
control I need using views. It's a cut-down spreadsheet-alike grid, similar to 
MBTableGrid here: https://github.com/brendand/mbtablegrid

Unfortunately, I am running into the to-be-expected performance trouble with 
keeping a couple of hundred subviews in my control at the same time. It 
particularly hurts when scrolling. Stuff I've tried includes:

- Removing the off-screen views when possible (still leaves about 150 on screen)
- Keeping a queue of reusable views to avoid allocating new ones
- Attempting to have one view per grid item type and treat it like an NSCell 
(i.e., lockFocus into the parent view and draw there)

Clearly a smooth-scrolling view-based grid is possible - after all, NSTableView 
can do it. It's a shame I can't use it for this.

Does anyone have any suggestions on how to achieve decent drawing/scrolling 
performance here?


- Ben


PS. I have tried using/subclassing NSTableView and have filed a bug for the 
functionality that I'm after (rdar://17406314  marked as dupe 
of rdar://2778108 ).
___

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: iOS App trust on first launch

2015-03-02 Thread Rick Mann

> On Mar 2, 2015, at 00:29 , Quincey Morris 
>  wrote:
> 
> On Mar 2, 2015, at 00:13 , Rick Mann  wrote:
>> 
>> The current workaround is to launch the app by tapping on it on the device, 
>> then tap "Trust" in the resulting dialog. Then you can launch it. But I need 
>> to debug my app's first run, and I see no way to do that.
> 
> I may be misremembering, but I believe that after you’ve responded to the 
> dialog you can delete the app on the device and "first-run" it from Xcode 
> successfully after that. I think the dialog-producing issue is not with the 
> app itself being new, but its provisioning profile being new, and that isn’t 
> an issue until you really use a new provisioning profile, even if the app is 
> deleted and re-copied.

Yeah, that's definitely not how it's behaving for me. It asks every time I 
first-run after deleting it.

But as I mentioned in my other post, the disgusting workaround is to create and 
install another app with the same developer ID.

-- 
Rick Mann
rm...@latencyzero.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: iOS App trust on first launch

2015-03-02 Thread Rick Mann
Well, here's one workaround. Xcode should handle this for me, in some way. I 
should be able to bless my phone to accept apps from my Xcode.

BUT: You can make another app signed with the same developer cert, install 
that, run it once just in case, and trust it. Then the app you're working on 
won't prompt each time.

> On Mar 2, 2015, at 00:13 , Rick Mann  wrote:
> 
> This new behavior where I can't launch an app from Xcode really sucks. Is 
> there any way around it?
> 
> The current workaround is to launch the app by tapping on it on the device, 
> then tap "Trust" in the resulting dialog. Then you can launch it. But I need 
> to debug my app's first run, and I see no way to do that.
> 
> Any ideas?
> 
> -- 
> Rick Mann
> rm...@latencyzero.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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
Rick Mann
rm...@latencyzero.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: iOS App trust on first launch

2015-03-02 Thread Quincey Morris
On Mar 2, 2015, at 00:13 , Rick Mann  wrote:
> 
> The current workaround is to launch the app by tapping on it on the device, 
> then tap "Trust" in the resulting dialog. Then you can launch it. But I need 
> to debug my app's first run, and I see no way to do that.

I may be misremembering, but I believe that after you’ve responded to the 
dialog you can delete the app on the device and "first-run" it from Xcode 
successfully after that. I think the dialog-producing issue is not with the app 
itself being new, but its provisioning profile being new, and that isn’t an 
issue until you really use a new provisioning profile, even if the app is 
deleted and re-copied.

___

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

iOS App trust on first launch

2015-03-02 Thread Rick Mann
This new behavior where I can't launch an app from Xcode really sucks. Is there 
any way around it?

The current workaround is to launch the app by tapping on it on the device, 
then tap "Trust" in the resulting dialog. Then you can launch it. But I need to 
debug my app's first run, and I see no way to do that.

Any ideas?

-- 
Rick Mann
rm...@latencyzero.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