subclass overwriting superclass ivar

2010-05-26 Thread jonat...@mugginsoft.com
A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. Moving tempFilePath up the ivar list resolves the problem (though doubtless creates another). Moving ivar stderrData into the superclass

OutlineView Wierdness - 'item' not being stored.

2010-05-26 Thread Pascal Harris
I'm trying to populate an OutlineView. I've had success in the past but now, apparently, I'm unable to do it! Looking at this code: - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { if (item == nil) { [mailListDict writeToFile:@/test.plist

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 13:40, jonat...@mugginsoft.com a écrit : A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. If I am not mistaken, if your superclass ivar is private (!= protected), it

Re: subclass overwriting superclass ivar

2010-05-26 Thread Graham Cox
On 26/05/2010, at 10:13 PM, vincent habchi wrote: If I am not mistaken, if your superclass ivar is private (!= protected), it cannot be accessed from its subclasses. Thus, the compiler can choose to reuse part of the heap dedicated to private variables to implement subclasses own private

Re: rendering PDF on iPad's

2010-05-26 Thread Gustavo Pizano
Hello all. Another question still regarding with pdf's. when I load a pdf into a web view, I can tap for a while and the magnification loop will appear, this doesn't happens when using Quartz.. I was reading some post on internet, and the authors create their own magnification view. Is there

Re: OutlineView Wierdness - 'item' not being stored.

