Custom UIView delegate - .ValueChanged?

2015-12-09 Thread Eric E. Dolecki
I have a custom UIView and I would like to hook it up to .ValueChanged just
like with sliders, etc.

Is there a bit of sample code in how to wire such a custom delegate up?

Thanks,
Eric
___

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

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

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

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

NSViewController -identifier unrecognized selecto problem

2015-12-09 Thread Jonathan Mitchell
NSViewController conforms to NSUserInterfaceItemIdentification so should 
implement 
@property (nullable, copy) NSString *identifier;

I build my app on 10.11 with a deployment target of 10.9

Om 10.10 and 10.11 no issues.
On 10.9 I get

'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]: 
unrecognized selector sent to instance 0x6018ee10’
TSToolbarGroup is an NSViewController subclass of mine

How can this be?
I didn’t have this issue when I built against 10.9 rather than 10.11.

Curiously the header for NSViewController on 10.11 doesn’t define any 
identifier accessors.

When building solely for 10.9 I used to declare an identifier property on my 
view controller subclasses (obviously with good reason, though why I thought 
this was necessary I don’t know now)
@property (strong) NSString *identifier;
But Xcode 7 moans about property synthesis when this is present.

J














___

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

Please do not post 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: NSViewController -identifier unrecognized selecto problem

2015-12-09 Thread Quincey Morris
On Dec 9, 2015, at 09:20 , Jonathan Mitchell  wrote:
> 
> On 10.9 I get
> 
> 'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]: 
> unrecognized selector sent to instance 0x6018ee10’

You get this … when? When the NIB is loaded?

> TSToolbarGroup is an NSViewController subclass of mine
> 
> How can this be?
> I didn’t have this issue when I built against 10.9 rather than 10.11.

Are you using a XIB or a storyboard? My guess is that you’re using a XIB and 
its IB “Builds for” setting is not set to “Project deployment target”.

> Curiously the header for NSViewController on 10.11 doesn’t define any 
> identifier accessors.

It doesn’t need to do so there, because it conforms to the protocol that 
requires it. All it needs is to have an implementation.

The only real mystery is why it doesn’t have the implementation under 10.9. 
It’s possible that the implementation is added at runtime, depending on which 
OS X version it’s running under, which is why the “Builds for” setting might 
matter.

> When building solely for 10.9 I used to declare an identifier property on my 
> view controller subclasses (obviously with good reason, though why I thought 
> this was necessary I don’t know now)
> @property (strong) NSString *identifier;
> But Xcode 7 moans about property synthesis when this is present.

You don’t say what the error is, but presumably it’s complaining that the 
property attributes don’t match the protocol.
___

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

Please do not post 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: LSSharedFIleList API deprecated

2015-12-09 Thread Greg Weston
> I opened a radar a while back and got this answer:
> 
> "Shared file lists are no longer supported. There is no exact replacement 
> API.”
> “If you want to manage your recent documents list, you should use 
> NSDocumentController."
> “If you want to run a background tool independent of your main application, 
> you should use a Launch Agent."
> 
> My application already uses NSDocumentController; however, there is no means 
> to remove a recent item from the list and my application uses 
> LSSharedFileListItemRemove. I updated the radar with the need to remove 
> recent items. No word yet.
> —kevin

While not optimal, I would imagine this could be accomplished with a 
combination of recentDocumentURLs, clearRecentDocuments: and 
noteNewRecentDocumentURL:.

Greg
___

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

Please do not post 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: NSViewController -identifier unrecognized selecto problem

2015-12-09 Thread Kyle Sluder
On Wed, Dec 9, 2015, at 11:20 AM, Jonathan Mitchell wrote:
> NSViewController conforms to NSUserInterfaceItemIdentification so should
> implement 
> @property (nullable, copy) NSString *identifier;
> 
> I build my app on 10.11 with a deployment target of 10.9
> 
> Om 10.10 and 10.11 no issues.
> On 10.9 I get
> 
> 'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]:
> unrecognized selector sent to instance 0x6018ee10’
> TSToolbarGroup is an NSViewController subclass of mine

As per the AppKit release notes, NSViewController only started
conforming to NSUserInterfaceItemIdentification in 10.10. Sadly, the are
no availability macros for conformances.

You might consider filing a bug report about this, but in the meantime
you'll need to stop sending -identifier to your view controllers when
running on 10.9.

--Kyle Sluder

___

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

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

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

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

Scroll-vs-zoom for scroll balls

2015-12-09 Thread Rick Mann
In the past, I've always hated that non-Mac apps (e.g. CAD programs, Google 
Maps, etc.) misinterpret the scroll ball on my Mighty Mouse, or two-finger 
gestures on the trackpad, as zoom and not pan.

But there is a certain convenience to being able to zoom precisely with these 
gestures. I'd like to interpret vertical scroll as zoom in my 3D app, if the 
user is holding down a meta key (or is otherwise in a zoom mode).

I'm using SCNView, which AFAICT has no zoom functionality. I'm hoping I an 
intercept the scroll events and use that to reposition my camera, but I don't 
actually know how to do that. That is, what's the NSView method to override to 
capture scroll events? Is it -scrollWheel:, or 

For robustness, I'd like to have any momentum continue to apply to the zoom 
operation, even if the user releases the meta key before the momentum scroll 
ends.

What do you guys think about this UX, pan-vs-zoom interpretations of scroll 
events?

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

Re: Scroll-vs-zoom for scroll balls

2015-12-09 Thread Graham Cox

> On 10 Dec 2015, at 8:20 AM, Rick Mann  wrote:
> 
> Is it -scrollWheel:


Yes. 



> For robustness, I'd like to have any momentum continue to apply to the zoom 
> operation, even if the user releases the meta key before the momentum scroll 
> ends.


Personally I dislike ‘momentum’, it conflicts with ‘precision’. At least give 
your users a way to opt out.

—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: Scroll-vs-zoom for scroll balls

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 14:14 , Graham Cox  wrote:
> 
> 
>> On 10 Dec 2015, at 8:20 AM, Rick Mann  wrote:
>> 
>> Is it -scrollWheel:
> 
> 
> Yes. 
> 
> 
> 
>> For robustness, I'd like to have any momentum continue to apply to the zoom 
>> operation, even if the user releases the meta key before the momentum scroll 
>> ends.
> 
> 
> Personally I dislike ‘momentum’, it conflicts with ‘precision’. At least give 
> your users a way to opt out.

I think it's the difference between a flick and a non-flick. If I "throw" the 
model (or camera), it can keep spinning. If I stop moving before I let go of 
the mouse button or lift off the trackpad, it should stay put there.

In this mode, there'd be no momentum from a Mighty Mouse scroll ball, ever.


-- 
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

Determining underlying type of array in swift?

2015-12-09 Thread Rick Mann
If I have var foo : [Int], how can I get that type, Int? I need to get the size 
of each element. Alternatively, I need the size of the array in bytes. I'd like 
to write the code generically. E.g., in C, I could do this:

int myArray[] = ...;
sizeof(*myArray)

Even if myArray is empty or NULL.

-- 
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

CG Error with popovers - known issue?

2015-12-09 Thread Graham Cox
I’m getting this message logged when I show a popover sometimes:

Dec 10 09:33:47  ##myApp##[4602] : Error: this application, or a library 
it uses, has passed an invalid numeric value (NaN, or not-a-number) to 
CoreGraphics API and this value is being ignored.Please fix this problem.


Stack trace:

#0  0x7fff946b2073 in CGPostError ()
#1  0x7fff9468c55e in CGFloatValidateWithLog ()
#2  0x7fff943b4a26 in CGPathAddLineToPoint ()
#3  0x7fff925600d7 in _CUICreateNewPopoverPathWithArrowPosition ()
#4  0x7fff925605cc in _CUICreateNewPopoverPath ()
#5  0x7fff9258d792 in CUICoreThemeRenderer::DrawPopover(CUIDescriptor 
const*) ()
#6  0x7fff9251d065 in CUIRenderer::Draw(CGRect, CGContext*, 
__CFDictionary const*, __CFDictionary const**) ()
#7  0x7fff9251f9c4 in CUIDraw ()
#8  0x7fff8d04156d in __44-[NSAppearance 
_drawInRect:context:options:]_block_invoke ()
#9  0x7fff8cfb5af3 in -[NSCompositeAppearance _callCoreUIWithBlock:] ()
#10 0x7fff8d041526 in -[NSAppearance _drawInRect:context:options:] ()
#11 0x7fff8d943e93 in -[NSPopoverFrame _drawFrameMaskInRect:] ()
#12 0x7fff8d943b06 in -[NSPopoverFrame _frameMask] ()
#13 0x7fff8d226dcd in -[NSPopoverFrame shapeWindow] ()
#14 0x7fff8d227e3d in -[NSPopoverFrame 
tileAndSetWindowShape:updateContentView:] ()
#15 0x7fff8d2279b8 in -[NSPopover _updateAnchorPointForFrame:reshape:] 
()
#16 0x7fff8d227855 in -[_NSPopoverWindow setFrame:display:] ()
#17 0x7fff8d2251e1 in -[NSPopover _makePopoverWindowIfNeeded] ()
#18 0x7fff8d224ae5 in -[NSPopover 
showRelativeToRect:ofView:preferredEdge:] ()


As far as I can see the parameters I’m passing to 
-showRelativeToRect:ofView:preferredEdge: are sane and sensible:

_cmdSEL "showRelativeToRect:ofView:preferredEdge:"
positioningRect NSRect  (origin = (x = 20, y = 74), size = (width = 55, height 
= 19))   
positioningView NSView *0x60334fa0
preferredEdge   NSRectEdge  2

Anyone else seen this? Seems to be arsing deep in the internals of drawing the 
popover frame.

It’s not happening on all popovers, but frequently enough that it’s causing me 
concern.

—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

Supporting iPad Pro keyboard in iOS apps?

2015-12-09 Thread Rick Mann
Our app, which seems to run just fine on iPad Pro, nevertheless presents an 
old-style keyboard when editing fields. The iPad Pro has a (graphical) keyboard 
with more keys than previous devices. But ours shows a blown-up version of the 
older keyboard.

No matter what search term I use, I can't find anything about this from a 
developer's perspective, just discussions about iPad Pro features.

I'm hoping it's something trivial we need to adjust in our app.

Thoughts? 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

iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann
One of the WWDC videos stressed that iOS apps are given no more than 600 MB of 
RAM. Our app is VERY RAM-intensive. On iPad pro, very large documents continue 
to run without crashing like they do on previous devices. Does the iPad Pro 
allow apps more RAM?

TIA,

-- 
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: Determining underlying type of array in swift?

2015-12-09 Thread Quincey Morris
On Dec 9, 2015, at 14:35 , Rick Mann  wrote:
> 
> If I have var foo : [Int], how can I get that type, Int? I need to get the 
> size of each element.

I imagine there’s a direct way, but I can’t find it in a program. You can do 
something like this:

strideofValue (foo [0]) // but this requires foo.count 
!= 0, or:
strideof (foo [0].dynamicType)  // which seems to work in a 
playground even for empty arrays

Note that I’m not sure there’s an API guarantee that the Array<> elements are 
stored contiguously in memory. If you want that, you should probably use 
ContiguousArray<> instead. (That also gives you API to directly/unsafely access 
the memory too, IIRTGHF** correctly.)

Do be careful, though. If you’re accessing Ints raw-ly, and (say) saving them 
or transmitting them to another application or platform, you might also have to 
worry about element size and endianness differences, theoretically.


** "If I Read The Generated Header File"
___

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

Please do not post 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: NSViewController -identifier unrecognized selecto problem

2015-12-09 Thread Jonathan Mitchell
HI Kyle.
Thanks for that.
I totally missed the fact that NSUserInterfaceItemIdentification is a recent 
addition.
Looks like I will just have to refactor.

J
> On 9 Dec 2015, at 21:19, Kyle Sluder  wrote:
> 
> On Wed, Dec 9, 2015, at 11:20 AM, Jonathan Mitchell wrote:
>> NSViewController conforms to NSUserInterfaceItemIdentification so should
>> implement 
>> @property (nullable, copy) NSString *identifier;
>> 
>> I build my app on 10.11 with a deployment target of 10.9
>> 
>> Om 10.10 and 10.11 no issues.
>> On 10.9 I get
>> 
>> 'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]:
>> unrecognized selector sent to instance 0x6018ee10’
>> TSToolbarGroup is an NSViewController subclass of mine
> 
> As per the AppKit release notes, NSViewController only started
> conforming to NSUserInterfaceItemIdentification in 10.10. Sadly, the are
> no availability macros for conformances.
> 
> You might consider filing a bug report about this, but in the meantime
> you'll need to stop sending -identifier to your view controllers when
> running on 10.9.
> 
> --Kyle Sluder
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com
> 
> This email sent to jonat...@mugginsoft.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: Determining underlying type of array in swift?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 14:57 , Quincey Morris 
>  wrote:
> 
> On Dec 9, 2015, at 14:35 , Rick Mann  wrote:
>> 
>> If I have var foo : [Int], how can I get that type, Int? I need to get the 
>> size of each element.
> 
> I imagine there’s a direct way, but I can’t find it in a program. You can do 
> something like this:
> 
>   strideofValue (foo [0]) // but this requires foo.count 
> != 0, or:
>   strideof (foo [0].dynamicType)  // which seems to work in a 
> playground even for empty arrays
> 
> Note that I’m not sure there’s an API guarantee that the Array<> elements are 
> stored contiguously in memory. If you want that, you should probably use 
> ContiguousArray<> instead. (That also gives you API to directly/unsafely 
> access the memory too, IIRTGHF** correctly.)
> 
> Do be careful, though. If you’re accessing Ints raw-ly, and (say) saving them 
> or transmitting them to another application or platform, you might also have 
> to worry about element size and endianness differences, theoretically.

Actually, looking further, what I have is an UnsafePointer. This is 
actually coming from Objective-C++ code (it's how I bridge my Swift code to our 
extensive C++ codebase). The class has a property:

@property (nonatomic, readonly, nullable)const int*faceIndexes;

Which shows up in swift as UnsafePointer, and I can treat it as an array:

myObjCObj.faceIndexes[0]

So, really, I need to get at the UnsafePointer's type. Is that:

var up: UnsafePointer
sizeof(up.memory.dynamicType)

That seems to work. Wordy, but gets the job done.

> 
> ** "If I Read The Generated Header File"


-- 
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

NSView -identifier - is there more to it?

2015-12-09 Thread Jonathan Mitchell
The docs for the NSUserInterfaceItemIdentification protocol for @property(copy) 
NSString *identifier say:

If you create an item in Interface Builder and do not set a value for this 
string, a unique value is created for the item when the nib file is loaded. 

and

You should not change the value of a window’s identifier after adding any views 
to the window. For views and controls in a window, the value you specify for 
this string must be unique on a per-window basis.

I have a ton of deeply nested dynamic UI and it really helps when using the 
Xcode UI debug tools to have a meaningful view identifier - say the view 
controller class name.

When views are loaded from nibs they do have an identifier but it seems to be 
very far from unique - the trace below is for initial views for one window.

So the questions are:

1. Does AppKit make any use of NSView -identifier to influence actual rendering 
behaviour? Accessibility APIs?
2. Is uniqueness at all necessary?

Thanks

Jonathan

