Re: REST, SOAP, XML-RPC, ...?

2012-11-05 Thread Andreas Grosam

On 05.11.2012, at 01:12, Todd Heberlein wrote:

> Is there currently a standard, Apple-recommended way of doing interoperable 
> client-server architectures?
That's not something Apple should recommend. However, new Apple technologies 
use a RESTful web service with JSON (e.g. Passcode).


> 
> I accidentally backed into a solution that is Apache, PHP, and libcurl, and I 
> figured I should go with one of the many standards out there. REST is pretty 
> close to what I am already doing, and looks nice, clean, and simple.
RESTful (or better RESTlike) with JSON as transport format is most appropriate 
for many web services, and there is great support for libraries on Mac OS X and 
also iOS.

> 
> But are there some nice client-side APIs that Apple recommends I use that 
> will make it easier to build Mac and iOS applications that use some 
> particular web service protocol?  And if so, are these some server-side APIs 
> (???) that I can use on the web server side?

There are a lot of frameworks, and there are probably many opinions of what is 
the "best" one. 

My personal preference is using Rails for the web service, especially for the 
test environment. A Rails app is just too easy to setup locally for testing 
purposes. Currently, while developing my own network library or any specific 
REST API on the client side, I setup a Rails server application and start it 
within Xcode using scripts, which also loads test fixtures into the database. 
So, for example when I modify or create a certain POST request utilizing 
NSURLConnection, I can test whether it actually works as expected with the web 
service API.  curl and tcpdump are useful tools to dig deeper if something does 
not work as expected.

For implementing a REST API on the client side, I use my own frameworks (for a 
reason). But there are others: AFNetworking or RESTKit, or ActiveResource (on 
GitHub) which I discovered recently. It essentially implements the Rails 
concept "ActiveResource" and utilizes CoreData with an IncrementalStore mapping 
to the Web service.

IMHO, there is no "REST framework" at all, since REST requires you to apply 
certain constraints, which must by integrated into your specific API. That is, 
you may want or have to implement application specific code for that certain 
API anyway. This cannot be accomplished through a "REST framework" -- it shall 
be merely a HTTP or Network framework, exposing the appropriate classes and 
methods to implement a RESTful API. 

For JSON, I use NSJSONSerialization - or if required I use my own 
implementation which has more features and is faster.


Regards
Andreas

> 
> Thanks,
> 
> Todd


___

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 kiosk mode?

2012-11-05 Thread Sixten Otto
On Sun, Nov 4, 2012 at 12:25 AM, Rick Mann  wrote:
> Ah, interesting! Still doesn't go quite as far as I want Apple to go: I want 
> a power-cycled device to skip Springboard and launch my app. I want the 
> watchdog to kill and restart my app.
>

Check out the Lock to App feature available with iOS 6 through the
Apple Configurator app. Sounds to me like exactly what you're after.
https://itunes.apple.com/us/app/apple-configurator/id434433123?mt=12
___

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: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Jerry Krinock
Continuing.  In here…

http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h

I find a maze of #define compiler directives which affect 
OS_OBJECT_USE_OBJC_RETAIN_RELEASE, and also there is a comment which implies 
that maybe I should add compiler flag -DOS_OBJECT_USE_OBJC=0 to the file which 
invokes xpc_release().  Indeed, doing so fixes the error.

But I don't fully understand what the effect is.  Also, my little project does 
not have that flag, neither as an option in the relevant source file, nor 
anywhere in Build Settings.  It builds fine without it.

Any clues to the intended usage of this OS_OBJECT_USE_OBJC_RETAIN_RELEASE and 
OS_OBJECT_USE_OBJC would be appreciated.

Thanks again,

Jerry


___

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

Sorting NSTableView using Bindings

2012-11-05 Thread Paul Johnson
I have an NSTableView in a drawer. I'm using Core Data and I'm trying
to have the drawer opening and showing the table rows sorted by the
first column.. but have been unsuccessful.

I can sort the table by clicking on column headers, but when the
drawer is opened the data is unsorted.

Obviously I don't have the bindings set properly but I've tied many
things all to no avail.

I've selected the Table View and clicked on tab to select the Bindings
inspector. Under the Table Content heading I found Sort Descriptors,
and it is there that I'm focusing. (For example, I've checked the
"Bind to" box and selected the Array Controller responsible for
managing the table data. Then for Controller Key I have
"arrangedObjects" and for "Model Key Path" I have the key associated
with the first column. This isn't doing what I want; I get a
"doesNotRecognizeSelector" exception thrown.)

Can someone give me some advice?
___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Jerry Krinock
First of all, thanks, "in advance", *literally*, to Greg Parker for answering 
my question, and my apologies for the additional post.

I say *literally* because although I still don't have his reply in my email, I 
see it on cocoabuilder.com.

Lately I've been seeing other people respond to messages on these boards, 
apparently out of order.  I have seen messages appear on cocaobuilder.com 
*hours* before they appear in my email.  I may also have seen it happen vice 
versa once.

I think maybe we need to check cocoabuilder.com before replying to any message.