2010-05-26 Thread Graham Cox
On 26/05/2010, at 10:12 PM, Pascal Harris wrote: - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { if ([[[tableColumn headerCell] stringValue] compare:@Key] == NSOrderedSame) { I'm not sure what the problem is,

Re: subclass overwriting superclass ivar

2010-05-26 Thread Sherm Pendley
On Wed, May 26, 2010 at 8:13 AM, vincent habchi vi...@macports.org wrote: Le 26 mai 2010 à 13:40, jonat...@mugginsoft.com a écrit : A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. If

Re: rendering PDF on iPad's

2010-05-26 Thread Gustavo Pizano
Oh sorry, I should have read before posting the question again, I see somebody its talking abour PDFSelection, and I say an example in the developer site. So for the selection I will check that. Now I have only the question about the loupe :S thanks for any help G. On 26.5.2010, at

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 14:22, Graham Cox a écrit : I'm pretty sure you are mistaken. If this were even remotely true, object programming would be impossible. @private only declares the visibility of an ivar to its subclasses, it does not give the compiler carte blanche to write over anything it

Re: subclass overwriting superclass ivar

2010-05-26 Thread jonat...@mugginsoft.com
There's nothing wrong with the ivar declarations - something must be going wrong at run time. Typically, when an object pointer seems to point to the wrong object, the prime suspect is memory management. But it's hard to say for sure, without seeing the relevant code. The ivar decs look

Re: subclass overwriting superclass ivar

2010-05-26 Thread Graham Cox
On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No. It's not legal syntax for accessing an ivar in any case - square brackets invoke a method:- [instance

Re: subclass overwriting superclass ivar

2010-05-26 Thread Joanna Carter
Hi Jonathan A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. I'm not sure what you mean here by overwrite. @interface Base : NSObject { @private int i; } @end @interface Sub :

Re: subclass overwriting superclass ivar

2010-05-26 Thread Uli Kusterer
On May 26, 2010, at 1:40 PM, jonat...@mugginsoft.com wrote: A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. Are you using this class across module boundaries? E.g. is the base class in

Re: subclass overwriting superclass ivar

2010-05-26 Thread Roland King
@interface A(MyCategory) -(void)someMethodWhichLegallyAccessesThePrivateVariablePriv; @end That's legal, I can write a category against an already-compiled class without having the source and without recompiling it and I can access any of the private variables of that class. So no the

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 14:53, Graham Cox a écrit : On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No. It's not legal syntax for accessing an ivar in any

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 14:53, Graham Cox a écrit : On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No. It's not legal syntax for accessing an ivar in any

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 15:00, Roland King a écrit : @interface A(MyCategory) -(void)someMethodWhichLegallyAccessesThePrivateVariablePriv; @end That's legal, I can write a category against an already-compiled class without having the source and without recompiling it and I can access any of

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 15:10, vincent habchi a écrit : Le 26 mai 2010 à 14:53, Graham Cox a écrit : On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No.

Re: subclass overwriting superclass ivar

2010-05-26 Thread Graham Cox
On 26/05/2010, at 11:10 PM, vincent habchi wrote: So, tell me if I'm wrong, but I infer from your answer that whatever I can do, there is no means for a subclass A' to access any private variable of its ancestor. Correct, if class A has not declared an accessor to it, and you haven't added

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Le 26 mai 2010 à 15:24, Jean-Daniel Dupas a écrit : Who knows what a class does when you set an ivar using the accessor. It would badly break encapsulation principle. For example, what would append if a NSView subclass change the view frame by accessing the _frame ivar directly ? You are

Question about predicates and list properties.

2010-05-26 Thread Graham Cox
I have a property 'categories' of an object that returns a list (an array) of objects, which in turn have a property 'name'. Can I set up a NSPredicate that can match a string against any name in this list? How? In IB I set the left hand side to 'categories.name' but I get the error that

Re: subclass overwriting superclass ivar

2010-05-26 Thread Kyle Sluder
On May 26, 2010, at 6:00 AM, Roland King r...@rols.org wrote: @interface A(MyCategory) -(void)someMethodWhichLegallyAccessesThePrivateVariablePriv; @end That's legal, I can write a category against an already-compiled class without having the source and without recompiling it and I can

Re: Question about predicates and list properties.

2010-05-26 Thread Keary Suska
On May 26, 2010, at 7:39 AM, Graham Cox wrote: I have a property 'categories' of an object that returns a list (an array) of objects, which in turn have a property 'name'. Can I set up a NSPredicate that can match a string against any name in this list? How? In IB I set the left hand

Re: Question about predicates and list properties.

2010-05-26 Thread Graham Cox
On 27/05/2010, at 12:35 AM, Keary Suska wrote: Not enough info: are you using Core Data, or a simple modeled relationship? I assume the issue is about traversing a relationship--otherwise the solution is trivial... No, it's a simple 'to many' property in my own model, not using Core Data.

Re: IKImageView Question

2010-05-26 Thread Brian Postow
On May 26, 2010, at 12:29 AM, Scott Anguish wrote: Another solution for conversion is using -CGImage on NSBitmapImageRep. Yeah, IIRC, the problem with that strategy is that it requires a lot of mucking around with color representations... Brian Postow Senior Software Engineer Acordex

Re: Question about predicates and list properties.

2010-05-26 Thread Keary Suska
On May 26, 2010, at 8:42 AM, Graham Cox wrote: On 27/05/2010, at 12:35 AM, Keary Suska wrote: Not enough info: are you using Core Data, or a simple modeled relationship? I assume the issue is about traversing a relationship--otherwise the solution is trivial... No, it's a simple

Re: subclass overwriting superclass ivar

2010-05-26 Thread jonat...@mugginsoft.com
On 26 May 2010, at 13:55, Uli Kusterer wrote: On May 26, 2010, at 1:40 PM, jonat...@mugginsoft.com wrote: A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. Are you using this class

Re: OutlineView Wierdness - 'item' not being stored.

2010-05-26 Thread Pascal Harris
Thanks for this - I've done as you suggested and it works fine. Serves me right for attempting to learn from examples on the web ;) On Wed, May 26, 2010 at 1:27 PM, Graham Cox graham@bigpond.com wrote: On 26/05/2010, at 10:12 PM, Pascal Harris wrote: - (id)outlineView:(NSOutlineView

Re: iPad animations are backwards for some orintations.

2010-05-26 Thread David Duncan
On May 25, 2010, at 10:50 PM, Scott Andrew wrote: So i have an app that I want to use the curl up UIView animation transition in. however when the iPad his held in either the upside down portrait or upside down landscape (button on right) the transitions are backwards. All controls on the

Re: subclass overwriting superclass ivar

2010-05-26 Thread Sean McBride
On Wed, 26 May 2010 08:28:17 -0400, Sherm Pendley said: Typically, when an object pointer seems to point to the wrong object, the prime suspect is memory management. Agreed. Jonathan, have you tried guard malloc and AUTO_USE_GUARDS? --

Re: subclass overwriting superclass ivar

2010-05-26 Thread Sean McBride
On Wed, 26 May 2010 13:54:17 +0100, Joanna Carter said: A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. I'm not sure what you mean here by overwrite. @interface Base : NSObject {

NSTextFieldCell + Transparent NSTableView = Black Field editor

2010-05-26 Thread Markus Spoettl
Hello, I have a transparent NSTableView embedded in a scroll view that doesn't draw its background which displays a bunch of NSTextFieldCell columns. Everything is fine, the container view's background is visible through the table. Until I edit a text field in the table: The field editor

Re: subclass overwriting superclass ivar

2010-05-26 Thread Greg Guerin
Jonathan Mitchell wrote: MGSScriptExecutorManager *scriptExecutorManager; NSString *tempFilePath; } @interface MGS_B : MGS_A { @private NSData *stderrData; } Change the ivars to something like this: MGSScriptExecutorManager *scriptExecutorManager;

Cannot change IKImageBrowserView group title text color?

2010-05-26 Thread Steve Christensen
I have a IKImageBrowserView using disclosure-style groups. I'm setting a dark background and have changed the item title attributes to use a light color so the titles are visible. That all works great. The problem is that I haven't been able to find a property key for changing the group

Re: Question about predicates and list properties.

2010-05-26 Thread Frédéric Testuz
Le 26 mai 2010 à 16:42, Graham Cox a écrit : On 27/05/2010, at 12:35 AM, Keary Suska wrote: Not enough info: are you using Core Data, or a simple modeled relationship? I assume the issue is about traversing a relationship--otherwise the solution is trivial... No, it's a simple 'to

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jens Alfke
On May 26, 2010, at 6:10 AM, vincent habchi wrote: So, tell me if I'm wrong, but I infer from your answer that whatever I can do, there is no means for a subclass A' to access any private variable of its ancestor. Not without some nasty tricks (this is native code, so nasty tricks are

Re: subclass overwriting superclass ivar

2010-05-26 Thread Joanna Carter
Hi Sean I think you are confusing some similar-sounding words: override and overwrite (and there's also overload). By overwrite, he means the memory occupied by one ivar is being unexpectedly written to when writing to a different ivar. Yes, I gathered that as the discussion evolved.

Re: Question about predicates and list properties.

2010-05-26 Thread Dave DeLong
Having done a *lot* with NSPredicateEditorRowTemplates and NSPredicateEditors recently, I can confidently say that subclassing NSPredicateEditorRowTemplate is almost always the easiest way to work with row templates. Trying to configure them in Interface Builder is a pain in the proverbial

initializing a pdfview

2010-05-26 Thread Matthew Weinstein
I think I'm on the verge of success with my attempt to create a selection rectangle (that doesn't select text) for pdfview, but I'm unclear what init routines I should use in my pdfview subclass. - (id)initWithFrame:(NSRect)frameRect doesn't seem to get called--as it does in nsview. Matthew

Re: Creating a PDFSelection...

2010-05-26 Thread John Calhoun
On May 25, 2010, at 9:37 PM, Matthew Weinstein wrote: Actually, I don't need the tiff; I just need the rectangle! People have to be able to sketch the rectangle over the pdf, and then my program stores and restores those rectangles (with some additional information). PDFSelection has a

Re: initializing a pdfview

2010-05-26 Thread John Calhoun
On May 26, 2010, at 11:38 AM, Matthew Weinstein wrote: I think I'm on the verge of success with my attempt to create a selection rectangle (that doesn't select text) for pdfview, but I'm unclear what init routines I should use in my pdfview subclass. - (id)initWithFrame:(NSRect)frameRect

Re: Cannot change IKImageBrowserView group title text color?

2010-05-26 Thread Steve Christensen
Thanks, Thomas. I should've mentioned that I have to support 10.5, so it looks like I'll have to figure out what to do for that case. steve On May 26, 2010, at 10:26 AM, Thomas Goossens wrote: Hi Steve, On SnowLeopard you can change the appearance of the group headers with [imageBrowser

Re: subclass overwriting superclass ivar

2010-05-26 Thread Greg Parker
On May 26, 2010, at 4:40 AM, jonat...@mugginsoft.com wrote: A subclass ivar is apparently overwriting a super class ivar. When an instance of MGS_B sets stderrData the super class ivar tempFilePath gets overwritten. Moving tempFilePath up the ivar list resolves the problem (though

Question about popover being dismissed clicking outside it

2010-05-26 Thread Eric E. Dolecki
I have a UITabBar and a button in it. I am calling up a popover on the button, but I want to make sure I only ever have one. And when the iPad is rotated, remove the popover (I don't want it up anymore at that point). How do I detect an event where the popover is dismissed by clicking outside the

Re: subclass overwriting superclass ivar

2010-05-26 Thread vincent habchi
Jens, I think you’re confusing an inaccessible variable with an unused variable. Those are very different concepts. For example, NSView’s _frame instance variable is inaccessible from any subclass, but the variable is of course a crucial part of the view’s state and is accessed by lots of

Re: Question about popover being dismissed clicking outside it

2010-05-26 Thread Eric E. Dolecki
Sorry - I just needed to remove that check for nil and do this: [self.popoverController dismissPopoverAnimated:NO]; self.popoverController = nil; ... then create On Wed, May 26, 2010 at 3:03 PM, Eric E. Dolecki edole...@gmail.com wrote: I have a UITabBar and a button in it. I am calling up a

Re: NSTextFieldCell + Transparent NSTableView = Black Field editor

2010-05-26 Thread Corbin Dunn
On May 26, 2010, at 9:23 AM, Markus Spoettl wrote: Hello, I have a transparent NSTableView embedded in a scroll view that doesn't draw its background which displays a bunch of NSTextFieldCell columns. Everything is fine, the container view's background is visible through the table.

Re: Cocoa-dev Digest, Vol 7, Issue 585

2010-05-26 Thread Matthew Weinstein
Aparently not. I did implement initWithCoder; it doesn't get called. Other suggestions? PS. I am using a nib. On May 26, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: ay 26, 2010, at 11:38 AM, Matthew Weinstein wrote: I think I'm on the verge of success with my attempt to create

PDFKit cpSelections?

2010-05-26 Thread Matthew Weinstein
Dear programmers, So, I used the crop marker code that apple provides to experiment in creating a selecting rectangle. I first subclassed NsView as MWSelectingView, and everything worked like clock work. I was even able to modify the CropMarker object (MWViewSelectionMarker) so that when the

Re: NSTextFieldCell + Transparent NSTableView = Black Field editor

2010-05-26 Thread Markus Spoettl
On May 26, 2010, at 3:18 PM, Corbin Dunn wrote: I'm hoping I'm just being blind again and the there a solution for this problem? Do I need to supply my own customized field editor via -windowWillReturnFieldEditor:toObject:? You'll probably have to do that. Only it doesn't seem to work

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jens Alfke
On May 26, 2010, at 12:04 PM, vincent habchi wrote: At the same time, I remember having this kind of weird behavior (I mean, one variable unexpectedly written) when that variable has been (unexpectedly) released, and its space is reused by some other variable. That’s when an object on the

send computer to sleep

2010-05-26 Thread Julian.
what is the correct way to send the computer to sleep? i couldn't find anything in the documentation, except appleevents... thanks, Julian.___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: send computer to sleep

2010-05-26 Thread Jeff Kelley
If you need to make the computer sleep immediately, you can use the command /usr/bin/pmset sleepnow. Jeff Kelley slaun...@umich.edu On May 26, 2010, at 5:01 PM, Julian. wrote: what is the correct way to send the computer to sleep? i couldn't find anything in the documentation, except

Re: send computer to sleep

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 23:01, Julian. a écrit : what is the correct way to send the computer to sleep? i couldn't find anything in the documentation, except appleevents... #include IOKit/pwr_mgt/IOPMLib.h void SystemSleep() { io_connect_t port = IOPMFindPowerManagement(MACH_PORT_NULL);

Re: PDFKit cpSelections?

2010-05-26 Thread John Calhoun
On May 26, 2010, at 1:13 PM, Matthew Weinstein wrote: Now even before I can click on it, while it is loading from nib it bombs with the following pearls of wisdom. I can't find a discussion of cpSelections anywhere. cpSelection objects are internal - used by PDFSelection beginning with

Re: Question about predicates and list properties.

2010-05-26 Thread Graham Cox
OK, this looks like the way forward. I'm new to the built-in UI for predicates so I had assumed it had the model side of it covered, but it appears not. That's a very useful bit of info to know! --Graham On 27/05/2010, at 3:03 AM, Frédéric Testuz wrote: Le 26 mai 2010 à 16:42, Graham Cox a

selecting a row of a UITableView programatically

2010-05-26 Thread Alejandro Marcos Aragón
Hi all, Can someone tell me why the following code doesn't work? - (void) showInfo { FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@FlipsideView bundle:nil]; controller.delegate = self; NSUInteger indexes[2] = {0,3};

Re: selecting a row of a UITableView programatically

2010-05-26 Thread Luke the Hiesterman
Since nibs are loaded lazily, controller.unitTableView is probably nil when you call selectRowAtIndexPath:. Luke On May 26, 2010, at 5:24 PM, Alejandro Marcos Aragón wrote: Hi all, Can someone tell me why the following code doesn't work? - (void) showInfo {

Re: window level

2010-05-26 Thread XiaoGang Li
Thanks, Matt and Paul, I will consider your suggestion to redesign my windows level. On Wed, May 26, 2010 at 5:47 AM, Matt Neuburg m...@tidbits.com wrote: On Tue, 25 May 2010 17:34:37 +0800, XiaoGang Li andrew.mac...@gmail.com said: For my application, there is a button in the modal