Space-efficient saving for Versions?

2011-07-28 Thread Daniel Vollmer
Salutations, in my custom document package I'm always including a large-ish chunk of data that does not get modified as I change the document itself. Currently, I'm keeping this around as NSData-object and write it out when being asked by NSDocument to return my fileWrapper as one sub-file of t

Keeping NSOutlineView always active?

2011-07-28 Thread Leo
Hi all, Is it possible to make NSOutlineView look always active, even if it's not the actual first responder? Similar to the way the sidebar appears in the Finder: the selection in sidebar always appears as active, even when you work with the actual window contents. Am I missing something

Keeping NSOutlineView always active?

2011-07-28 Thread Leo
Hi all, Is it possible to make NSOutlineView look always active, even if it's not the actual first responder? Similar to the way the sidebar appears in the Finder: the selection in sidebar always appears as active, even when you work with the actual window contents. Am I missing something

Re: Keeping NSOutlineView always active?

2011-07-28 Thread Leo
Oops sorry - please ignore, just reposted as a separate thread. Leo On 7/28/11 4:09:38 AM, Leo wrote: Hi all, Is it possible to make NSOutlineView look always active, even if it's not the actual first responder? Similar to the way the sidebar appears in the Finder: the selection in sideba

UI like Transmission BT

2011-07-28 Thread Wilker
Hi Guys, Which components of XCode 4 I should use in order to make an UI like the Transmission BT (http://www.transmissionbt.com/) I mean the part of downloads, one below the other, its like each download is a view, but I don't know how to put them one below the order, and how to make background

Re: UI like Transmission BT

2011-07-28 Thread Daniel Vollmer
On 28 Jul 2011, at 10:16, Wilker wrote: > Hi Guys, > > Which components of XCode 4 I should use in order to make an UI like the > Transmission BT (http://www.transmissionbt.com/) Why don't you check yourself in the source-code: https://trac.transmissionbt.com/browser/trunk/macosx Daniel. _

Re: UI like Transmission BT

2011-07-28 Thread Thomas Davie
On 28 Jul 2011, at 09:16, Wilker wrote: > Hi Guys, > > Which components of XCode 4 I should use in order to make an UI like the > Transmission BT (http://www.transmissionbt.com/) > > I mean the part of downloads, one below the other, its like each download is > a view, but I don't know how to p

Re: UI like Transmission BT

2011-07-28 Thread Wilker
Thanks guys, I mean I will take the NSTableView + NSView solution, Mac users migrate fast and my software will still on first release, I mean its ok for me for early adopting it :) --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600 On Thu, Jul 28, 2011 at 6:15 AM,

Re: UI like Transmission BT

2011-07-28 Thread Corbin Dunn
On Jul 28, 2011, at 2:15 AM, Thomas Davie wrote: > > On 28 Jul 2011, at 09:16, Wilker wrote: > >> Hi Guys, >> >> Which components of XCode 4 I should use in order to make an UI like the >> Transmission BT (http://www.transmissionbt.com/) >> >> I mean the part of downloads, one below the other

Re: Space-efficient saving for Versions?

2011-07-28 Thread Kevin Perry
The Versions store will do this automatically. It can detect when blocks of a file have been duplicated and avoid storing those blocks on disk. On Jul 28, 2011, at 12:37 AM, Daniel Vollmer wrote: > Salutations, > > in my custom document package I'm always including a large-ish chunk of data >

Re: Running Cocoa from a dynamic library

2011-07-28 Thread Jens Alfke
On Jul 27, 2011, at 8:02 AM, Guido Sales Calvano wrote: > Ogre3D however, uses a cocoa window to render on, and obviously I want user > input. But if I start ogre in a dynamic library ui events register > incorrectly. It’s not the fact that it’s in a dynamic library that causes trouble (for

Re: Running Cocoa from a dynamic library

2011-07-28 Thread Bill Appleton
You might try NPAPI, it is designed to let you draw on a surface and get events Your plugin runs in a separate process, and is scriptable by javascript best bill On Wed, Jul 27, 2011 at 8:02 AM, Guido Sales Calvano wrote: > Dear community, > > I'm building a project I've been thinking a

Filter an array

2011-07-28 Thread Chris Paveglio
I have an array of file paths, and I need to filter them to return only files with extensions I have in another array. So any files that end with {.tif, .png, .eps} etc.  I'm looking at using: - (NSArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate Is this the best option for this kind

Re: NSFileManager - a cautionary tale

2011-07-28 Thread Greg Parker
On Jul 26, 2011, at 6:51 PM, Graham Cox wrote: > On 27/07/2011, at 11:14 AM, Graham Cox wrote: >> However, this method eventually calls mkdir, which fails with an error if >> the directory already exists. This call to mkdir causes the App Store >> reviewers to have conniptions, even though it cer

Re: Filter an array

2011-07-28 Thread Kyle Sluder
On Thu, Jul 28, 2011 at 1:35 PM, Chris Paveglio wrote: > I have an array of file paths, and I need to filter them to return only files > with extensions I have in another array. So any files that end with {.tif, > .png, .eps} etc. > I'm looking at using: - (NSArray > *)filteredArrayUsingPredica

Re: Filter an array

2011-07-28 Thread Kyle Sluder
Oh, I don't know how I missed this, but there's a very convenient -[NSArray pathsMatchingExtensions:] method already declared in NSPathUtilities.h: http://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/2137-BBCHHAJ

Re: NSFileManager - a cautionary tale

2011-07-28 Thread wadeslists
>> Another thing to mention - we run this code during app launch, so we didn't >> see it in fs_usage, which requires that the process it's peeking at is >> running already. I'm not sure if there is a way to observe file system stuff >> during launch - if anyone knows, please let me know! sudo f

Re: Filter an array

2011-07-28 Thread wadeslists
> Oh, I don't know how I missed this, but there's a very convenient > -[NSArray pathsMatchingExtensions:] method already declared in > NSPathUtilities.h: > http://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/2137

Re: Filter an array

2011-07-28 Thread Mike Abdullah
Further to earlier answers, bear in mind you've got no guarantee that file extensions are correct, or even exist. Plus of course, you might have both .jpg and .jpeg. You might well be better iterating through, finding the UTI of each file, and working from that. On 28 Jul 2011, at 21:35, Chris

Return causes EXC_BAD_ACCESS

2011-07-28 Thread Mr. Gecko
I am unable to find out as to why I am receiving this problem, I can verify other parts of the code before it gets to the return and that the object I am returning does in-fact work as I am able to NSLog it and see the description of it. The basic idea of this code is to notify other objects to

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Dave DeLong
It kind of looks like foundCookieJar is an ivar, which means that "return foundCookieJar" is really going to be "return self->foundCookieJar". Since you set "self" to "nil", you're trying to dereference a NULL pointer, which is a great way to crash your app. HTH, Dave On Jul 28, 2011, at 2:3

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Mr. Gecko
That makes lots of sense, never even expected that to happen. Adding a local variable and setting it to the value before releasing it and returning that variable fixes the issue. I am still looking to an link to explanation in detail as to why this happens. If it's as I said, then I do not think

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Kyle Sluder
On Thu, Jul 28, 2011 at 2:45 PM, Mr. Gecko wrote: > That makes lots of sense, never even expected that to happen. Adding a local > variable and setting it to the value before releasing it and returning that > variable fixes the issue. I am still looking to an link to explanation in > detail as

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Dave DeLong
Well, let's think about it. "Instance variables" are only accessible as long as you have an instance, right? You can't have an instance variable without an instance. So if you set "self" to nil... then you no longer have an instance. Thus, you cannot access self's instance variables, because

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Scott Ribe
On Jul 28, 2011, at 3:33 PM, Mr. Gecko wrote: > From my understanding, this should happen when you, for an example, try to > access the pointer 0x18c95b0 whenever that belongs to another process. > However, I also thought that the Mac has a copy of memory space for each > process and therefore

Re: Running Cocoa from a dynamic library

2011-07-28 Thread Stephen J. Butler
On Thu, Jul 28, 2011 at 1:14 PM, Jens Alfke wrote: > On Jul 27, 2011, at 8:02 AM, Guido Sales Calvano wrote: > >> Ogre3D however, uses a cocoa window to render on, and obviously I want user >> input. But if I start ogre in a dynamic library ui events register >> incorrectly. > > It’s not the fact

Re: NSFileManager - a cautionary tale

2011-07-28 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/28/11 2:05 PM, wadesli...@mac.com wrote: > sudo fs_usage | grep No need to use grep... you can just: sudo fs_usage (This is similar to the redundant "cat | grep foo") - -- Conrad Shultz Synthetiq Solutions www.synthetiqsolutions.com

Calculations in a tableview

2011-07-28 Thread Andre Masse
Hi, For example, lets say I have a tableview with 3 columns: quantity, unit price and total. I want to calculate total using (quantity * unit price). Pretty simple using a datasource but I've no idea how to do that with bindings (using an NSArrayController). Any pointer to an example of this w

Re: Calculations in a tableview

2011-07-28 Thread Thomas Davie
On 28 Jul 2011, at 23:48, Andre Masse wrote: > Hi, > > For example, lets say I have a tableview with 3 columns: quantity, unit price > and total. I want to calculate total using (quantity * unit price). Pretty > simple using a datasource but I've no idea how to do that with bindings > (using

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Jens Alfke
On Jul 28, 2011, at 3:00 PM, Kyle Sluder wrote: > I'm not sure what your motivation is for calling [self release] here, > but no code should be doing this. I disagree. There are a couple of reasons to call this: - It’s pat of the failure path for -init methods. Before returning nil you need to

Re: UI like Transmission BT

2011-07-28 Thread Wilker
I'm trying a lot to make the NSTableView + NSView but I just can't make it work... I don't know the way to go, I was reading this doc here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TableView/ViewBasedTables/ViewBasedTables.html#//apple_ref/doc/uid/1026i-CH15-SW2 B

Re: Filter an array

2011-07-28 Thread Jens Alfke
On Jul 28, 2011, at 1:35 PM, Chris Paveglio wrote: > I'm looking at using: - (NSArray *)filteredArrayUsingPredicate:(NSPredicate > *)predicate I was going to suggest using a block to filter, but it seems that Foundation collections still don’t implement the standard functional operators like ‘

Re: UI like Transmission BT

2011-07-28 Thread Wilker
Sorry guys, my bad... I tried to create a View Controller class by extending from NSView instead of NSViewController... Now its running fine :) Just one last question, I'm using a table with a single column, how I make this column fill 100% of table and follow the table size (in case of table gr

drawRect not getting called problem solved

2011-07-28 Thread Tom Jeffries
I appreciate all the comments on the problem I had with drawRect not getting called. I finally extracted the code that was not working and put it in a new program, and it worked perfectly. I'm still not sure whether there was a problem in my code or if I unearthed a problem in Cocoa, but I'm now

Re: drawRect not getting called problem solved

2011-07-28 Thread Jens Alfke
On Jul 28, 2011, at 5:31 PM, Tom Jeffries wrote: > I do think > it's important to keep in mind the difference between code and data, > and some of the suggestions I got seemed to show some lack of clarity > in that area. Confusing the two may work in certain specific > environments, but it reflec

Re: Calculations in a tableview

2011-07-28 Thread Andre Masse
Well, I may end up doing this… Thanks Andre Masse On 28/07/2011, at 18:52 , Thomas Davie wrote: > > On 28 Jul 2011, at 23:48, Andre Masse wrote: > >> Hi, >> >> For example, lets say I have a tableview with 3 columns: quantity, unit >> price and total. I want to calculate total using (quant

Re: drawRect not getting called problem solved

2011-07-28 Thread Graham Cox
On 29/07/2011, at 10:31 AM, Tom Jeffries wrote: > I do think > it's important to keep in mind the difference between code and data, > and some of the suggestions I got seemed to show some lack of clarity > in that area. Confusing the two may work in certain specific > environments, but it reflect

Re: Return causes EXC_BAD_ACCESS

2011-07-28 Thread Graham Cox
On 29/07/2011, at 7:33 AM, Mr. Gecko wrote: > From my understanding, this should happen when you, for an example, try to > access the pointer 0x18c95b0 whenever that belongs to another process. No. Memory is "virtual", the addresses you appear to be working with are not real (i.e. they don't

Freaking out a bit...

2011-07-28 Thread John Cate
applicationWillFinishLaunching: and applicationDidFinishLaunching: are not getting called. I checked the spelling, going so far as to copy and paste from documentation to code. (It worked pre-OS X 10.7). I made sure the delegate was set by NSLogging it. I even added the formal protocol tag. To t

Re: Calculations in a tableview

2011-07-28 Thread Rajendran P
Try value transformers Thanks Rajendran P On 7/29/11 6:18 AM, "Andre Masse" wrote: Well, I may end up doing this... Thanks Andre Masse On 28/07/2011, at 18:52 , Thomas Davie wrote: > > On 28 Jul 2011, at 23:48, Andre Masse wrote: > >> Hi, >> >> For example, lets say I have a tableview wit

Re: Calculations in a tableview

2011-07-28 Thread Quincey Morris
On Jul 28, 2011, at 15:48, Andre Masse wrote: > For example, lets say I have a tableview with 3 columns: quantity, unit price > and total. I want to calculate total using (quantity * unit price). Pretty > simple using a datasource but I've no idea how to do that with bindings > (using an NSArra

Re: Calculations in a tableview

2011-07-28 Thread Steve Steinitz
Hi, On 29 Jul 11, at 10:51am, cocoa-dev-requ...@lists.apple.com wrote: > For example, lets say I have a tableview with 3 columns: quantity, unit price > and total. I want to calculate total using (quantity * unit price). Pretty > simple using a datasource but I've no idea how to do that with bi

Re: Lion doesn't like tricky.key.paths in bindings?

2011-07-28 Thread Jerry Krinock
On 2011 Jul 24, at 09:05, Clark Cox wrote: > Well, is the suggestion correct? That is, is there any way that the > value of barDate could have changed without sending the appropriate > KVO notification (did you, for example change the value of barDate > without going through the setter?) Thank y

A trap with full screen in Lion

2011-07-28 Thread Gideon King
I just came across a bit of an issue with the full screen mode in Lion: if you have a view and use [[self window] windowController] to get at your window controller, it will return nil in full screen mode. The window gets swapped out with an NSToolbarFullScreenWindow, which doesn't have a window

Re: Lion doesn't like tricky.key.paths in bindings?

2011-07-28 Thread Kyle Sluder
On Thu, Jul 28, 2011 at 7:20 PM, Jerry Krinock wrote: >> Well, is the suggestion correct? That is, is there any way that the >> value of barDate could have changed without sending the appropriate >> KVO notification (did you, for example change the value of barDate >> without going through the set

Re: Freaking out a bit...

2011-07-28 Thread Kyle Sluder
On Thu, Jul 28, 2011 at 6:20 PM, John Cate wrote: > applicationWillFinishLaunching: and applicationDidFinishLaunching: are not > getting called. I checked the spelling, going so far as to copy and paste > from documentation to code. (It worked pre-OS X 10.7). I made sure the > delegate was set

Re: A trap with full screen in Lion

2011-07-28 Thread Gideon King
Sorry - missed an important bit of info - this applies for a view that is in the toolbar. So far as I am aware, it doesn't apply to views in your main window (at least my views in my main window still appear to always return the right thing). On 29/07/2011, at 12:38 PM, Gideon King wrote: > I j

Re: Calculations in a tableview

2011-07-28 Thread Andre Masse
Thanks a lot for the clarifications about the role of the NSArrayController. I somehow got confused about the whole binding thing, its not so muddy now. Now, the example I gave was a bad simplification of the real thing as the "totalPrice" is more a "proposedTotalPrice". It's based on a calculat

Re: Calculations in a tableview

2011-07-28 Thread Quincey Morris
On Jul 28, 2011, at 20:00, Andre Masse wrote: > Is this can be done using bindings or should I stop fighting the framework > and and use a datasource? It can be done with bindings***. All you've done is clarified that "totalPrice" isn't a derived property after all. So, you make a regular prope

didReceivePTPEvent is not triggered with Canon T2i

2011-07-28 Thread Francis Lessard
I am trying to create an application that allows a user to take a picture from a camera device. I am usingImageCaptureCore.framework to do this by using the requestTakePicture method, and I've set a delegate to catch the didReceivePTPEvent message to tell me when the capture is complete. If I t

MPMoviePlayerController Fast forward

2011-07-28 Thread Steve Kostrey
I've implemented MPMoviePlayerController (iPhone/iPad) and I'm playing videos without trouble but I'm not sure how to receive an event from the Fast forward overlay button. I've tried everything the documentation suggests about remote control but I'm not sure that's the way. I've tried the foll

Re: drawRect not getting called problem solved

2011-07-28 Thread Preston Sumner
On Jul 28, 2011, at 6:31 PM, Tom Jeffries wrote: > I appreciate all the comments on the problem I had with drawRect not > getting called. I finally extracted the code that was not working and > put it in a new program, and it worked perfectly. I'm still not sure > whether there was a problem in

UIImageView subclasses

2011-07-28 Thread William Squires
Hi all! Here's what I've got: (Xcode 3.2.5 - iOS SDK 4) A view controller that dynamically creates UIImageView subclass instances as subviews in it's awakeFromNib According to the documentation, UIImageView subclasses do not enable user interaction by default, so ... // Create a UIImageView

Re: UIImageView subclasses

2011-07-28 Thread Graham Cox
On 29/07/2011, at 3:24 PM, William Squires wrote: > Okay, now what? How do I connect the "Touch Up Inside" of the UIImageView > (subclass instance) to the > > -(IBAction)customButtonTouched:(id)sender; > > method of my view controller (the one that created the UIImageView subclass > instances

Drawing performance in CALayer

2011-07-28 Thread Graham Cox
In my iTunes visualizer, I'm using layers to draw many, many small rectangles (to represent segments of a spectrum analyser display). There can be up to 32 bands x 40 segments x 2 channels = 2,560 segments, all redrawn 30 times per second or more. One layer is used for one bar, which is 40 rect

Why Don't Cocoa's (Un)Archiving Methods return Errors?

2011-07-28 Thread Jerry Krinock
With each major update of Mac OS X, Apple updates more classes to return proper NSErrors, deprecating methods which either don't give errors or give outmoded error representations. But what about NSKeyedArchiver and NSKeyedUnarchiver, in particular these methods… +[NSKeyedArchiver archivedData

What could cause a fast enumeration mutation error in updating tracking areas?

2011-07-28 Thread Gideon King
Hi, I have a problem where a few users of my program are getting the following exception: 0 CoreFoundation 0x7fff862df7b4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x7fff84b0ff03 objc_exception_throw + 45 2 CoreFoundation 0x7fff863375bf __NSFastEnumerationMutationHandler + 303 3 A

Re: Lion doesn't like tricky.key.paths in bindings?

2011-07-28 Thread Jerry Krinock
On 2011 Jul 28, at 19:42, Kyle Sluder wrote: > KVO doesn't do an -isEqual: on the result of your method. It does > pointer equality. Something changed on Lion that causes it to now care > that the return value of your method stays constant when it should. Thank you, Kyle. For a while I thought