P.S.  If Apple would shut down this board so everyone would use the new dev 
forums instead, that would be fine with me!  There are advantages and 
disadvantages to that format, and it wouldn't be the first time that Apple 
forced the world to change :))  I continue here because there still seems to be 
more eyeballs.
___

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: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Quincey Morris
On Nov 3, 2012, at 12:55 , Jerry Krinock  wrote:

> I want to absorb it into a big old project that contains a couple dozen 
> targets.  So I added a target for it, with ARC.  But building the big project 
> fails because the macro OS_OBJECT_USE_OBJC_RETAIN_RELEASE is defined, and in 
> xpc.h this redefines xpcrelease, which is also apparently a macro, to be a 
> function which invokes -release, which is not allowed under ARC.

What does "building the big project fails" mean? Are you saying it fails to 
build the target you added, or that the older targets no longer build?

> All of the other targets in the big project do not use ARC.  Both targets are 
> built with the "Latest" (10.8) SDK.

So it sounds like one of two things happened. Either a build setting got 
changed at the project level that was then inherited into all the old target 
build settings and messed up those builds, or the new target is inheriting a 
build setting (or the absence of a setting) from the project that it needs to 
be set differently.

Frankly, if you're not using ARC in the project generally (and don't want to 
convert the whole project to ARC for practical reasons), you're probably better 
off just adding manual retain/release code (including xpc_release) back into 
the tool code. Having subtly different setting distributed around the targets 
seems like a future maintenance headache. Well, it's already a *current* 
maintenance headache, really, or you wouldn't be asking about it. :)

Alternatively, package the tool code as a static library or framework, so that 
it can continue to live in its own project with its own settings.

On Nov 5, 2012, at 09:56 , Jerry Krinock  wrote:

> But I don't fully understand what the effect is.  Also, my little project 
> does not have that flag, neither as an option in the relevant source file, 
> nor anywhere in Build Settings.  It builds fine without it.


Yes, but the little project does have ARC.


___

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: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Jean-Daniel Dupas

Le 5 nov. 2012 à 18:56, Jerry Krinock  a écrit :

> Continuing.  In here…
> 
> http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h
> 
> I find a maze of #define compiler directives which affect 
> OS_OBJECT_USE_OBJC_RETAIN_RELEASE, and also there is a comment which implies 
> that maybe I should add compiler flag -DOS_OBJECT_USE_OBJC=0 to the file 
> which invokes xpc_release().  Indeed, doing so fixes the error.
> 
> But I don't fully understand what the effect is.  Also, my little project 
> does not have that flag, neither as an option in the relevant source file, 
> nor anywhere in Build Settings.  It builds fine without it.
> 
> Any clues to the intended usage of this OS_OBJECT_USE_OBJC_RETAIN_RELEASE and 
> OS_OBJECT_USE_OBJC would be appreciated.
> 

From the Xcode 4.4 release notes:

GCD and XPC objects support Automated Reference Counting (ARC) in Objective-C. 
Using GCD and XPC with ARC requires a minimum deployment target of OS X10.8 and 
is disabled when building with Garbage Collection or for 32-bit Intel. It can 
be manually disabled by adding OS_OBJECT_USE_OBJC=0 to the "PreprocessorMacros" 
build setting in Xcode.

> Thanks again,
> 
> Jerry
> 
> 
> ___
> 
> 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/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org

-- Jean-Daniel





___

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: Sorting NSTableView using Bindings

2012-11-05 Thread Quincey Morris
On Nov 5, 2012, at 10:03 , Paul Johnson  wrote:

> I've selected the Table View and clicked on tab to select the Bindings
> inspector. Under the Table Content heading I found Sort Descriptors,
> and it is there that I'm focusing. (For example, I've checked the
> "Bind to" box and selected the Array Controller responsible for
> managing the table data. Then for Controller Key I have
> "arrangedObjects" and for "Model Key Path" I have the key associated
> with the first column. This isn't doing what I want; I get a
> "doesNotRecognizeSelector" exception thrown.)

It's more usual to configure the sorting in the array controller. Leave the 
table view Sort Descriptors binding unbound. (If it's unbound, the table view 
will automatically bind itself to the array controller's sortDescriptors 
property.)

You're getting an exception because the Sort Descriptors binding needs to get 
an array of NSSortDescriptor objects. What you're actually binding it to is the 
value of the first column.

> I can sort the table by clicking on column headers, but when the
> drawer is opened the data is unsorted.

Yes, because clicking on column headers causes the table view to *create* the 
array of sort descriptors.

What you need to do is create a property in your data model that holds the sort 
descriptors. Bind the array controller's Sort Descriptors binding to this 
property. That causes the array controller's arrangedObjects to be ordered 
according to the sort order in the data model property, and the table view gets 
this order (via arrangedObjects) without additional work.

If the column header is clicked, the table view updates its own sortDescriptors 
property, which (via its automatically configured binding) updates the array 
controller's sortDescriptors property, which (via its manually configured 
binding) updates the data model property. 

Chances are you'll also want the data model property to updates user defaults 
when set, and initially load its value from user defaults on startup.


___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread John Tsombakos
On Mon, Nov 5, 2012 at 1:16 PM, Jerry Krinock  wrote:

> Lately I've been seeing other people respond to messages on these boards,
> apparently out of order.  I have seen messages appear on 
> cocaobuilder.com*hours* before they appear in my email.  I may also have seen 
> it happen
> vice versa once.
>
> I think maybe we need to check cocoabuilder.com before replying to any
> message.
>
> P.S.  If Apple would shut down this board so everyone would use the new
> dev forums instead, that would be fine with me!  There are advantages and
> disadvantages to that format, and it wouldn't be the first time that Apple
> forced the world to change :))  I continue here because there still seems
> to be more eyeballs.
>

As long as the "new dev forums" are available to us who don't have a paid
Apple Developer account (yet!) And looking at cocoabuilder.com right now,
I'm only seeing one topic listed for today - it seems quite behind the
email on this list to me.
___

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


a way to clear inactive RAM

2012-11-05 Thread Nick Rogers
Hi,

I am assigned this small utility which should clear inactive RAM.
I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
purpose.
But I have to make this.

Prior to Mountain Lion I was allocating memory in my app that was roughly 
equivalent to free + inactive RAM.
And it used to work perfectly, i.e. most inactive RAM used to become free.

But in Mountain Lion, aggressive allocations are not affecting RAM at all.

I want this util to also work on systems that don't have Xcode installed.

I saw the post where someone posted notes of purge disassembly. But that isn't 
leading anywhere. Also purge comes with Xcode only.

There are apps on Mac App Store that do this kind of thing.

How to go about it? Any pointers would be really appreciated.

Wishes,
Nick

___

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


Harnessing Perl Scripts within a Project

2012-11-05 Thread John Delacour


I am a rank beginner in Xcode and Objective-C, very slowly getting to 
grips with things using Xcode 4.5.1 in 10.8.  My only significant 
experience is with AppleScript and Perl and, so far as AppleScript is 
concerned, it looks to me as though I’d be wiser to set it aside and 
work in straight C and ObjC.


Perl is another matter altogether.  While I am getting up to speed with 
Obj-C I would like to be able to include Perl routines within projects, 
and I can find very little on the WWW to be guided by.  So far I have 
experimented simply with


  system ("hard-coded/path/to/file")

I have not yet even attempted anything with NSTask and found no way to 
add Perl scripts to the project file tree and refer to them by relative 
path, so you can see I am not very far forward!


Any hints would be much appreciated.  I shall doubtless have many more 
questions of a more mainstream nature.


JD



___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Greg Parker
On Nov 5, 2012, at 10:16 AM, Jerry Krinock  wrote:
> First of all, thanks, "in advance", *literally*, to Greg Parker for answering 
> my question, and my apologies for the additional post.
> 
> I say *literally* because although I still don't have his reply in my email, 
> I see it on cocoabuilder.com.
> 
> Lately I've been seeing other people respond to messages on these boards, 
> apparently out of order.  I have seen messages appear on cocaobuilder.com 
> *hours* before they appear in my email.  I may also have seen it happen vice 
> versa once.

If and when you get your copy of my message, you might want to check the full 
headers. The timestamps there might point out the slow mail server.


-- 
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: MKMapView compositing

2012-11-05 Thread Vincent Habchi
Hi Eve,

> Use overlays.  Look into ClassicMap: 
> https://github.com/kishikawakatsumi/ClassicMap which is doing about the same 
> thing using likely illegally obtained Google tiles.

I’ll have a look. It is actually displaying maps *over* a cartographic 
background (and not some cartographic layer over the maps), isn’t it?

Cheers and thanks!
Vincent
___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Sean McBride
On Mon, 5 Nov 2012 10:16:13 -0800, Jerry Krinock said:

>Lately I've been seeing other people respond to messages on these
>boards, apparently out of order.

Likewise, on and off for months now.

>P.S.  If Apple would shut down this board so everyone would use the new
>dev forums instead, that would be fine with me!

Ugh.  That's would be so horrible.  But I fear it will come to pass. :(

Cheers,

-- 

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



___

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

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

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

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

Fwd: Extremely low fps during transparent NSWindow resize

2012-11-05 Thread Andrea3000
> There is (or was) a QuartzDebug option to show which parts of a window are 
> actually transparent; on the standard windows only the corners are 
> transparent, so for most of the window area the system can use the faster 
> opaque calculations. I never filed a bug requesting a way for non-Apple code 
> to do that because I didn't think it would be that generally useful - we make 
> "transparent" windows to reproduce the odd shapes that Windows (the OS) 
> provides for our virtual machines.

Unfortunately, I don't find any option in QuartzDebug to show which part of a 
window is transparent.
Do you know if it is possible to play with -displayInRectIgnoringOpacity: and 
friends to achive what Apple does on standard windows?


___

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: a way to clear inactive RAM

2012-11-05 Thread Jens Alfke

On Nov 5, 2012, at 10:54 AM, Nick Rogers  wrote:

> I am assigned this small utility which should clear inactive RAM.
> I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
> purpose.
> But I have to make this.

