NSKeyedUnarchiver and memory management

2009-09-07 Thread DKJ
t a memory leak, and mentions NSKeyedUnarchiver. The "retain" message in the initWithCoder makes me wonder. Is this code leaking? Should I add an autorelease to the retain in initWithCoder? dkj ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: NSKeyedUnarchiver and memory management

2009-09-07 Thread DKJ
P.S. Doing the autorelease thing gave me an EXC_BAD_ACCESS too. And theData is released in the dealloc method of MyObject. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Circular references

2009-09-13 Thread DKJ
s situation? I know this must be a very basic question, but I don't even know what terms I should google to find out about it. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comment

Re: Circular references

2009-09-14 Thread DKJ
For the archives: Joar's suggestion did the trick. Now it's all working just the way I want. Thanks to all those who thought about it. dkj On 2009-09-13, at 15:08 , Joar Wingfors wrote: Foo.h == @class Bar; // <- Forward declaration of the Bar class @interface F

Resizing UIView

2009-09-23 Thread DKJ
, but I'd like to find an easier way if there is one. At the least, I need to learn more about how these resizing properties are supposed to work. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: reading (parsing) CSV (or Excel) data

2009-10-02 Thread DKJ
I've just been using NSXMLParser for the first time. Can Excel files be saved in XML format? If so, would NSXMLParser be a possible solution here? dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reques

Clickable URLs in a UITextView

2009-10-04 Thread DKJ
e scenes here. Is the string actually being displayed as a subview of the text view? dkj ___ 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

NSURLRequest

2009-10-10 Thread DKJ
ich has been working just fine so far. But now I'm reading through the "URL Loading System" docs, and wondering if I should be using all the NSURLRequest stuff instead. It's more complicated, so are there any advantages it wou

arrayWithContentsOfFile

