Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Quincey Morris
On Jun 15, 2011, at 11:40, Brian Norh wrote: > Is there a better way to do this? I have searched the documentation > and have not found anything specific on which practices to use. It > sounds like something very basic which it should cover so maybe I'm > just searching with the wrong terms. I'm

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Joar Wingfors
On 17 jun 2011, at 23.08, Ken Tozier wrote: > There's nothing particularly kludgy about using HTML to create styled text > documents. The entire internet is based on it. Kind of depends on where this document would be used though. On the Internet? Amazing. On the desktop? Weird! > Once the

Re: pagingEnabled on NSScrollView?

2011-06-18 Thread Quincey Morris
On Jun 17, 2011, at 04:04, Leonardo wrote: > within the scrollToPageNum: I programmatically scroll the clipView to the > X point = 100. >[mDocView scrollPoint:newPoint]; >[self reflectScrolledClipView:mClipView]; >[self display]; > > Now I can see the page well positioned at X = 100 >

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Jean-Christophe Helary
On Jun 18, 2011, at 4:15 PM, Joar Wingfors wrote: >> I surely can't be the first person to want to do this, so I ask: what have >> I missed? How can I generate extremely large rich-text files without having >> to build the entire file in memory before writing it out? > > > Perhaps your requ

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Ken Tozier
On Jun 18, 2011, at 3:15 AM, Joar Wingfors wrote: > That loops back to the original question though, does it not? Ie., if this > document is really large, how would he do this HTML+CSS -> RTF conversion? > > HTML documents are directly openable in Word. No conversion necessary. Write all the

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Peter Hudson
I'm not sure quite how big you data is - but I write big data sets to file by writing all the data into an NSTextView - and then get the RTF data from the view. There is also quite a lot of scope for combining separate RTF files. You can see how to do this by renaming your RTF file with a

Drawing focus rings