2015-12-09 22:55:46.752 Buster[-] _NS:9
2015-12-09 22:55:47.000 Buster[-] _NS:17
2015-12-09 22:55:47.327 Buster[-] _NS:9
2015-12-09 22:55:47.334 Buster[-] _NS:132
2015-12-09 22:55:47.340 Buster[-] _NS:11
2015-12-09 22:55:47.341 Buster[-] _NS:10
2015-12-09 22:55:47.390 Buster[-] _NS:10
2015-12-09 22:55:47.392 Buster[-] _NS:10
2015-12-09 22:55:47.396 Buster[-] _NS:10
2015-12-09 22:55:47.399 Buster[-] _NS:10
2015-12-09 22:55:48.495 Buster[-] _NS:10
2015-12-09 22:55:48.960 Buster[-] _NS:10
2015-12-09 22:55:49.197 Buster[-] _NS:10
2015-12-09 22:55:49.804 Buster[-] _NS:48
2015-12-09 22:55:49.807 Buster[-] _NS:53
2015-12-09 22:55:49.809 Buster[-] _NS:10
2015-12-09 22:55:49.811 Buster[-] _NS:10
2015-12-09 22:55:49.814 Buster[-] _NS:12
2015-12-09 22:55:49.815 Buster[-] _NS:10
2015-12-09 22:55:49.817 Buster[-] _NS:10
2015-12-09 22:55:49.819 Buster[-] _NS:10
2015-12-09 22:55:49.820 Buster[-] _NS:10
2015-12-09 22:55:49.821 Buster[-] _NS:10
2015-12-09 22:55:49.822 Buster[-] _NS:10
2015-12-09 22:55:49.824 Buster[-] _NS:10
2015-12-09 22:55:49.825 Buster[-] _NS:10
2015-12-09 22:55:49.827 Buster[-] _NS:10
2015-12-09 22:55:49.828 Buster[-] _NS:10
2015-12-09 22:55:49.830 Buster[-] _NS:10
2015-12-09 22:55:49.831 Buster[-] _NS:10
2015-12-09 22:55:49.833 Buster[-] _NS:10
2015-12-09 22:55:49.836 Buster[-] _NS:9
2015-12-09 22:55:49.843 Buster[-] _NS:9
2015-12-09 22:55:49.847 Buster[-] _NS:43
2015-12-09 22:55:50.038 Buster[-] _NS:53
2015-12-09 22:55:50.376 Buster[-] _NS:36
2015-12-09 22:55:50.377 Buster[-] _NS:9
2015-12-09 22:55:50.394 Buster[-] _NS:36
2015-12-09 22:55:50.395 Buster[-] _NS:9
2015-12-09 22:55:50.419 Buster[-] _NS:10
2015-12-09 22:55:50.460 Buster[-] _NS:10



Regards

Jonathan Mitchell
Mugginsoft LLP

jonat...@mugginsoft.com
-
KosmicTask - the Integrated Scripting Environment for OS X.
http://www.mugginsoft.com/KosmicTask
-
Follow on Twitter @KosmicTask
-
Github http://github.com/mugginsoft













___

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

Please do not post 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: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke

> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
> 
> One of the WWDC videos stressed that iOS apps are given no more than 600 MB 
> of RAM. Our app is VERY RAM-intensive. 

Slightly off-topic, but I wonder if you could use mmap to give your app more 
address space? Create a big empty file, mmap it as writeable, then use a custom 
allocator to manage memory in the mapped space.

(This doesn’t actually give you more RAM; the mapped address space will tend to 
get paged out to storage so it’ll definitely be slower than real RAM, but it’s 
better than crashing!)

—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: iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
> 
> 
>> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
>> 
>> One of the WWDC videos stressed that iOS apps are given no more than 600 MB 
>> of RAM. Our app is VERY RAM-intensive. 
> 
> Slightly off-topic, but I wonder if you could use mmap to give your app more 
> address space? Create a big empty file, mmap it as writeable, then use a 
> custom allocator to manage memory in the mapped space.
> 
> (This doesn’t actually give you more RAM; the mapped address space will tend 
> to get paged out to storage so it’ll definitely be slower than real RAM, but 
> it’s better than crashing!)

That's an interesting thought. We're also very compute intensive, so the speed 
hit might obviate the advantages. Worth considering, though.


-- 
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: Supporting iPad Pro keyboard in iOS apps?

2015-12-09 Thread SevenBits
Is it a matter of building with an newer SDK?

On Wednesday, December 9, 2015, Rick Mann  wrote:

> Our app, which seems to run just fine on iPad Pro, nevertheless presents
> an old-style keyboard when editing fields. The iPad Pro has a (graphical)
> keyboard with more keys than previous devices. But ours shows a blown-up
> version of the older keyboard.
>
> No matter what search term I use, I can't find anything about this from a
> developer's perspective, just discussions about iPad Pro features.
>
> I'm hoping it's something trivial we need to adjust in our app.
>
> Thoughts? 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/sevenbitstech%40gmail.com
>
> This email sent to sevenbitst...@gmail.com 
___

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

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

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

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

Re: Supporting iPad Pro keyboard in iOS apps?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 15:50 , SevenBits  wrote:
> 
> Is it a matter of building with an newer SDK?

I don't think so; we're building with the latest.

> 
> On Wednesday, December 9, 2015, Rick Mann  wrote:
> Our app, which seems to run just fine on iPad Pro, nevertheless presents an 
> old-style keyboard when editing fields. The iPad Pro has a (graphical) 
> keyboard with more keys than previous devices. But ours shows a blown-up 
> version of the older keyboard.
> 
> No matter what search term I use, I can't find anything about this from a 
> developer's perspective, just discussions about iPad Pro features.
> 
> I'm hoping it's something trivial we need to adjust in our app.
> 
> Thoughts? 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/sevenbitstech%40gmail.com
> 
> This email sent to sevenbitst...@gmail.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: NSView -identifier - is there more to it?

2015-12-09 Thread Quincey Morris
On Dec 9, 2015, at 15:17 , Jonathan Mitchell  wrote:
> 
> Does AppKit make any use of NSView -identifier to influence actual rendering 
> behaviour? Accessibility APIs?

According to the docs, it’s used for 2 purposes:

1. For cell views of view-based table views, it is the identifier passed into 
the delegate method that creates cell views.

2. It’s used by NSWindow state restoration. Whether it actually makes a 
difference for NSViewController subclasses, I don’t know.

Other than that, it’s a comment only, AFAIK
___

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

Please do not post 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: iPad Pro apps given more memory?

2015-12-09 Thread David Duncan