What on earth does “clear inactive RAM” mean? No offense, but whoever assigned 
you that task doesn’t seem to have any idea of how a modern virtual memory 
system works. What do they want this utility to accomplish?

Regardless, this isn’t the right list for such a question. There aren’t 
Cocoa/Obj-C APIs for anything that low level, so if you want to mess with 
paging and swap files and virtual memory, you’ll need to use POSIX or Mach 
functions. Try the “darwin-userlevel” list.

—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: a way to clear inactive RAM

2012-11-05 Thread Wim Lewis

On 5 Nov 2012, at 10:54 AM, Nick Rogers wrote:
> I am assigned this small utility which should clear inactive RAM.
> I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
> purpose.
> But I have to make this.


What are you trying to achieve? What exactly do you mean by "inactive"? There 
may be a higher-level way to reach the same goal.



___

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: MKMapView compositing

2012-11-05 Thread Evadne Wu
When you have alpha transparency you can either blend the aerial tiles into the 
map view or blend the entire map view into the aerial tiles.  Either way, I 
think, you can get something that looks good.  Semitransparent overlays 
consisted of aerial tiles might actually work, and it is in the same direction 
as my original recommendation.

Best luck in your project!

On Nov 5, 2012, at 2:39 PM, Vincent Habchi  wrote:

> Hi Eve,
> 
>> Use overlays.  Look into ClassicMap: 
>> https://github.com/kishikawakatsumi/ClassicMap which is doing about the same 
>> thing using likely illegally obtained Google tiles.
> 
> I’ll have a look. It is actually displaying maps *over* a cartographic 
> background (and not some cartographic layer over the maps), isn’t it?
> 
> Cheers and thanks!
> Vincent


___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Alex Kac
The problem with the Apple Forums is that you get people who are on a power 
trip there more often than you have here. The really nice part of the Apple 
Forums is sometimes you actually get engineers who answer questions there. 

I also sense that this list is far more technically minded whereas the Apple 
Forums tend to have a lot more people asking inane questions that crowd out the 
more advanced technical ones here. 

Years before iOS's SDK was released which finally let me develop for Apple's 
platform again (prior to that was OS 7/8 back in the ninetees), I spent a year 
lurking on this list which actually taught me a lot about Objective-C that I 
never saw discussed in any book, class, or other reading material. 

Personally I'd prefer this list to continue to exist alongside Apple's Dev 
Forums. 

On Nov 5, 2012, at 12:55 PM, John Tsombakos  wrote:

> On Mon, Nov 5, 2012 at 1:16 PM, Jerry Krinock  wrote:
> 
>> Lately I've been seeing other people respond to messages on these boards,
>> apparently out of order.  I have seen messages appear on 
>> cocaobuilder.com*hours* before they appear in my email.  I may also have 
>> seen it happen
>> vice versa once.
>> 
>> I think maybe we need to check cocoabuilder.com before replying to any
>> message.
>> 
>> P.S.  If Apple would shut down this board so everyone would use the new
>> dev forums instead, that would be fine with me!  There are advantages and
>> disadvantages to that format, and it wouldn't be the first time that Apple
>> forced the world to change :))  I continue here because there still seems
>> to be more eyeballs.
>> 
> 
> As long as the "new dev forums" are available to us who don't have a paid
> Apple Developer account (yet!) And looking at cocoabuilder.com right now,
> I'm only seeing one topic listed for today - it seems quite behind the
> email on this list to me.

___

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: Extremely low fps during transparent NSWindow resize

2012-11-05 Thread Andrea3000
> There is (or was) a QuartzDebug option to show which parts of a window are 
> actually transparent; on the standard windows only the corners are 
> transparent, so for most of the window area the system can use the faster 
> opaque calculations. I never filed a bug requesting a way for non-Apple code 
> to do that because I didn't think it would be that generally useful - we make 
> "transparent" windows to reproduce the odd shapes that Windows (the OS) 
> provides for our virtual machines.

Unfortunately, I don't find any option in QuartzDebug to show which part of a 
window is transparent.
Do you know if it is possible to play with -displayInRectIgnoringOpacity: and 
friends to achive what Apple does on standard windows?


___

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: MKMapView compositing

2012-11-05 Thread Vincent Habchi
Eve,

> When you have alpha transparency you can either blend the aerial tiles into 
> the map view or blend the entire map view into the aerial tiles.  Either way, 
> I think, you can get something that looks good.  Semitransparent overlays 
> consisted of aerial tiles might actually work, and it is in the same 
> direction as my original recommendation.

Ok, I’ll definitely try.

> Best luck in your project!

Thanks. I’ll keep you posted if you want. Since this is basically an example 
for pedagogic purposes, I’ll publish anyhow the final code. So, if you’re 
interested… ;)

Have a great day/afternoon/evening/night, depending where you are on the planet
Vincent
___

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: Harnessing Perl Scripts within a Project

2012-11-05 Thread Wim Lewis

On 4 Nov 2012, at 1:03 AM, John Delacour wrote:
> Perl is another matter altogether.  While I am getting up to speed with Obj-C 
> I would like to be able to include Perl routines within projects, and I can 
> find very little on the WWW to be guided by.  So far I have experimented 
> simply with
> 
>  system ("hard-coded/path/to/file")