2011-06-18 Thread Peter Hudson
I need to draw a focus ring ( or something that looks like a focus ring ) around a group of rows in an NSTableView. Drawing a rectangle with NSBezierPath works fine - how do I make it look like a focus ring ? Peter ___ Cocoa-dev mailing list (Co

Re: NSString accessing characters

2011-06-18 Thread Ken Thomases
On Jun 17, 2011, at 5:35 AM, Andreas Grosam wrote: > Thank you Ken, for your valuable tips, You're welcome. > On Jun 17, 2011, at 10:40 AM, Ken Thomases wrote: > >> After that, maybe use CFStringInitInlineBuffer() and >> CFStringGetCharacterFromInlineBuffer(), although that doesn't fit with yo

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Douglas Davidson
I might point out that NSAttributedString has a facility for writing out HTML that has options flexible enough to do things like suppressing the head etc for writing out HTML fragments. As others point out, HTML is better suited to this sort of thing than many other formats. NSAttributedString

Re: Temporarily enabling layer backing for NSView

2011-06-18 Thread Houdah - ML Pierre Bernard
Try calling -display after -setWantsLayer: The view needs to be drawn once into the layer before being able to animate. Another way of achieving the desired result is to draw the initial and target view into images and then animate the swapping of image views. Best, Pierre Bernard Houdah Softwa

Re: layoutSubviews doesn't always work (iOS 4.3 on iPad Simulator)

2011-06-18 Thread Matt Neuburg
On Sun, 12 Jun 2011 14:30:42 +1000, Brian Bruinewoud said: >Hi All, > >I have an app that consists of a scroll view subclass which contains a single >subview. In the scroll view subclass I override layoutSubviews based on Apple >sample code (see below). The intention of layoutSubviews is to cent

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Charles Srstka
On Jun 17, 2011, at 11:43 PM, Dave DeLong wrote: > Hey List, > > I'm writing a little app for myself to take a database full of text and > format it into either a Word Document or an RTF document (either one is fine > for my purposes). I've got it working for small datasets, but I'm running in

Re: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?

2011-06-18 Thread Matt Neuburg
>"Important: Before releasing an instance of UIWebView for which you >have set a delegate, you must first set the UIWebView delegate >property to nil before disposing of the UIWebView instance. This can >be done, for example, in the dealloc method where you dispose of the >UIWebView." > >The delega

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Kyle Sluder
On Wed, Jun 15, 2011 at 11:40 AM, Brian Norh wrote: > I'm building a Cocoa application and have a question about using > window controllers. The idea is that when the user selects New from > the File menu, an instance of MyWindowController which is a subclass > of NSWindowController is created and

Re: Drawing focus rings

2011-06-18 Thread Lee Ann Rucker
>From the sample code in ClockControl.m : // If we have focus, draw a focus ring around the entire cellFrame (inset it a little so it looks nice). if ([self showsFirstResponder]) { // showsFirstResponder is set for us by the NSControl that is drawing us. NSRect focusRingFrame = c

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Kyle Sluder
On Sat, Jun 18, 2011 at 10:09 AM, Kyle Sluder wrote: > It's essentially the same delegate/owner pattern you see all over the > place in Cocoa, except the window controller doesn't need a weak > pointer to the app delegate because it cal always get at it by calling > [NSApp delegate]. Actually, I

Retrieve NSTable DataSource from AppController

2011-06-18 Thread Kevin Muldoon
Basic stuff, I'm sure, but I'm stumped after several hours of googling... I have an NSTable which receives its dataSource from MyTableController.m. However, my AppController.m needs the data MyTableController.m holds. Since AppController.m hasn't explicitly instantiated MyTableController (MyTab

Re: Drawing focus rings

2011-06-18 Thread Tony Romano
You will need this as well. - (BOOL) resignFirstResponder { ... // Invalidate the area around the focus ring [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; ... } Tony Romano On 6/18/11 10:19 AM, "Lee Ann Rucker" wrote: >>From the sample code in ClockControl.m : > > // If w

Re: Retrieve NSTable DataSource from AppController

2011-06-18 Thread Quincey Morris
On Jun 18, 2011, at 10:43, Kevin Muldoon wrote: > I have an NSTable which receives its dataSource from MyTableController.m. > However, my AppController.m needs the data MyTableController.m holds. Since > AppController.m hasn't explicitly instantiated MyTableController > (MyTableController being

Re: Branch: Drawing noise in Cocoa (preferably fast)

2011-06-18 Thread Seth Willits
On Jun 17, 2011, at 7:29 PM, Ken Tozier wrote: > Keying off Stephen's idea of drawing noise quickly, I came up with a solution > that I can use for my own purposes. It seems like splitting up large image > manipulations for execution on different processor cores could be a good > introduction t

Re: Retrieve NSTable DataSource from AppController

2011-06-18 Thread Greg Guerin
Kevin Muldoon wrote: I have an NSTable which receives its dataSource from MyTableController.m. However, my AppController.m needs the data MyTableController.m holds. Since AppController.m hasn't explicitly instantiated MyTableController (MyTableController being an NSObject within IB with a

Re: Temporarily enabling layer backing for NSView

2011-06-18 Thread Indragie Karunaratne
Calling -display fixed the problem, works perfectly. Thanks! On 2011-06-18, at 9:25 AM, Houdah - ML Pierre Bernard wrote: > Try calling -display after -setWantsLayer: > > The view needs to be drawn once into the layer before being able to animate. > > Another way of achieving the desired result

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Matt Neuburg
On Jun 18, 2011, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > Date: Sat, 18 Jun 2011 10:09:13 -0700 > From: Kyle Sluder > Subject: Re: Release a NSWindowController after the window is closed > This general pattern will fail under ARC (yay, we can talk about that > now). Why are we

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Greg Guerin
Matt Neuburg wrote: Why are we able to do that? m. Because ARC is public knowledge: http://clang.llvm.org/docs/AutomaticReferenceCounting.html -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or m

Re: Tab Bar iPad App With Table View (Please help, been trying all day)

2011-06-18 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/17/11 6:11 PM, Julie Seif wrote: > Hi, > > I want to create a Tab Bar based iPad App. I would like it so that you tap > on one of the tab bar buttons and a Table View comes up in the view area for > that button as a Navigation Menu, you would tap

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Evadne Wu
For http://clang.llvm.org/docs/AutomaticReferenceCounting.html isn’t under any NDA. We should indeed be able to talk about that. :) -ev On Jun 19, 2011, at 03:27, Matt Neuburg wrote: > > On Jun 18, 2011, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > >> Date: Sat, 18 Jun 2011 10:09:

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Kyle Sluder
On Jun 18, 2011, at 12:27 PM, Matt Neuburg wrote: > > On Jun 18, 2011, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > >> Date: Sat, 18 Jun 2011 10:09:13 -0700 >> From: Kyle Sluder >> Subject: Re: Release a NSWindowController after the window is closed > >> This general pattern will f

Re: layoutSubviews doesn't always work (iOS 4.3 on iPad Simulator)

2011-06-18 Thread Brian Bruinewoud
Matt, Thanks for your response. Actually, that didn't work for me but it did lead me to find a solution. In my case, the scroll view's contentSize wasn't being updated correctly. To fix it I wrote the following (translated to your names) in layoutSubviews: sv.contentSize = v.bounds.size

Re: layoutSubviews doesn't always work (iOS 4.3 on iPad Simulator)

2011-06-18 Thread Matt Neuburg
On Jun 18, 2011, at 6:50 PM, Brian Bruinewoud wrote: > Actually, that didn't work for me but it did lead me to find a solution. Cool! > > In my case, the scroll view's contentSize wasn't being updated correctly. > To fix it I wrote the following (translated to your names) in layoutSubviews: >

Re: layoutSubviews doesn't always work (iOS 4.3 on iPad Simulator)

2011-06-18 Thread Brian Bruinewoud
Hi Matt, My code is based on Apple's sample "ZoomingPDFViewer" which actually replaces the content view after each zoom so that the contents can be drawn crisply rather than blurily scaled. So, this would be an issue in their code, then, but they only have pinching for rescaling, not zoom-to ge

Synthesised properties and additional actions

2011-06-18 Thread Graham Cox
If I synthesize a property, is it possible to also directly invoke some other code when that property is set (other than the usual KVO)? That is, I need to do something like: @synthesize foo; - (void)setFoo:(id) newFoo { self.foo = newFoo; [self doSomethingElseAsWe

Re: Synthesised properties and additional actions

2011-06-18 Thread Dave DeLong
The instance variable is synthesized as well and has the same name as the property, so you should use that: -(void)setFoo:(id)newFoo { if (foo != newFoo) { [foo release]; foo = [newFoo retain]; [self doSomethingElseAsWell]; } } Dave On Jun 18, 2011, at 10:12 PM, Graham Cox wrote

Re: Synthesised properties and additional actions

2011-06-18 Thread Kyle Sluder
On Sat, Jun 18, 2011 at 10:16 PM, Dave DeLong wrote: > The instance variable is synthesized as well and has the same name as the > property, so you should use that: > > -(void)setFoo:(id)newFoo { >  if (foo != newFoo) { >    [foo release]; >    foo = [newFoo retain]; >    [self doSomethingElseAsW

Re: Synthesised properties and additional actions

2011-06-18 Thread Graham Cox
Thanks, I understand. Seems to me if you are going to do this the advantages of @synthesize are virtually nil. --Graham On 19/06/2011, at 3:39 PM, Kyle Sluder wrote: > On Sat, Jun 18, 2011 at 10:16 PM, Dave DeLong wrote: >> The instance variable is synthesized as well and has the same name

Re: Synthesised properties and additional actions

2011-06-18 Thread Dave DeLong
For the most part, yes. You may keep it around if your property is readwrite and you don't want to write the setter yourself as well. :) Dave On Jun 18, 2011, at 10:43 PM, Graham Cox wrote: > Thanks, I understand. > > Seems to me if you are going to do this the advantages of @synthesize are