2009-10-13 Thread DKJ
I'm using this code to read an array from a plist: NSArray *data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:@"/Documents/file.plist"]]; The docs say this method returns nil when the file doesn't exist (precisely: "Returns nil if the file can’t be op

Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ
27;s worth checking. I looked in the directory itself before running the code, and the plist files weren't there at all. If someone else gets the same result, perhaps they could file a bug: I lack sufficient self-esteem to file on

Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ
On 2009-10-13, at 12:12 , I. Savant wrote: Let me see if I understand what you're saying: You are expecting there to be *no* PLIST files (and so, you expect to get nil) but are getting an empty array? Bingo. ___ Cocoa-dev mailing list (Cocoa-de

Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ
-- So it looks like arrayWithContentsOfFile: is returning an empty array when file.plist doesn't exist. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ
Hmm... I ran a similar code snippet in another project, and nil is returned, as the docs say. So the file must be created somewhere else. I'll find out where. I'm glad the docs aren't wrong. dkj ___ Cocoa-dev mailing

Re: arrayWithContentsOfFile

2009-10-13 Thread DKJ
in it, and couldn't reproduce the result either: nil was returned, just as the docs say it should be. So my self-esteem takes another hit; but that's better than losing faith in scripture. dkj ___ Cocoa-dev mailing list (Cocoa-dev@

UIButton label

2009-10-27 Thread DKJ
Appear: method, so I know it's being called. Why won't this work? dkj ___ 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-

Re: UIButton label

2009-10-27 Thread DKJ
I'm doing this instead: [self.updateButton setTitle:dateDisplay forState:UIControlStateNormal]; and it works. But I'd still like to know why the other code didn't. dkj On 2009-10-27, at 12:43 , DKJ wrote: I'm having a ridiculous amount of trouble changing the

Showing activity indicator during data download

2009-10-29 Thread DKJ
indicator visible during the download. Can someone point me towards a simple solution? dkj PS: I've started reading the "Concurrency Programming Guide", but that's going to take awhile. And for all I know at present, th

Re: Showing activity indicator during data download

2009-10-29 Thread DKJ
On 2009-10-29, at 0:30 , DKJ wrote: - (IBAction)updateButton:(id)sender { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [downloadIndicator startAnimating]; [[DataManager sharedDataManager] updateDataFiles]; [downloadIndicator stopAnimating

Re: Showing activity indicator during data download

2009-10-29 Thread DKJ
On 2009-10-29, at 7:05 , Alastair Houghton wrote: You need to rewrite your code so that the download is asynchronous. Would doing the NSOperationQueue thing with my updateDataFiles method be OK? The docs (Appendix A of "Threading Programming Guide") lists NSString as being thread-safe. ___

Re: Showing activity indicator during data download

2009-10-29 Thread DKJ
hold off the parsing until the flag is set. So how to start the parsing? The following seems rather amateurish: while( !downloadFinished ) [self amuseTheUser]; [self startParsing]; I suspect there's a better way. dkj ___ Cocoa-de

Asynchronous downloading again

2009-10-31 Thread DKJ
read's point of view, file2 is being downloaded asynchronously too. Am I on the right track here? If so, it sure would simplify downloading all those files. dkj P.S. It's time for my semi-anual global "Thank You" to all those list members who've responded to my queri

Re: Asynchronous downloading again

2009-10-31 Thread DKJ
All of the files have to be downloaded before the app can do anything. I get the connectionDidFinishLoading delegate method of my one and only NSURLConnection to call a downloadFinished method at the end of the synchronous downloads, so the app knows everything is in place and can start pro

Re: Asynchronous downloading again

2009-10-31 Thread DKJ
than 5 seconds, even with a completely synchronous download. dkj On 2009-10-31, at 19:01 , Kyle Sluder wrote: On Sat, Oct 31, 2009 at 6:50 PM, DKJ wrote: I was worried that having a download connection for each file would make it more complicated for the app to know when they were all fin

Re: Asynchronous downloading again

2009-10-31 Thread DKJ
On 2009-10-31, at 19:22 , Roland King wrote: You can trivially use one delegate to manage both these downloads, have them happen at the same time and only call downloadFinished when both of them have finished, or if you have more than 2, all 3, or 4 or 127 of them. What would be the best

Re: Asynchronous downloading again

2009-10-31 Thread DKJ
On 2009-10-31, at 19:34 , Roland King wrote: . And why are you now talking about 4 NSURLConnections when you say you have 2 files? The 2-file example was a simplified case I posted when I was asking whether the method would work. I actually have half-a-dozen or so data files to download.

Replacing chars in UITextField

2009-06-25 Thread DKJ
e method. But I don't see how to get it to do what I want. Any ideas? dkj ___ 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)lis

Substituting characters in a UITextField

2009-06-25 Thread DKJ
egate method. But I don't see how to get it to do what I want. Any ideas? dkj ___ 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-a

Re: Substituting characters in a UITextField

2009-06-26 Thread DKJ
sitioning the cursor in a UITextField? Perhaps by manipulating a UITouch object? dkj ___ 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

Re: Substituting characters in a UITextField

2009-06-26 Thread DKJ
This may be the solution: a UITextView instead of UITextField, with this in the delegate: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if( [text isEqualToString:@"C"] ) { NSString *newString = [textView.te

UITextView symbols

2009-06-27 Thread DKJ
t do it. And I can't seem to find any docs that list these codes. dkj ___ 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(a

Re: UITextView symbols

2009-06-27 Thread DKJ
On 27-Jun-09, at 16:26 , DKJ wrote: I'm using this method: textView:shouldChangeTextInRange:replacementText: to let users put special symbols into a UITextView. I detect the Return key by checking whether the input string is equal to @"\n". But how would I detect the back-d

Re: UITextView symbols

2009-06-28 Thread DKJ
Event doesn't have any info about keypresses. I hope I'm missing something. dkj ___ 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 coco

Docs warning unclear

2009-06-28 Thread DKJ
y"? How would one be added "indirectly"? dkj ___ 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

Yet another memory management question

2009-07-04 Thread DKJ
Is this the right way to do it? - (void)viewDidLoad { id myObject = [[NSObject alloc] init]; } - (void)viewDidUnload { [myObject release]; myObject = nil; } - (void)dealloc { [myObject release]; } ___ Cocoa-dev mailing list (Cocoa-dev@lis

Re: Yet another memory management question

2009-07-04 Thread DKJ
is still a Cocoa question.) In the template code for viewDidLoad, it provides [super viewDidLoad]. But there is no corresponding [super viewDidUnload] in the template code for viewDidUnload. Should it be there anyway? dkj ___ Cocoa-dev mailing l

Re: Yet another memory management question

2009-07-04 Thread DKJ
tions; but they will probably prevent a lot more questions later on. dkj ___ 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-admi

Re: Yet another memory management question

2009-07-05 Thread DKJ
. Then whenever I want to do something with the variable, I do things like this: NSInteger otherVar = [self.count integerValue]; self.count = [NSNumber numberWithInteger:0]; Have I finally got it right? dkj ___ Cocoa-dev mailing list (Coc

Convenience initialisers

2009-07-05 Thread DKJ
t haven't found one yet. dkj ___ 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 you

NSApplication and UIApplication

2009-07-06 Thread DKJ
regardless; however, I'm very wary of using it if neither the compiler nor the docs mention it. What should I do with UIApplication in these circumstances? (exit(0) seems a bit extreme.) dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: NSApplication and UIApplication

2009-07-06 Thread DKJ
In this specific instance, I'm getting an intermittent infinite loop in the simulator that I can't seem to reproduce. Definitely a design flaw. So the termination was to be for debuggering purposes only. dkj ___ Cocoa-dev mailing list (Cocoa

Re: NSApplication and UIApplication

2009-07-06 Thread DKJ
On 6-Jul-09, at 11:48 , DKJ wrote: I'm getting an intermittent infinite loop in the simulator that I can't seem to reproduce. Both on the simulator and the device, the problem unfolds like this: The app goes into its loop and begins filling up all available memory with somethin

Re: NSApplication and UIApplication

2009-07-06 Thread DKJ
On 6-Jul-09, at 13:35 , David Duncan wrote: Are you building with the 2.2.1 SDK and running on the iPhone OS 3 simulator? Perhaps the other way around? Either way, it is not a supported configuration (the simulator OS must always match the SDK used). No, I'm using the 3.0 SDK. __

Re: NSApplication and UIApplication

2009-07-06 Thread DKJ
he Base SDK setting in the Architectures window of the project info panel, a second Architectures section opens beneath it. (I guess this should really now go to the Xcode list.) dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Cocoa developers in Victoria BC

2009-07-09 Thread DKJ
If you're in Victoria BC or its environs, and would like to join an informal group of fellow sufferers, please contact me off-list. (iPhone OS developers are also welcome, of course.) dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Initialising NSMutableArray

2009-07-13 Thread DKJ
ddObject:[[[myClass alloc] init] autorelease]]; } return self; } But this produces an NSInvalidArgumentException, with the message: [NSMutableArray addObject:]: method only defined for abstract class. I suspect I'm missing something simp

Saving NSArray of custom objects

2009-07-13 Thread DKJ
g is saved: didIt = 0. I must be missing a step somewhere. I've been looking at "Archives and Serializations Programming Guide for Cocoa", and finding it rather bewildering. A nudge in the right direction would be much appreciated. dkj __

Re: Saving NSArray of custom objects

2009-07-14 Thread DKJ
NSKeyedArchiver is now doing exactly what I wanted to get done. dkj ___ 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

Where to release in UIView

2009-07-18 Thread DKJ
I've got a UIView object that uses an NSDictionary. The UIView is instantiated from a nib, so I initialise the dictionary in awakeFromNib, since the initWithFrame: method is never called. Is it appropriate to release this dictionary in the UIView dealloc method?

Re: Where to release in UIView

2009-07-18 Thread DKJ
As NSValues, using valueWithPointer:? dkj ___ 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 you

Re: Where to release in UIView

2009-07-18 Thread DKJ
does store the CGMutablePathRefs quite nicely, although the compiler complains about it. dkj ___ 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 coco

Re: Where to release in UIView

2009-07-18 Thread DKJ
ithout its previous instantiation being released. But I'd sleep better having an expert opinion. dkj On 18-Jul-09, at 7:59 , DKJ wrote: I've got a UIView object that uses an NSDictionary. The UIView is instantiated from a nib, so I initialise the dictionary in awakeFromNib, sin

Spacing buttons in UIToolbar

2009-07-28 Thread DKJ
s for some blank buttons and insert them into the toolbar items array? dkj ___ 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-admi

UINavigationBar delegate problem

2009-08-04 Thread DKJ
ing pressed? If so, how do I restore the previous view? If not, how should I do it? dkj ___ 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-a

UITableView updating problem

2009-08-12 Thread DKJ
;t call reloadData in the tableview controller's commitEditingStyle or moveRowAtIndexPath methods. (I tried doing it anyway, and got into trouble.) Is there any way I can get the table to update as soon as the user presses the Done button? Or even better, as soon as the row deletion

Sound files needed

2009-08-23 Thread DKJ
I've managed to create files with properties (1) and (2), but I'm stuck at (3). I've downloaded the Audacity application, but the best I can get from it seems to be 12,000 Hertz. Other programmes I've tried (demo versions mostly) won't let me set an absolute frequency. A

Beep

2009-08-26 Thread DKJ
equency. But as far as I can tell, any sound that I want to produce has to use an audio file of some sort. Have I missed something simple? If so, please point me to the right place in the docs. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

NSView puzzle

2008-10-09 Thread DKJ
I'm having trouble with a subclass of NSView. In the code below, the variable str is an NSString set to a constant string when the view is initialised. During initialisation the NSPoint variable click is set to 0,0. When the view first displays, str is drawn correctly in the lower-left co

Re: NSView puzzle

2008-10-09 Thread DKJ
On 9 Oct, 2008, at 13:27, Andy Lee wrote: Are you retaining str when the view is initialized? No, since it was set as: str = @"x"; But your question made the penny drop: it was dict that needed retaining. All works well

NSNull and @""

2008-10-10 Thread DKJ
I've made an NSDictionary where the values are strings. Is there a difference between setting a value as [NSNull null] and setting it as @""? (I've been using the former.) dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

Read-only properties

2008-10-12 Thread DKJ
I'd like to have something like this in my class: @property(readonly) *NSArray myArray; But I don't want any of the individual objects in the array to be modified, so I'd like to return a copy of the array. Is there a way of getting @synthesise to ensure this? Or do I need to write m

Re: Read-only properties

2008-10-12 Thread DKJ
oops... of course that should have been: @property(readonly) NSArray *myArray; ___ 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-ad

Re: Read-only properties

2008-10-12 Thread DKJ
On 12 Oct, 2008, at 08:56, Roland King wrote: If however you don't want the caller to modify the properties of the objects *in* the array, then unless those objects are immutable, returning a copy of the array won't help you anyway. Remember an array of objects is just an array of pointers t

NSView subclass

2008-10-15 Thread DKJ
Clicked: method found" compiler warning. But is it the best way to do it? dkj ___ 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-admin

Re: NSView subclass

2008-10-15 Thread DKJ
t could be causing this? Has it something to do with code completion? dkj ___ 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

Views, frames, and bounds

2008-10-18 Thread DKJ
ldn't get both to display. So I'm still at a loss. Can someone point me towards other documentation that might get through the fog? dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Views, frames, and bounds

2008-10-19 Thread DKJ
t where I expected it. But when I replace "bounds" with "frame", I get nothing. That's the first puzzle. Maybe if I can understand what's happening here, the other puzzles will be resolved too! dkj On 18 Oct, 2008, at 22:06, Jamie Hardt wrote: Do make

Re: Views, frames, and bounds

2008-10-19 Thread DKJ
The penny has finally dropped. Thanks to all for your help. dkj ___ 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

Mutable arrays

2008-10-19 Thread DKJ
Since mutable arrays and dictionaries expand as required when new objects are added, when should one use -initWithCapacity: methods? dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

lockFocus error

2008-10-20 Thread DKJ
I have a custom view in a window, set as an instance of MyView, and connected to my controller as an IBOutlet theView. When I do this in the controller's awakeFromNib method: [theView lockFocus]; I get this error: *** Assertion failure in -[MyView lockFocus], /SourceCache/AppKit/ A

Re: lockFocus error

2008-10-20 Thread DKJ
On 20 Oct, 2008, at 08:59, Nick Zitzmann wrote: Out of curiosity, why are you locking focus on a view in - awakeFromNib? I'm just practising with views and animations. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: lockFocus error

2008-10-20 Thread DKJ
On 20 Oct, 2008, at 09:15, Nick Zitzmann wrote: you do all your drawing in -drawRect:, and call -setNeedsDisplay: & friends when you need to refresh part of the view. Is this a good way of going about it? I subclassed NSView and defined the properties border_colour, fill_colour, and pic. The

Re: lockFocus error

2008-10-20 Thread DKJ
On 20 Oct, 2008, at 16:32, Graham Cox wrote: What would you expect it to do? Suppose I wanted it to draw lines in response to user input. Would I put NSBezierPath methods in drawRect: and expose the relevant properties in the subclass? ___ Coc

Putting an image on a CALayer

2008-10-21 Thread DKJ
I'd like to put an image stored in a JPEG file onto a CALayer. It seems that I do this by assigning a CGImageRef to its contents property. But how do I get a CGImageRef from a file? Do I make an NSData object from the file and do something with that?

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
On 21 Oct, 2008, at 08:51, Alex Heinz wrote: then draw the NSImage to the CALayer This is the bit I'm not sure how to do. I see a CALayer contents property, but I can't assign an NSImage to that. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
OK, I tried this: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(source); theView.layer.contents = image; an

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
Me again. I've been using this code: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(source); theView.layer.co

CALayer graphics context

2008-10-22 Thread DKJ
Is there a quick way to get a CGContextRef for a CALayer? I don't see anything obvious in the documentation for the CALayer class. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator commen

Yet another CALayer puzzle

2008-10-22 Thread DKJ
I've got myView and myController objects in my nib file. myView is an IBOutlet of myController. I put this in the initWithFrame: method of myView: CALayer *rootLayer = [CALayer layer]; [self setLayer:rootLayer]; [self setWantsLayer:YES]; But when I read myView's wants

Re: Yet another CALayer puzzle

2008-10-22 Thread DKJ
That did the trick! Thanks. ___ 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 Subscr

CGPoint wrapper?

2008-10-22 Thread DKJ
Is there some straightforward way of wrapping a CGPoint so I can put it in an NSArray? I don't want to use a C array because I want to have fast enumeration available. Or should I just write a simple NSPoint - CGPoint conversion method?

Re: CGPoint wrapper?

2008-10-22 Thread DKJ
I've just found NSPointFromCGPoint() etc,. On 22 Oct, 2008, at 18:49, DKJ wrote: Is there some straightforward way of wrapping a CGPoint so I can put it in an NSArray? I don't want to use a C array because I want to have fast enumeration available. Or should I just writ

Re: CGPoint wrapper?

2008-10-23 Thread DKJ
On 23 Oct, 2008, at 11:26, Finlay Dobbie wrote: I'm surprised nobody else has picked up on this - how is enumerating an NSArray going to be faster than enumerating a C array? I was referring to this: for( TheClass *obj in TheArray ) {} as fast enumeration.

Rotation in CAAnimation layers

2008-10-24 Thread DKJ
Is there an easy way to provide a realistic shadow for a (non- circular) layer rotating round the z-axis? (I know layer.rotateShadow = YES is too much to hope for.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Re: Rotation in CAAnimation layers

2008-10-25 Thread DKJ
mean one that I can just copy from somewhere.) If not I'll try to figure it out myself; but I don't want to re-invent the wheel. dkj On 24 Oct, 2008, at 18:11, douglas welton wrote: On Oct 24, 2008, at 6:50 PM, DKJ wrote: Is there an easy way to provide a realistic shadow fo

Leaking CGColor objects

2008-10-26 Thread DKJ
il when doing this? 3. Are sublayers retained when added to a superlayer? I'm assuming so, since they're kept in an array. But then they should be released by removeFromSuperView, so that shouldn't cause a leak. dkj ___ Coco

Re: Leaking CGColor objects

2008-10-26 Thread DKJ
Misprint in my last message: [[MyCALayer alloc] init]; should be: id mylayer = [[MyCALayer alloc] init]; ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Co

Re: Leaking CGColor objects

2008-10-26 Thread DKJ
Thanks to everyone for the replies. I have one (hopefully last) question (on this topic): On 26 Oct, 2008, at 09:23, Clark Cox wrote: As long as MyCALayer's dealloc is properly implemented (to release foregroundColor, or set it to nil), you should never need to explicitly do so in code that us

Re: Leaking CGColor objects

2008-10-26 Thread DKJ
On 26 Oct, 2008, at 12:09, Clark S. Cox III wrote: You must do both, otherwise you will leak. I understand why I have to release the temp object, but why does it leak if I don't set foregroundColor to nil as well? ___ Cocoa-dev mailing list (Coco

Re: Leaking CGColor objects

2008-10-26 Thread DKJ
I'm still puzzled. When I put this: self.foregroundColor = nil; in my layer's dealloc method, I get this error: attempting to modify layer that is being finalized But if I don't put that line in dealloc, Instruments doesn't detect any leaks. In the documentation, the foregr

Subview display problem

2008-10-28 Thread DKJ
briefly in the main view. theView does have animation layers. Would this make a difference? dkj ___ 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

Re: Subview display problem

2008-10-28 Thread DKJ
On 28 Oct, 2008, at 06:54, I. Savant wrote: On Tue, Oct 28, 2008 at 9:23 AM, DKJ <[EMAIL PROTECTED]> wrote: I'm having no luck getting a subview to display. In the awakeFromNib of the controller I have this: helpView = [[MyView alloc] init]; NSView's designate

Re: Subview display problem

2008-10-28 Thread DKJ
On 28 Oct, 2008, at 07:49, I. Savant wrote: logging the view's frame each time it's drawn This produces a strange result. The width of the subview's frame increases by stages to that of the superview, but its height stays constant at 14.0. All with nothing happening on the screen. __

Re: Subview display problem

2008-10-28 Thread DKJ
On 28 Oct, 2008, at 08:14, I. Savant wrote: Do away with the animation logic for now. See if it behaves as expected by setting the frames directly (without calls to the view's -animator). The subview appears for an instant, with its origin is in the centre of the superview, filling the upper-

Re: Subview display problem

2008-10-28 Thread DKJ
On 28 Oct, 2008, at 08:31, I. Savant wrote: I'd turn off all layers and make sure it's working normally without them. Alas, after having the Help button method hide theView's CALayer, there's still no sign of my NSTextView subclass. Maybe I should just make my help info into a PDF file, a

Re: Subview display problem

2008-10-28 Thread DKJ
On 28 Oct, 2008, at 08:55, DKJ wrote: Maybe I should just make my help info into a PDF file, and display that on a CATextLayer. Oops, it's the contents property of a CALayer I was thinking of here. ___ Cocoa-dev mailing list (Coco

Sage advice

2008-10-28 Thread DKJ
When I was but a newbie, I heard a wise man say, "When using CALayers, Put NSViews away." Yet I set a CALayer, Then added NSView; Now many hours later, I wail, "T'is true, t'is true!" ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do no

CALayer properties

2008-10-28 Thread DKJ
When I did this: myLayer.frame.size.width = rootLayer.frame.size.width; I got an "illegal lvalue" error. But when I do this: CGRect r = help.frame; r.size.width = rootLayer.frame.size.width; the compiler says nothing. Why can I use layer.frame.size on the right of =,

Re: CALayer properties

2008-10-28 Thread DKJ
It just clicked... no need for replies! On 28 Oct, 2008, at 16:44, DKJ wrote: When I did this: myLayer.frame.size.width = rootLayer.frame.size.width; I got an "illegal lvalue" error. But when I do this: CGRect r = help.frame; r.

Type comparison warning

2008-10-30 Thread DKJ
I'm probably missing something simple, but I don't understand why this line: return (i == -1 ? [NSNull null] : [NSNumber numberWithInteger:i]); (where i is an NSInteger) produces this warning: "comparison of distinct Objective-C types lacks a cast" (The return type of the met

List members in Victoria BC

2008-10-30 Thread DKJ
Are there any other members of this list who live in Victoria, BC? If so, and you'd be interested in starting some kind of informal group, please contact me off-list. dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

  1   2   >