This works, but it blocks the entire app while the script runs, and is 
suboptimal in some other ways. It's fine for quick&dirty use but I'd recommend 
using something like NSTask for a program you're going to ship to other people.

> I have not yet even attempted anything with NSTask and found no way to add 
> Perl scripts to the project file tree and refer to them by relative path, so 
> you can see I am not very far forward!

Perl scripts would just be ordinary resources as far as Xcode is concerned; 
you'd add them to the "copy bundle resources" build phase. Xcode will copy them 
into your .app when you build. You can then find the path to a given bundle 
resource at run time using NSBundle methods like -pathForResource:ofType:. (The 
application itself is a bundle, which can be gotten using [NSBundle 
mainBundle]; frameworks, plugins, and the like are also bundles.) The path is 
an NSString; if you're giving it to NSTask, you can pass it as-is. If you want 
to give the path to a POSIX API (like system() or exec()), you can convert it 
to an appropriate C-style string using the -fileSystemRepresentation method.  
(In practice the file system representation is just UTF-8, but it's probably 
best to use -fileSystemRepresentation instead of hardcoding that bit of 
knowledge.)

Hopefully this helps you connect the dots--- all the methods I've mentioned 
should have more detailed info in the documentation.


It's also possible to link libperl.dylib directly into your app and use it as 
an embedded interpreter. I haven't tried this, though, so I don't know what 
problems you might hit.



___

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: Harnessing Perl Scripts within a Project

2012-11-05 Thread Fritz Anderson
On 4 Nov 2012, at 3:03 AM, John Delacour  wrote:

> I am a rank beginner in Xcode and Objective-C, very slowly getting to grips 
> with things using Xcode 4.5.1 in 10.8.  My only significant experience is 
> with AppleScript and Perl and, so far as AppleScript is concerned, it looks 
> to me as though I’d be wiser to set it aside and work in straight C and ObjC.
> 
> Perl is another matter altogether.  While I am getting up to speed with Obj-C 
> I would like to be able to include Perl routines within projects, and I can 
> find very little on the WWW to be guided by.  

So long as you understand that this isn't usually a productive thing to do. It 
may be a good idea as a stopgap to fill in parts you don't know how to do with 
Cocoa/Objective-C yet, but it's not a direction you'll want to stay on. (There 
was a project, CamelBones, that allowed you to do Cocoa programming mostly in 
Perl, but I'm sorry to learn its sponsor, Sherm Pendley, died last year, and no 
one else is maintaining it.)

> So far I have experimented simply with
> 
>  system ("hard-coded/path/to/file")
> 
> I have not yet even attempted anything with NSTask and found no way to add 
> Perl scripts to the project file tree and refer to them by relative path, so 
> you can see I am not very far forward!

Time to learn NSTask, and NSBundle ([[NSBundle mainBundle] pathForResource: 
@"myscript" ofType: @"pl"]).

In Xcode, use File > Add Files to "[project]"… (opt-cmd-A) to select your Perl 
files and add them to your project. Xcode will automatically copy them into the 
target bundle where the NSBundle methods can find them.

> Any hints would be much appreciated.  I shall doubtless have many more 
> questions of a more mainstream nature.

— F

-- 
Fritz Anderson -- Xcode 4 Unleashed: 4.5 supplement in editing -- 



___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Laurent Daudelin
Same here. Been on this list for a very long time and hope it will continue. 
Just don't have the time to regularly hop in the browser, go through multiple 
logins to finally get to *one* of the forum and check what is new.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Nov 5, 2012, at 11:52, Alex Kac  wrote:

> The problem with the Apple Forums is that you get people who are on a power 
> trip there more often than you have here. The really nice part of the Apple 
> Forums is sometimes you actually get engineers who answer questions there. 
> 
> I also sense that this list is far more technically minded whereas the Apple 
> Forums tend to have a lot more people asking inane questions that crowd out 
> the more advanced technical ones here. 
> 
> Years before iOS's SDK was released which finally let me develop for Apple's 
> platform again (prior to that was OS 7/8 back in the ninetees), I spent a 
> year lurking on this list which actually taught me a lot about Objective-C 
> that I never saw discussed in any book, class, or other reading material. 
> 
> Personally I'd prefer this list to continue to exist alongside Apple's Dev 
> Forums. 
> 
> On Nov 5, 2012, at 12:55 PM, John Tsombakos  wrote:
> 
>> On Mon, Nov 5, 2012 at 1:16 PM, Jerry Krinock  wrote:
>> 
>>> Lately I've been seeing other people respond to messages on these boards,
>>> apparently out of order.  I have seen messages appear on 
>>> cocaobuilder.com*hours* before they appear in my email.  I may also have 
>>> seen it happen
>>> vice versa once.
>>> 
>>> I think maybe we need to check cocoabuilder.com before replying to any
>>> message.
>>> 
>>> P.S.  If Apple would shut down this board so everyone would use the new
>>> dev forums instead, that would be fine with me!  There are advantages and
>>> disadvantages to that format, and it wouldn't be the first time that Apple
>>> forced the world to change :))  I continue here because there still seems
>>> to be more eyeballs.
>>> 
>> 
>> As long as the "new dev forums" are available to us who don't have a paid
>> Apple Developer account (yet!) And looking at cocoabuilder.com right now,
>> I'm only seeing one topic listed for today - it seems quite behind the
>> email on this list to me.
> 
> ___
> 
> 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/laurent%40nemesys-soft.com
> 
> This email sent to laur...@nemesys-soft.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: a way to clear inactive RAM

