Re: Local Properties

2012-09-03 Thread Graham Cox
On 04/09/2012, at 3:24 PM, Gerriet M. Denkmann wrote: > I have a class with a mutable array. But from outside it should be just a > read-only non-mutable array. [] > Is there a better (more elegant) way? Just return the internal (mutable) array as an NSArray. By typing it as an NSArray, you

Re: Local Properties

2012-09-03 Thread David Duncan
On Sep 3, 2012, at 10:24 PM, Gerriet M. Denkmann wrote: > I have a class with a mutable array. But from outside it should be just a > read-only non-mutable array. > My current solution: > > MyClass.h file contains: > > @property (readonly, nonatomic) NSArray *externalArray; > > and MyCl

Local Properties

2012-09-03 Thread Gerriet M. Denkmann
I have a class with a mutable array. But from outside it should be just a read-only non-mutable array. My current solution: MyClass.h file contains: @property (readonly, nonatomic) NSArray *externalArray; and MyClass.m file has: @interface MyClass() @property (strong) NSMutableArray *int

Re: UIDocument openWithCompletionHandler: called on what thread?

2012-09-03 Thread Roland King
On 4 Sep, 2012, at 12:09 AM, Luke Hiesterman wrote: > The documentation isn't entirely accurate. The completion handler will only > be executed on the main queue if you call the method on the main queue. In > general, the completion handler is executed on the same queue that the > constituent

Re: Create custom NSTableView with a button inside

2012-09-03 Thread Alfian Busyro
Did you look at the TableViewPlayground sample project from Apple? as Conrad said, on this example only covers view-based tableview. My question to Alfian, however, is why a cell-based table view is desired. Are you targeting 10.6? Yes, My project still targeting OSX 10.6 (Snow Leopard) as a

Customising cells in IKImageBrowserView

2012-09-03 Thread Graham Cox
I want to customise the appearance of a selected cell in an IKImageBrowserView. I'm subclassing IKIMageBrowserView, and overriding: - (IKImageBrowserCell*) newCellForRepresentedItem:(id) anItem { IKImageBrowserCell* cell = [super newCellForRepresentedItem:anItem];

Re: How to get multiple NSURLs from Finder drop.

2012-09-03 Thread Todd Freese
Thanks, didn't see the new API. Todd On Sep 3, 2012, at 4:12 PM, Kyle Sluder wrote: > > On Sep 3, 2012, at 1:32 PM, Todd Freese > wrote: > >> I'm trying to get my App Sandboxed. I need to be able to accept a multi-file >> finder drop to import files. However, how did I get multiple NSURLs

Re: rectArrayForCharacterRange and lineSpacing (was: text highlighting with CALayer and NSTextView)

2012-09-03 Thread Koen van der Drift
Thanks, I'll have a look at that. - Koen. On Sep 3, 2012, at 19:01, Kyle Sluder wrote: > On Sep 3, 2012, at 11:02 AM, Koen van der Drift > wrote: > >> >> So it seems for the last rect, the linespace is ignored. I can test for >> that, and correct it, but I was wondering what is going on.

Re: How to insert a "screen-only" character in an NSTextView?

2012-09-03 Thread Koen van der Drift
I've decided not to use this in my app and try something else to make annotations in my textView. Thanks all for the input though. - Koen. On Sep 3, 2012, at 18:57, Kyle Sluder wrote: > On Sep 3, 2012, at 3:06 PM, William Squires wrote: > >> This would be better handled with some sort of fil

Re: How to insert a "screen-only" character in an NSTextView?

2012-09-03 Thread Ross Carter
I think Kyle and William are saying the same thing: leave NSTextStorage alone and adjust the presentation as needed. On Sep 3, 2012, at 6:57 PM, Kyle Sluder wrote: > On Sep 3, 2012, at 3:06 PM, William Squires wrote: > >> This would be better handled with some sort of filter applied at I/O t

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Alex Zavatone
On Sep 3, 2012, at 6:57 PM, Roland King wrote: > These exact points are explained at the start of the 2012 WWDC sand boxing > video, which also introduces some of the terminology and thinking behind the > design. I found that video well worth 45 or so minutes of my life. Won't help > with the

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Alex Zavatone
On Sep 3, 2012, at 6:44 PM, Todd Heberlein wrote: > > On Sep 3, 2012, at 2:58 PM, William Squires wrote: > >> I can see the benefit of taking a more security-related stance on a closed >> platform like iOS so as to make writing malware harder, but for a >> general-purpose computing platform,

Re: rectArrayForCharacterRange and lineSpacing (was: text highlighting with CALayer and NSTextView)

2012-09-03 Thread Kyle Sluder
On Sep 3, 2012, at 11:02 AM, Koen van der Drift wrote: > > So it seems for the last rect, the linespace is ignored. I can test for > that, and correct it, but I was wondering what is going on. And where does > the '3' come from? There was a WWDC 2012 session on Core Text that Ned Holbrook

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Roland King
These exact points are explained at the start of the 2012 WWDC sand boxing video, which also introduces some of the terminology and thinking behind the design. I found that video well worth 45 or so minutes of my life. Won't help with the sand boxing bugs but it did give me a better idea of how

Re: How to insert a "screen-only" character in an NSTextView?