> On Dec 9, 2015, at 3:36 PM, Rick Mann  wrote:
> 
> 
>> On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
>>> 
>>> One of the WWDC videos stressed that iOS apps are given no more than 600 MB 
>>> of RAM. Our app is VERY RAM-intensive. 
>> 
>> Slightly off-topic, but I wonder if you could use mmap to give your app more 
>> address space? Create a big empty file, mmap it as writeable, then use a 
>> custom allocator to manage memory in the mapped space.
>> 
>> (This doesn’t actually give you more RAM; the mapped address space will tend 
>> to get paged out to storage so it’ll definitely be slower than real RAM, but 
>> it’s better than crashing!)
> 
> That's an interesting thought. We're also very compute intensive, so the 
> speed hit might obviate the advantages. Worth considering, though.

The virtual limit is 2GB on most devices right now, so you can use mmap() to go 
beyond the dirty limit.

> 
> 
> -- 
> 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/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

--
David Duncan


___

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

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

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

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

Re: Supporting iPad Pro keyboard in iOS apps?

2015-12-09 Thread David Duncan

> On Dec 9, 2015, at 3:55 PM, Rick Mann  wrote:
> 
>> 
>> On Dec 9, 2015, at 15:50 , SevenBits > > wrote:
>> 
>> Is it a matter of building with an newer SDK?
> 
> I don't think so; we're building with the latest.

You are probably running scaled up. If you add a default nib or storyboard you 
should run at the native device size.

> 
>> 
>> On Wednesday, December 9, 2015, Rick Mann  wrote:
>> Our app, which seems to run just fine on iPad Pro, nevertheless presents an 
>> old-style keyboard when editing fields. The iPad Pro has a (graphical) 
>> keyboard with more keys than previous devices. But ours shows a blown-up 
>> version of the older keyboard.
>> 
>> No matter what search term I use, I can't find anything about this from a 
>> developer's perspective, just discussions about iPad Pro features.
>> 
>> I'm hoping it's something trivial we need to adjust in our app.
>> 
>> Thoughts? 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/sevenbitstech%40gmail.com
>> 
>> This email sent to sevenbitst...@gmail.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/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

--
David Duncan

___

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

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

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

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

Re: iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 16:24 , David Duncan  wrote:
> 
> 
>> On Dec 9, 2015, at 3:36 PM, Rick Mann  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
>>> 
>>> 
 On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
 
 One of the WWDC videos stressed that iOS apps are given no more than 600 
 MB of RAM. Our app is VERY RAM-intensive. 
>>> 
>>> Slightly off-topic, but I wonder if you could use mmap to give your app 
>>> more address space? Create a big empty file, mmap it as writeable, then use 
>>> a custom allocator to manage memory in the mapped space.
>>> 
>>> (This doesn’t actually give you more RAM; the mapped address space will 
>>> tend to get paged out to storage so it’ll definitely be slower than real 
>>> RAM, but it’s better than crashing!)
>> 
>> That's an interesting thought. We're also very compute intensive, so the 
>> speed hit might obviate the advantages. Worth considering, though.
> 
> The virtual limit is 2GB on most devices right now, so you can use mmap() to 
> go beyond the dirty limit.

Hi. Sorry, can you elaborate on that? Is the "virtual limit" the thing that 
used to be 600 MB? What's the dirty limit, and how does it compare with the 
virtual limit?

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

Re: iPad Pro apps given more memory?

2015-12-09 Thread David Duncan

> On Dec 9, 2015, at 4:35 PM, Rick Mann  wrote:
> 
>> 
>> On Dec 9, 2015, at 16:24 , David Duncan  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 3:36 PM, Rick Mann  wrote:
>>> 
>>> 
 On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
 
 
> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
> 
> One of the WWDC videos stressed that iOS apps are given no more than 600 
> MB of RAM. Our app is VERY RAM-intensive. 
 
 Slightly off-topic, but I wonder if you could use mmap to give your app 
 more address space? Create a big empty file, mmap it as writeable, then 
 use a custom allocator to manage memory in the mapped space.
 
 (This doesn’t actually give you more RAM; the mapped address space will 
 tend to get paged out to storage so it’ll definitely be slower than real 
 RAM, but it’s better than crashing!)
>>> 
>>> That's an interesting thought. We're also very compute intensive, so the 
>>> speed hit might obviate the advantages. Worth considering, though.
>> 
>> The virtual limit is 2GB on most devices right now, so you can use mmap() to 
>> go beyond the dirty limit.
> 
> Hi. Sorry, can you elaborate on that? Is the "virtual limit" the thing that 
> used to be 600 MB? What's the dirty limit, and how does it compare with the 
> virtual limit?

The virtual limit is how much virtual memory you can use. The dirty limit is 
how much dirty memory you can use. The dirty limit is the limit you had heard 
previously, I think 650MB on most devices.

> 
> Thanks,
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.com 
--
David Duncan

___

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

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

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

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

Re: Supporting iPad Pro keyboard in iOS apps?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 16:25 , David Duncan  wrote:
> 
> 
>> On Dec 9, 2015, at 3:55 PM, Rick Mann  wrote:
>> 
>>> 
>>> On Dec 9, 2015, at 15:50 , SevenBits >> > wrote:
>>> 
>>> Is it a matter of building with an newer SDK?
>> 
>> I don't think so; we're building with the latest.
> 
> You are probably running scaled up. If you add a default nib or storyboard 
> you should run at the native device size.

We had launch images, not a launch storyboard. Adding the storyboard fixed the 
issue, and identified a few places where we had other images that need new 
sizes. The keyboard shows up correctly now.

Thanks all!