2012-11-05 Thread Alex Zavatone
Not sure what RAM "clearing" means but if you want to purge the disk cache, 
check out man purge in the terminal.

On Nov 5, 2012, at 1:54 PM, Nick Rogers wrote:

> Hi,
> 
> I am assigned this small utility which should clear inactive RAM.
> I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
> purpose.
> But I have to make this.
> 
> Prior to Mountain Lion I was allocating memory in my app that was roughly 
> equivalent to free + inactive RAM.
> And it used to work perfectly, i.e. most inactive RAM used to become free.
> 
> But in Mountain Lion, aggressive allocations are not affecting RAM at all.
> 
> I want this util to also work on systems that don't have Xcode installed.
> 
> I saw the post where someone posted notes of purge disassembly. But that 
> isn't leading anywhere. Also purge comes with Xcode only.
> 
> There are apps on Mac App Store that do this kind of thing.
> 
> How to go about it? Any pointers would be really appreciated.
> 
> Wishes,
> Nick
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com

___

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

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

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

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


Re: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Fritz Anderson
Also: I recently went on a marathon watching Troll 2, Birdemic, Manos: The 
Hands of Fate, and Plan 9 from Outer Space. It reminded me of the search 
facility in the Apple Developer Forums. Jaw-dropping. Comically unqualified to 
be what it claims it is. The search context is discarded when you refine your 
search. The incremental search flashes likely matches out of sight, and there 
is no way to recover for long enough to select them. The search engine knows so 
little about the API that (to paraphrase my book) it suggests you meant some 
term from veterinary medicine. And on and on.

That's quite aside from the fact that people ought to be able to get help on 
Mac and iOS programming without paying a hundred bucks. I work at a university 
where students have at least as many Macs as Windows machines; there are a lot 
of students who want to learn, and have the pricey machines they'd need. $99 
out of pocket is out of the question for them. It's a significant issue with 
faculty, too.

And now I'll bow out of the mailing-list-versus-web-forum religious war.

— F

-- 
Fritz Anderson -- Xcode 4 Unleashed: 4.5 supplement in the works -- 



On 5 Nov 2012, at 1:52 PM, Alex Kac  wrote:

> The problem with the Apple Forums is that you get people who are on a power 
> trip there more often than you have here. The really nice part of the Apple 
> Forums is sometimes you actually get engineers who answer questions there. 
> 
> I also sense that this list is far more technically minded whereas the Apple 
> Forums tend to have a lot more people asking inane questions that crowd out 
> the more advanced technical ones here. 
> 
> Years before iOS's SDK was released which finally let me develop for Apple's 
> platform again (prior to that was OS 7/8 back in the ninetees), I spent a 
> year lurking on this list which actually taught me a lot about Objective-C 
> that I never saw discussed in any book, class, or other reading material. 
> 
> Personally I'd prefer this list to continue to exist alongside Apple's Dev 
> Forums. 



___

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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Greg Parker
On Nov 5, 2012, at 12:55 PM, Laurent Daudelin  wrote:
> Same here. Been on this list for a very long time and hope it will continue. 
> Just don't have the time to regularly hop in the browser, go through multiple 
> logins to finally get to *one* of the forum and check what is new.

The devforums have an "Email Updates" feature for each sub-forum. If you enable 
that for the topics you're interested in then you can read as if it were a 
mailing list. You'll only need to visit the web site when you want to post.


-- 
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: Extremely low fps during transparent NSWindow resize

2012-11-05 Thread Andrea3000
>>> There is (or was) a QuartzDebug option to show which parts of a window are 
>>> actually transparent; on the standard windows only the corners are 
>>> transparent, so for most of the window area the system can use the faster 
>>> opaque calculations. I never filed a bug requesting a way for non-Apple 
>>> code to do that because I didn't think it would be that generally useful - 
>>> we make "transparent" windows to reproduce the odd shapes that Windows (the 
>>> OS) provides for our virtual machines.
>> 
>> Unfortunately, I don't find any option in QuartzDebug to show which part of 
>> a window is transparent.
>> 
> It was enabled with a hidden QuartzDebug default - QDEnableAppleInternal - 
> but it doesn't seem to work on QD 4.2.
> 
>> Do you know if it is possible to play with -displayInRectIgnoringOpacity: 
>> and friends to achive what Apple does on standard windows?
> 
> 
> I've never tried it - I'm not actually the person who deals with the custom 
> window drawing - but I don't think that method has anything to do with how 
> the drawing code deals with windows under the window you're drawing, which is 
> where the window transparency causes a slowdown.
> 
> From what I gathered from my coworker, the opaque windows with transparent 
> regions are implemented using much lower level code than Cocoa can reach.