2012-09-03 Thread Kyle Sluder
On Sep 3, 2012, at 3:06 PM, William Squires wrote: > This would be better handled with some sort of filter applied at I/O time > (i.e. when you read/write the file) I would think. That is, let your model > objects handle the translation, and let the view objects do what view objects > are supp

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Graham Cox
On 04/09/2012, at 7:58 AM, William Squires wrote: > As it is, there's a whole sh*tload of steps between 2 and 4 now (and that > replace step 3). Boo! I'm not certain, but it looks as if Xcode 4.4 does largely automate all of this, provided you have the right developer account set up with App

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Todd Heberlein
On Sep 3, 2012, at 2:58 PM, William Squires wrote: > I can see the benefit of taking a more security-related stance on a closed > platform like iOS so as to make writing malware harder, but for a > general-purpose computing platform, this'll just put unnecessary roadblocks > in the way of ne

Re: rectArrayForCharacterRange and lineSpacing (was: text highlighting with CALayer and NSTextView)

2012-09-03 Thread Graham Cox
On 04/09/2012, at 4:02 AM, Koen van der Drift wrote: > For some reason, the height of the last rect in the NSRectArray is smaller > than the other ones, and therefore the CALayer I draw behind the > corresponding range of text looks wrong. > > My font size is 16, and the line spacing is set t

Re: More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread Todd Heberlein
I suspect the moderator will shut this down as off topic, but I'll reiterate what I've said before. On Sep 3, 2012, at 2:58 PM, William Squires wrote: > Why should sandboxing on MacOS X even be necessary, seeing as we already > have the Unix file permissions (and ACLs) to handle who can/canno

Re: How to insert a "screen-only" character in an NSTextView?

2012-09-03 Thread William Squires
This would be better handled with some sort of filter applied at I/O time (i.e. when you read/write the file) I would think. That is, let your model objects handle the translation, and let the view objects do what view objects are supposed to do. Trying to fiddle around with low-level NSTextStor

More sandblasting (oops, I mean sandboxing die die die)

2012-09-03 Thread William Squires
Why should sandboxing on MacOS X even be necessary, seeing as we already have the Unix file permissions (and ACLs) to handle who can/cannot read/write to a file or directory? The only time I can see needing an entitlement is if you write low-level stuff (IOKit, kext's, USB drivers, 'fixit' uti

Re: System Menu Bar

2012-09-03 Thread Ken Thomases
On Sep 3, 2012, at 3:45 PM, Charlie Dickman wrote: > Is there a way to make the system menu bar transparent from within a cocoa > app? The following AppleScript does it. You can use NSAppleScript or Scripting Bridge or the like to achieve the same thing: tell application "System Events"

Re: How to get multiple NSURLs from Finder drop.

2012-09-03 Thread Kyle Sluder
On Sep 3, 2012, at 1:32 PM, Todd Freese wrote: > I'm trying to get my App Sandboxed. I need to be able to accept a multi-file > finder drop to import files. However, how did I get multiple NSURLs from the > finder? There only seems to be two finder pasteboard types: > NSFilenamesPboardType &

Re: Network and DarkWake

2012-09-03 Thread Greg Parker
On Sep 2, 2012, at 7:31 AM, Gerriet M. Denkmann wrote: > On 2 Sep 2012, at 20:46, Matt Patenaude wrote: > >> Are you using it in the asynchronous callback style, or the synchronous >> GetFlags function? > > I am using: > SCNetworkReachabilitySetCallback() > SCNetworkReachabilityScheduleWithRun

System Menu Bar

2012-09-03 Thread Charlie Dickman
Is there a way to make the system menu bar transparent from within a cocoa app? Charlie Dickman 3tothe...@comcast.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

How to get multiple NSURLs from Finder drop.

2012-09-03 Thread Todd Freese
I'm trying to get my App Sandboxed. I need to be able to accept a multi-file finder drop to import files. However, how did I get multiple NSURLs from the finder? There only seems to be two finder pasteboard types: NSFilenamesPboardType & NSURLPboardType. NSFilenamesPboardType won't work becaus

Re: Create custom NSTableView with a button inside

2012-09-03 Thread Conrad Shultz
On 09/03/2012 05:11 AM, Koen van der Drift wrote: > > On Sep 3, 2012, at 5:50 AM, Alfian Busyro wrote: > >> are there any examples of how to create a custom cell-based table view with >> a button inside of the column ? > > > Did you look at the TableViewPlayground sample project from Apple?

rectArrayForCharacterRange and lineSpacing (was: text highlighting with CALayer and NSTextView)

2012-09-03 Thread Koen van der Drift
On Aug 25, 2012, at 6:10 AM, Koen van der Drift wrote: > NSRectArrayrectArray = [[self layoutManager] > rectArrayForCharacterRange: aRange > > withinSelectedCharacterRange: selectedRange >

Re: UIDocument openWithCompletionHandler: called on what thread?

2012-09-03 Thread Luke Hiesterman
The documentation isn't entirely accurate. The completion handler will only be executed on the main queue if you call the method on the main queue. In general, the completion handler is executed on the same queue that the constituent method was called on. Luke On Sep 3, 2012, at 6:29 AM, "Rol

UIDocument openWithCompletionHandler: called on what thread?

2012-09-03 Thread Roland King
Here's a small snippet from the docs for UIDocument's openWithCompletionHandler: Parameters completionHandler A block with code to execute after the open operation concludes. The block returns no value and has one parameter: success

Re: Create custom NSTableView with a button inside

2012-09-03 Thread Koen van der Drift
On Sep 3, 2012, at 5:50 AM, Alfian Busyro wrote: > are there any examples of how to create a custom cell-based table view with a > button inside of the column ? Did you look at the TableViewPlayground sample project from Apple? - Koen. ___ Cocoa-d

Create custom NSTableView with a button inside

2012-09-03 Thread Alfian Busyro
Hi guys, I try to implement a list view using|NSTableView|cell-based, but having difficulty creating a button inside the cell column. are there any examples of how to create a custom cell-based table view with a button inside of the column ? ps: I have tried to create custom tableview examp