> 
>> 
>>> 
>>> On Wednesday, December 9, 2015, Rick Mann  wrote:
>>> Our app, which seems to run just fine on iPad Pro, nevertheless presents an 
>>> old-style keyboard when editing fields. The iPad Pro has a (graphical) 
>>> keyboard with more keys than previous devices. But ours shows a blown-up 
>>> version of the older keyboard.
>>> 
>>> No matter what search term I use, I can't find anything about this from a 
>>> developer's perspective, just discussions about iPad Pro features.
>>> 
>>> I'm hoping it's something trivial we need to adjust in our app.
>>> 
>>> Thoughts? 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/sevenbitstech%40gmail.com
>>> 
>>> This email sent to sevenbitst...@gmail.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/david.duncan%40apple.com
>> 
>> This email sent to david.dun...@apple.com
> 
> --
> David Duncan
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/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: LSSharedFIleList API deprecated

2015-12-09 Thread Dragan Milić
On sre 09.12.2015., at 19.12, Greg Weston wrote:

>> I opened a radar a while back and got this answer:
>> 
>> "Shared file lists are no longer supported. There is no exact replacement 
>> API.”
>> “If you want to manage your recent documents list, you should use 
>> NSDocumentController."
>> “If you want to run a background tool independent of your main application, 
>> you should use a Launch Agent."
>> 
>> My application already uses NSDocumentController; however, there is no means 
>> to remove a recent item from the list and my application uses 
>> LSSharedFileListItemRemove. I updated the radar with the need to remove 
>> recent items. No word yet.
>> —kevin
> 
> While not optimal, I would imagine this could be accomplished with a 
> combination of recentDocumentURLs, clearRecentDocuments: and 
> noteNewRecentDocumentURL:.

Yeah, but I need to manage system-wide items, like favorites (found in Finder’s 
sidebar), recent document (on system level, not my application level), recent 
servers, etc. Finder still does that so I don’t really get the response that 
“shared file lists are no longer supported.” The existing API still works 
though, but being deprecated clearly shows in which direction things are 
moving. Is that yet another feature developers are stripped of so they couldn’t 
produce applications which mimic some of Apple’s applications features?

-- Dragan
___

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

Please do not post 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: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke

> On Dec 9, 2015, at 16:24 , David Duncan  > wrote:
> 
> The virtual limit is 2GB on most devices right now, so you can use mmap() to 
> go beyond the dirty limit.

Hm, I wasn’t aware that was limited. 2GB seems like a lot normally, but there 
are databases engines like LMDB that map the entire database file into memory 
(instead of using a buffer cache), so this puts a ceiling on how much data you 
can manage that way.

—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: iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 16:42 , David Duncan  wrote:
> 
> 
>> On Dec 9, 2015, at 4:35 PM, Rick Mann  wrote:
>> 
>>> 
>>> On Dec 9, 2015, at 16:24 , David Duncan  wrote:
>>> 
>>> 
 On Dec 9, 2015, at 3:36 PM, Rick Mann  wrote:
 
 
> On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
> 
> 
>> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
>> 
>> One of the WWDC videos stressed that iOS apps are given no more than 600 
>> MB of RAM. Our app is VERY RAM-intensive. 
> 
> Slightly off-topic, but I wonder if you could use mmap to give your app 
> more address space? Create a big empty file, mmap it as writeable, then 
> use a custom allocator to manage memory in the mapped space.
> 
> (This doesn’t actually give you more RAM; the mapped address space will 
> tend to get paged out to storage so it’ll definitely be slower than real 
> RAM, but it’s better than crashing!)
 
 That's an interesting thought. We're also very compute intensive, so the 
 speed hit might obviate the advantages. Worth considering, though.
>>> 
>>> The virtual limit is 2GB on most devices right now, so you can use mmap() 
>>> to go beyond the dirty limit.
>> 
>> Hi. Sorry, can you elaborate on that? Is the "virtual limit" the thing that 
>> used to be 600 MB? What's the dirty limit, and how does it compare with the 
>> virtual limit?
> 
> The virtual limit is how much virtual memory you can use. The dirty limit is 
> how much dirty memory you can use. The dirty limit is the limit you had heard 
> previously, I think 650MB on most devices.

Sorry, more questions, to be sure that I'm clear. If there's a discussion 
somewhere of this already, feel free to point me to that.