Since I still have a Snow Leopard partition I have access to QuartDebug 4.1 and 
the hidden setting you suggested works as expected.
The strange thing is that while regular windows like Safari, Mail, ecc, are all 
opaque except for the corners (as pointed out in the previous mail), Quick Time 
Player X window is fully transparent!

So the question is still open. How can Quick Time Player X be so fast during 
resize if it is an all transparent window?

Regards
Andrea
___

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: Harnessing Perl Scripts within a Project

2012-11-05 Thread John Delacour

On 05/11/2012 20:44, Fritz Anderson wrote:


On 4 Nov 2012, at 3:03 AM, John Delacour  wrote:
  

... While I am getting up to speed with Obj-C I would like to be able to 
include Perl routines within projects...

So long as you understand that this isn't usually a productive thing to do. It 
may be a good idea as a stopgap to fill in parts you don't know how to do with 
Cocoa/Objective-C yet, but it's not a direction you'll want to stay on. (There 
was a project, CamelBones...


Thank you both Fritz and Wim for your very helpful replies.  I’m sure 
I’ll be able to sort things out now.


I am interested in your comment that “this isn't usually a productive 
thing to do”, because I very soon have to decide whether to devote all 
my time to getting to grips with ObjC or continue dreaming that I can do 
most of the work in Perl.  Coming to the verbosity and clumsiness of 
ObjC after the simplicity, power and conciseness of Perl is, for me, a 
horrible shock.  ObjC makes even AppleScript look succinct! and, 
watching the 2011 WWDC video that introduces the new @literals, and 
hearing all the whoops and applause as the most elementary new things 
were unveiled and it was announced that a dictionary object could now 
finally be built in something approaching the sane way it would be done 
in ancient languages like Perl, I sat with my mouth hanging open in 
disbelief. What planet do these people live on?, I thought.


From what I’ve seen so far, it looks as if I shall need to write twenty 
or thirty times as much ugly code in ObjC as I would need to write to 
build the same application in Perl.  Nevertheless I accept that that is 
only one aspect of productivity and would like to hear what the downside is.


JD


___

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: Extremely low fps during transparent NSWindow resize

2012-11-05 Thread Kyle Sluder
On Mon, Nov 5, 2012, at 02:20 PM, Andrea3000 wrote:
> Since I still have a Snow Leopard partition I have access to QuartDebug
> 4.1 and the hidden setting you suggested works as expected.
> The strange thing is that while regular windows like Safari, Mail, ecc,
> are all opaque except for the corners (as pointed out in the previous
> mail), Quick Time Player X window is fully transparent!
> 
> So the question is still open. How can Quick Time Player X be so fast
> during resize if it is an all transparent window?

What if you take a hint from what Quartz Debug is telling you about
standard system windows, and instead of using an NSBezierPath (which you
are currently redrawing in its entirety on every frame of a drag), you
fill your window using three large rectangles and four half-arcs?

--Kyle Sluder
___

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

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

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

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


Re: Harnessing Perl Scripts within a Project

2012-11-05 Thread Wim Lewis

On 5 Nov 2012, at 2:59 PM, John Delacour wrote:
> [] hearing all the whoops and applause as the most elementary new things 
> were unveiled and it was announced that a dictionary object could now finally 
> be built in something approaching the sane way it would be done in ancient 
> languages like Perl, I sat with my mouth hanging open in disbelief. What 
> planet do these people live on?, I thought.

Perl5 and NeXT/Apple's ObjC are about the same age, actually --- they both came 
out in the early 90s (and each had been developing since the '80s, as perl1-4 
and as pre-NeXT ObjC respectively). ObjC's original strength was that it was 
nearly the smallest extension you could make to C that would let you do 
Smalltalk-like dynamic object oriented programming.


I've found that trying to write Cocoa UIs in other languages is usually more 
trouble than it's worth, even when I'm more productive in that other language. 
It's possible, but there's so much traffic across the Objc/Perl (or whatever) 
boundary that you're bound to hit the imperfections in the translation. On the 
other hand, I've been writing ObjC GUIs for quite a while, so I'm pretty 
comfortable just using ObjC :)

A hybrid application (ObjC GUI, Perl guts) might be a good way to go.



___

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

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

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

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


Re: Harnessing Perl Scripts within a Project

2012-11-05 Thread Jens Alfke

On Nov 5, 2012, at 2:59 PM, John Delacour  wrote:

> I am interested in your comment that “this isn't usually a productive thing 
> to do”, because I very soon have to decide whether to devote all my time to 
> getting to grips with ObjC or continue dreaming that I can do most of the 
> work in Perl.  

Can we skip the flame-bait please? I could just as easily flame Perl back (one 
of my least favorite languages ever) but that wouldn’t be productive.

> Coming to the verbosity and clumsiness of ObjC after the simplicity, power 
> and conciseness of Perl is, for me, a horrible shock.  

Nonetheless, learning different languages is a good idea. They all have pluses 
and minuses. I agree that Objective-C isn’t as good for munging text or files 
as Perl is (or Ruby or Python). It is however very good for implementing GUIs, 
and it’s very readable, and it generates fast and compact code. Furthermore, 
the verbosity is less of an issue because of Xcode’s excellent auto-complete.

> From what I’ve seen so far, it looks as if I shall need to write twenty or 
> thirty times as much ugly code in ObjC as I would need to write to build the 
> same application in Perl.  Nevertheless I accept that that is only one aspect 
> of productivity and would like to hear what the downside is.

I really think that’s an exaggeration, and yes, I have written significant 
amounts of code in Perl-like scripting languages. Nonetheless, I’m sure there 
will be more code to write. The upside is that the app will run a lot faster 
than it would have in Perl.

One compromise you might consider is using Ruby, which has pretty decent 
integration with Cocoa. (Ditto for Python, but Ruby is more Perl-esque.) It’s 
possible to write Cocoa apps entirely in those languages.

—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: Sorting NSTableView using Bindings

2012-11-05 Thread Ken Thomases
On Nov 5, 2012, at 12:50 PM, Quincey Morris wrote:

> On Nov 5, 2012, at 10:03 , Paul Johnson  wrote:
> 
>> I can sort the table by clicking on column headers, but when the
>> drawer is opened the data is unsorted.
> 
> Yes, because clicking on column headers causes the table view to *create* the 
> array of sort descriptors.
> 
> What you need to do is create a property in your data model that holds the 
> sort descriptors. Bind the array controller's Sort Descriptors binding to 
> this property. That causes the array controller's arrangedObjects to be 
> ordered according to the sort order in the data model property, and the table 
> view gets this order (via arrangedObjects) without additional work.
> 
> If the column header is clicked, the table view updates its own 
> sortDescriptors property, which (via its automatically configured binding) 
> updates the array controller's sortDescriptors property, which (via its 
> manually configured binding) updates the data model property. 
> 
> Chances are you'll also want the data model property to updates user defaults 
> when set, and initially load its value from user defaults on startup.

That's all fine and good but maybe more than needed.

If you're just looking for a quick and simple fix, you can set up an outlet 
from your window controller to the array controller -- there's a good chance 
you already have that -- and, during -awakeFromNib or -windowDidLoad, simply 
set the array controller's sortDescriptors property.  That will set the initial 
sort order.  Clicks in table column headers will change that property as 
necessary.

Cheers,
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: Extremely low fps during transparent NSWindow resize

2012-11-05 Thread Ken Thomases
On Nov 5, 2012, at 5:39 PM, Kyle Sluder wrote:

> On Mon, Nov 5, 2012, at 02:20 PM, Andrea3000 wrote:
>> Since I still have a Snow Leopard partition I have access to QuartDebug
>> 4.1 and the hidden setting you suggested works as expected.
>> The strange thing is that while regular windows like Safari, Mail, ecc,
>> are all opaque except for the corners (as pointed out in the previous
>> mail), Quick Time Player X window is fully transparent!
>> 
>> So the question is still open. How can Quick Time Player X be so fast
>> during resize if it is an all transparent window?
> 
> What if you take a hint from what Quartz Debug is telling you about
> standard system windows, and instead of using an NSBezierPath (which you
> are currently redrawing in its entirety on every frame of a drag), you
> fill your window using three large rectangles and four half-arcs?

It's worth trying, but I don't think that's what is meant when Quartz Debug 
says a region of a window is transparent.  It has nothing to do with how it's 
been drawn.  It has to do with what the window server has been told about which 
parts of the window are non-opaque.  -[NSWindow setOpaque:NO] tells the window 
server that no part of the window is opaque, so it has to composite the whole 
window, even if, in reality, most of the window is filled with opaque color.

This issue can be reproduced with a bog-standard Cocoa app.  Just add [window 
setOpaque:NO] to the -applicationDidFinishLaunching: method in a standard app 
template and you get the problem.  This is without any drawing (other than the 
window's own background color, which I'm leaving at the default) by any views.

I suspect that QuickTime Player X is using private interfaces to tell the 
window server that specific window regions (the four corners) are non-opaque.

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: Sorting NSTableView using Bindings

2012-11-05 Thread Ken Thomases
On Nov 5, 2012, at 9:01 PM, Paul Johnson wrote:

> Thanks, Ken.

You're welcome.

> I WOULD like to know if this code can be removed and instead of this
> code I can make some changes in the Bindings Inspector. It just seems
> to nice to be able to avoid writing code when I can specify things in
> Xcode instead.

Not to my knowledge.  Bindings don't provide a way to specify the initial sort. 
 Bindings are nice, but they're not intended to entirely eliminate the need to 
write code.

Cheers,
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: This board is slow. Was: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()

2012-11-05 Thread Dix Lorenz

On 05.11.2012, at 23:20, Greg Parker  wrote:
> 
> The devforums have an "Email Updates" feature for each sub-forum. If you 
> enable that for the topics you're interested in then you can read as if it 
> were a mailing list. You'll only need to visit the web site when you want to 
> post.

Thanks for that tip! I wonder how many people saw that button before knowing 
there should be something somewhere and actively looking for it... I know I 
never did.




___

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