- Is there still a 650 MB dirty limit, even on iPad Pro (which has 4GB, more 
RAM than any previous device), or has that increased as well?
- By "virtual memory," I'm sure you don't mean it's swapping to disk (flash). 
Or do you? If not, how is it virtual?
- Is there any way to programmatically determine what these limits are, for 
diagnostic, debug, and development purposes? It would even be helpful to know 
that we're approaching a limit, it might allow us to do something in the moment 
to prevent being killed by iOS, even if it's at the expense of execution time 
(something we don't want to do on a normal basis).

We basically work with the point clouds and images generated by our 3D camera. 
Aligning point clouds gets more and more challenging when users have more and 
more individual scans, as we try each new scan against all the previous scans 
(there are some low-memory-requirement reject criteria we use, but it's 
impossible to ignore them all). We also have another data structure that grows 
with the number of scans conducted. During alignment, we do have these peaks of 
memory usage that we've worked hard to reduce, but it's getting more and more 
difficult to do so.

We'd like to be able to suggest to certain customers that an iPad Pro will be 
able to manage larger models.

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

Re: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke

> On Dec 9, 2015, at 5:17 PM, Rick Mann  wrote:
> 
> - By "virtual memory," I'm sure you don't mean it's swapping to disk (flash). 
> Or do you? If not, how is it virtual?

All memory is virtual in any modern OS — the only thing that sees ‘real’ memory 
addresses is the kernel’s VM subsystem. ‘Virtual’ just means there’s a layer of 
indirection between address space and RAM.

On iOS it’s just that the address space normally allocated to apps (by malloc, 
etc.) isn’t backed by a swap file. So it doesn’t get paged out, but it’s also 
limited by the amount of physical RAM.

By “how much virtual memory you can use” I believe Rick means how much _address 
space_.

—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: iPad Pro apps given more memory?

2015-12-09 Thread David Duncan

> On Dec 9, 2015, at 5:17 PM, Rick Mann  wrote:
> 
>> 
>> On Dec 9, 2015, at 16:42 , David Duncan  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 4:35 PM, Rick Mann  wrote:
>>> 
 
 On Dec 9, 2015, at 16:24 , David Duncan  wrote:
 
 
> On Dec 9, 2015, at 3:36 PM, Rick Mann  wrote:
> 
> 
>> On Dec 9, 2015, at 15:19 , Jens Alfke  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 2:56 PM, Rick Mann  wrote:
>>> 
>>> One of the WWDC videos stressed that iOS apps are given no more than 
>>> 600 MB of RAM. Our app is VERY RAM-intensive. 
>> 
>> Slightly off-topic, but I wonder if you could use mmap to give your app 
>> more address space? Create a big empty file, mmap it as writeable, then 
>> use a custom allocator to manage memory in the mapped space.
>> 
>> (This doesn’t actually give you more RAM; the mapped address space will 
>> tend to get paged out to storage so it’ll definitely be slower than real 
>> RAM, but it’s better than crashing!)
> 
> That's an interesting thought. We're also very compute intensive, so the 
> speed hit might obviate the advantages. Worth considering, though.
 
 The virtual limit is 2GB on most devices right now, so you can use mmap() 
 to go beyond the dirty limit.
>>> 
>>> Hi. Sorry, can you elaborate on that? Is the "virtual limit" the thing that 
>>> used to be 600 MB? What's the dirty limit, and how does it compare with the 
>>> virtual limit?
>> 
>> The virtual limit is how much virtual memory you can use. The dirty limit is 
>> how much dirty memory you can use. The dirty limit is the limit you had 
>> heard previously, I think 650MB on most devices.
> 
> Sorry, more questions, to be sure that I'm clear. If there's a discussion 
> somewhere of this already, feel free to point me to that.
> 
> - Is there still a 650 MB dirty limit, even on iPad Pro (which has 4GB, more 
> RAM than any previous device), or has that increased as well?

I think it has, but I don’t know what the size it has increased to is.

> - By "virtual memory," I'm sure you don't mean it's swapping to disk (flash). 
> Or do you? If not, how is it virtual?
> - Is there any way to programmatically determine what these limits are, for 
> diagnostic, debug, and development purposes? It would even be helpful to know 
> that we're approaching a limit, it might allow us to do something in the 
> moment to prevent being killed by iOS, even if it's at the expense of 
> execution time (something we don't want to do on a normal basis).

You can determine the virtual limit by trying to allocate memory. As long as 
you don’t write to the memory, its a virtual allocation. Once you start writing 
to it, the written to memory becomes dirty, and falls under your dirty memory 
limit. You can also use Instruments to monitor memory usage and watch when you 
hit jetsam limits (and inspect the resulting reports).

> 
> We basically work with the point clouds and images generated by our 3D 
> camera. Aligning point clouds gets more and more challenging when users have 
> more and more individual scans, as we try each new scan against all the 
> previous scans (there are some low-memory-requirement reject criteria we use, 
> but it's impossible to ignore them all). We also have another data structure 
> that grows with the number of scans conducted. During alignment, we do have 
> these peaks of memory usage that we've worked hard to reduce, but it's 
> getting more and more difficult to do so.
> 
> We'd like to be able to suggest to certain customers that an iPad Pro will be 
> able to manage larger models.
> 
> Thanks,
> 
> -- 
> Rick Mann
> rm...@latencyzero.com 
--
David Duncan

___

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

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

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

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

Re: iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann

> On Dec 9, 2015, at 17:37 , Jens Alfke  wrote:
> 
> 
>> On Dec 9, 2015, at 5:17 PM, Rick Mann  wrote:
>> 
>> - By "virtual memory," I'm sure you don't mean it's swapping to disk 
>> (flash). Or do you? If not, how is it virtual?
> 
> All memory is virtual in any modern OS — the only thing that sees ‘real’ 
> memory addresses is the kernel’s VM subsystem. ‘Virtual’ just means there’s a 
> layer of indirection between address space and RAM.
> 
> On iOS it’s just that the address space normally allocated to apps (by 
> malloc, etc.) isn’t backed by a swap file. So it doesn’t get paged out, but 
> it’s also limited by the amount of physical RAM.

Ah, yes, of course. Just the address translation is happening. Yeah, I need to 
know if the dirty limit has increased.

Alternatively, if mmap-ed memory would actually live in RAM, but get around the 
dirty limit (assuming for the sake of argument that the user isn't running 
other apps), then we really could get more memory without a speed penalty via 
mmap().

> 
> By “how much virtual memory you can use” I believe Rick means how much 
> _address space_.

No, I need to know how much I can actually allocate and dirty.


-- 
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: iPad Pro apps given more memory?

2015-12-09 Thread Britt Durbrow
Well, FWIW I happen to have an iPad Pro sitting next to me, so I just whipped 
up the following test and was able to allocate and write to almost 3GB of RAM 
before it started crashing on me.

#define allocationSize  (1024ULL*1024ULL*3050ULL)
#define stride  (4096)

- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

printf("Starting memory test...\n");

printf("Allocating memory...\n");

uint8_t *buffer=malloc(allocationSize);

printf("Writing to buffer...\n");

for(uint64_t cursor=0; cursor On Dec 9, 2015, at 5:56 PM, Rick Mann  wrote:
> 
> 
>> On Dec 9, 2015, at 17:37 , Jens Alfke  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 5:17 PM, Rick Mann  wrote:
>>> 
>>> - By "virtual memory," I'm sure you don't mean it's swapping to disk 
>>> (flash). Or do you? If not, how is it virtual?
>> 
>> All memory is virtual in any modern OS — the only thing that sees ‘real’ 
>> memory addresses is the kernel’s VM subsystem. ‘Virtual’ just means there’s 
>> a layer of indirection between address space and RAM.
>> 
>> On iOS it’s just that the address space normally allocated to apps (by 
>> malloc, etc.) isn’t backed by a swap file. So it doesn’t get paged out, but 
>> it’s also limited by the amount of physical RAM.
> 
> Ah, yes, of course. Just the address translation is happening. Yeah, I need 
> to know if the dirty limit has increased.
> 
> Alternatively, if mmap-ed memory would actually live in RAM, but get around 
> the dirty limit (assuming for the sake of argument that the user isn't 
> running other apps), then we really could get more memory without a speed 
> penalty via mmap().
> 
>> 
>> By “how much virtual memory you can use” I believe Rick means how much 
>> _address space_.
> 
> No, I need to know how much I can actually allocate and dirty.
> 
> 
> -- 
> 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/bdurbrow%40rattlesnakehillsoftworks.com
> 
> This email sent to bdurb...@rattlesnakehillsoftworks.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: iPad Pro apps given more memory?

2015-12-09 Thread Rick Mann
Wow. Thanks!

> On Dec 9, 2015, at 18:28 , Britt Durbrow 
>  wrote:
> 
> Well, FWIW I happen to have an iPad Pro sitting next to me, so I just whipped 
> up the following test and was able to allocate and write to almost 3GB of RAM 
> before it started crashing on me.
> 
> #define allocationSize(1024ULL*1024ULL*3050ULL)
> #define stride(4096)
> 
> - (BOOL)application:(UIApplication *)application 
> didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
> {
>   
>   printf("Starting memory test...\n");
>   
>   printf("Allocating memory...\n");
>   
>   uint8_t *buffer=malloc(allocationSize);
>   
>   printf("Writing to buffer...\n");
>   
>   for(uint64_t cursor=0; cursor   buffer[cursor]=0xAC;
> 
>   printf("Done!\n");
> 
> 
>   return YES;
> }
> 
> 
> 
>> On Dec 9, 2015, at 5:56 PM, Rick Mann  wrote:
>> 
>> 
>>> On Dec 9, 2015, at 17:37 , Jens Alfke  wrote:
>>> 
>>> 
 On Dec 9, 2015, at 5:17 PM, Rick Mann  wrote:
 
 - By "virtual memory," I'm sure you don't mean it's swapping to disk 
 (flash). Or do you? If not, how is it virtual?
>>> 
>>> All memory is virtual in any modern OS — the only thing that sees ‘real’ 
>>> memory addresses is the kernel’s VM subsystem. ‘Virtual’ just means there’s 
>>> a layer of indirection between address space and RAM.
>>> 
>>> On iOS it’s just that the address space normally allocated to apps (by 
>>> malloc, etc.) isn’t backed by a swap file. So it doesn’t get paged out, but 
>>> it’s also limited by the amount of physical RAM.
>> 
>> Ah, yes, of course. Just the address translation is happening. Yeah, I need 
>> to know if the dirty limit has increased.
>> 
>> Alternatively, if mmap-ed memory would actually live in RAM, but get around 
>> the dirty limit (assuming for the sake of argument that the user isn't 
>> running other apps), then we really could get more memory without a speed 
>> penalty via mmap().
>> 
>>> 
>>> By “how much virtual memory you can use” I believe Rick means how much 
>>> _address space_.
>> 
>> No, I need to know how much I can actually allocate and dirty.
>> 
>> 
>> -- 
>> 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/bdurbrow%40rattlesnakehillsoftworks.com
>> 
>> This email sent to bdurb...@rattlesnakehillsoftworks.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: Mac OSX 10.11 and XCode

2015-12-09 Thread Richard Charles

> On Oct 1, 2015, at 5:58 PM, Richard Charles  wrote:
> 
> Yes this was a window server crash. Filed bug report 22943597 with crash log.

On my multiple display development machine, window server crashing seems to 
have completely disappeared with the OS X 10.11.2 update. Stable as a rock so 
far.

Mac Pro (Early 2009)

DELL 2405FPW Display
ATI Radeon HD 5770 1024 MB graphics

DELL 2005FPW Display
NVIDIA GeForce GT 120 512 MB graphics

--Richard 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

2015-12-09 Thread Conrad Shultz

> On Dec 6, 2015, at 2:56 PM, Graham Cox  wrote:
> 
> 
>> On 7 Dec 2015, at 2:45 AM, Dave  wrote:
>> 
>> On the Mac what is the best control to use to do this?
> 
> 
> Just override -mouseDown: in the view and call [NSApp 
> sendAction:toTarget:from:]
> 

I’d recommend looking at NSClickGestureRecognizer. You can set its 
target/action directly just like a button and it should be significantly easier 
than working out click timings, etc.

-Conrad
___

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

Please do not post 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