To find if a file is fragmented

2014-04-08 Thread Nick Rogers
Hi,

I just need to know, if a file is fragmented or not. I don’t need the frags 
details etc.
Its for showing extended info about the selected file, like whether it is 
fragmented or not.

Is it possible with out raw reading the volume (for its catalog file)?

I have also seen Carbon File Manager’s FSGetCatalogInfo() and fstat() and they 
don’t return this info.

Any help would be greatly appreciated.

Best,
Nick


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

progress indicator strange partial overlay

2014-02-15 Thread Nick Rogers
Hi,

I have a blue background view and over it in the centre is a white background 
view (simple custom views).
In the inner white custom view, even if I create the progress bar (determinate) 
via code or IB (Xcode 5), the later end of the bar is enclosed in some sort of 
bluish wrapper. The wrapper remains even when double value of bar enters it and 
bar progresses thru it.

Attaching a 4k png image here.

Please help.
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Fwd: progress indicator strange partial overlay

2014-02-15 Thread Nick Rogers
Hi,

Here’s the image URL: http://i60.tinypic.com/209m6bd.jpg

Best,
Nick


Begin forwarded message:

 From: Nick Rogers roger...@mac.com
 Subject: progress indicator strange partial overlay
 Date: 15 February 2014 10:41:08 pm IST
 To: Cocoa-dev List List cocoa-dev@lists.apple.com
 
 Hi,
 
 I have a blue background view and over it in the centre is a white background 
 view (simple custom views).
 In the inner white custom view, even if I create the progress bar 
 (determinate) via code or IB (Xcode 5), the later end of the bar is enclosed 
 in some sort of bluish wrapper. The wrapper remains even when double value of 
 bar enters it and bar progresses thru it.
 
 Attaching a 4k png image here.
 
 Please help.
 Nick
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Fwd: [SOLVED] progress indicator strange partial overlay

2014-02-15 Thread Nick Rogers
Hi,

The about last 30% of the length of the progress bar was passed onto the 
drawRect: of the blue background custom view as dirtyRect.
Wonder what causes it.
Solved it by checking dirtyRect and then skipping drawing [NSRectFill(); etc].

Wishes,
Nick

Begin forwarded message:

 From: Nick Rogers roger...@mac.com
 Subject: Fwd: progress indicator strange partial overlay
 Date: 15 February 2014 10:46:52 pm IST
 To: Cocoa-dev List List cocoa-dev@lists.apple.com
 
 Hi,
 
 Here’s the image URL: http://i60.tinypic.com/209m6bd.jpg
 
 Best,
 Nick
 
 
 Begin forwarded message:
 
 From: Nick Rogers roger...@mac.com
 Subject: progress indicator strange partial overlay
 Date: 15 February 2014 10:41:08 pm IST
 To: Cocoa-dev List List cocoa-dev@lists.apple.com
 
 Hi,
 
 I have a blue background view and over it in the centre is a white 
 background view (simple custom views).
 In the inner white custom view, even if I create the progress bar 
 (determinate) via code or IB (Xcode 5), the later end of the bar is enclosed 
 in some sort of bluish wrapper. The wrapper remains even when double value 
 of bar enters it and bar progresses thru it.
 
 Attaching a 4k png image here.
 
 Please help.
 Nick
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com
 
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: [SOLVED] progress indicator strange partial overlay

2014-02-15 Thread Nick Rogers
Hi,

I added -isOpaque to return YES to both the overlapping custom view and even 
sub-classed progress bar and set them to return -isOpaque as YES.
Although the problem is not there when progressing, but at the end when a alert 
panel comes to from and progress bar returns to 0.0, the same patch is there 
although this time grey.

So still relying on the dirtyRect checking way to solve this.

Best,
Nick

On 16-Feb-2014, at 11:39 am, Graham Cox graham@bigpond.com wrote:

 
 On 16 Feb 2014, at 4:36 am, Nick Rogers roger...@mac.com wrote:
 
 The about last 30% of the length of the progress bar was passed onto the 
 drawRect: of the blue background custom view as dirtyRect.
 Wonder what causes it.
 
 Probably because neither the progress view or your other view returns YES 
 from -isOpaque, therefore when the progress invalidates its dirty rect is 
 also passed to the views behind it. Not sure why it's just that end portion 
 though, I would have expected the dirty rect to at least include the end of 
 the filled progress bar.
 
 --Graham
 
 


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

To find if a binary is being used/running

2013-10-04 Thread Nick Rogers
Hi,

I need to know if a binary is executing or not. I just have the path to the 
binary e.g. /Applications/MyApp.app/Contents/MacOS/MyApp

There's NSRunningApplication method runningApplicationsWithBundleIdentifier: , 
but I have other binaries which are embedded in this app which don't have a 
bundle id. And I want to know if they are running or not.

Cocoa doesn't seem have any such specific API for this purpose. NSFileHandle 
provides a valid handle (for writing) even if the binary is executing.

Is there any method like open() or something which would fail if binary is 
executing. Tried open() with flags O_EXLOCK but no luck yet.

Is this even possible?

Best,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

quitting app running in status bar logs this message about some modal session

2013-09-12 Thread Nick Rogers
Hi,

My app runs in status bar from where I can bring about its window and quit from 
the menu as well.

The following msg is logged in Xcode console (when doing [NSApp 
terminate:self],):

[25025:303] *** Assertion failure in -[NSApplication 
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:],
 /SourceCache/AppKit/AppKit-1187.39/AppKit.subproj/NSApplication.m:3919

[25025:303] Modal session cannot be run during application termination

I am not running any modal session at the time, nor the window is brought 
forward, still this error.

Please help.

Wishes,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Fwd: [SOLVED] custom field editor, no focus ring, no select all

2013-08-30 Thread Nick Rogers
Hi,

Now I'm using a NSTextField instead of NSTexView.

Best,
Nick

Begin forwarded message:

 From: Nick Rogers roger...@mac.com
 Subject: custom field editor, no focus ring, no select all
 Date: 30 August 2013 8:23:12 PM IST
 To: Cocoa-dev List List cocoa-dev@lists.apple.com
 
 Hi,
 
 I am using a custom field editor for a custom table view cell.
 
 When ever I click on the name field the editor comes into view, but focus 
 ring is not there and select all doesn't work when using keyboard or mouse or 
 programmatically. I want the focus ring to be drawn and want to select all of 
 the previous text so that the user can simply start typing a new name.
 
 Here's the code snippet from the method doubleClickInTableView:
 
 
 NSTextView *boxText = [[NSTextView alloc] initWithFrame:editRect];
 NSTextContainer *textContainer = [boxText textContainer];
 
 // Set up container
 [textContainer setContainerSize:NSMakeSize(editRect.size.width, 
 NSHeight([boxText frame]))];
 [textContainer setWidthTracksTextView:NO];
 [textContainer setHeightTracksTextView:NO];
 
 // Set up size attributes
 [boxText setHorizontallyResizable:YES];
 [boxText setVerticallyResizable:NO];
 [boxText setTextContainerInset:NSMakeSize(0, 2)];
 
 // Set up editing attributes
 [boxText setSelectable:YES];
 [boxText setEditable:YES];
 [boxText setFocusRingType:NSFocusRingTypeDefault];
 
 // Set up rich text attributes
 [boxText setRichText:NO];
 [boxText setImportsGraphics:NO];
 [boxText setUsesFontPanel:NO];
 [boxText setUsesRuler:NO];
 
 // Set up colors
 [boxText setDrawsBackground:YES];
 [boxText setBackgroundColor:[NSColor textBackgroundColor]];
 [boxText setTextColor:[NSColor controlTextColor]];
 
 [boxText setSelectedTextAttributes:aTitleAttributes];
 // And most importantly...
 [boxText setFieldEditor:YES];
 [boxText setDelegate:self];
 
 [sender addSubview:boxText];
 [boxText display];
 [boxText release];
 
 [boxText setString:stringDisplayed];
 
 [boxText sizeToFit];
 [self.window makeFirstResponder:boxText];
 [boxText drawFocusRingMask];
 [boxText selectAll:self];
 
 I have tried making boxText an ivar and allocating it in awakeFromNib, but 
 still the same result.
 Please help.
 
 Thanks,
 Nick
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

custom field editor, no focus ring, no select all

2013-08-30 Thread Nick Rogers
Hi,

I am using a custom field editor for a custom table view cell.

When ever I click on the name field the editor comes into view, but focus ring 
is not there and select all doesn't work when using keyboard or mouse or 
programmatically. I want the focus ring to be drawn and want to select all of 
the previous text so that the user can simply start typing a new name.

Here's the code snippet from the method doubleClickInTableView:


NSTextView *boxText = [[NSTextView alloc] initWithFrame:editRect];
NSTextContainer *textContainer = [boxText textContainer];

// Set up container
[textContainer setContainerSize:NSMakeSize(editRect.size.width, 
NSHeight([boxText frame]))];
[textContainer setWidthTracksTextView:NO];
[textContainer setHeightTracksTextView:NO];

// Set up size attributes
[boxText setHorizontallyResizable:YES];
[boxText setVerticallyResizable:NO];
[boxText setTextContainerInset:NSMakeSize(0, 2)];

// Set up editing attributes
[boxText setSelectable:YES];
[boxText setEditable:YES];
[boxText setFocusRingType:NSFocusRingTypeDefault];

// Set up rich text attributes
[boxText setRichText:NO];
[boxText setImportsGraphics:NO];
[boxText setUsesFontPanel:NO];
[boxText setUsesRuler:NO];

// Set up colors
[boxText setDrawsBackground:YES];
[boxText setBackgroundColor:[NSColor textBackgroundColor]];
[boxText setTextColor:[NSColor controlTextColor]];

[boxText setSelectedTextAttributes:aTitleAttributes];
// And most importantly...
[boxText setFieldEditor:YES];
[boxText setDelegate:self];

[sender addSubview:boxText];
[boxText display];
[boxText release];

[boxText setString:stringDisplayed];

[boxText sizeToFit];
[self.window makeFirstResponder:boxText];
[boxText drawFocusRingMask];
[boxText selectAll:self];

I have tried making boxText an ivar and allocating it in awakeFromNib, but 
still the same result.
Please help.

Thanks,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

editing text part in a custom NSTextFieldCell (of a NSTableView)

2013-08-17 Thread Nick Rogers
Hi,

I have a NSTableView and I'm setting a particular column to have a custom 
NSTextFieldCell subclass object as its cell.

For this I'm doing in awakeFromNib:
TableViewListCell *aTableViewListCell3 = [[[TableViewListCell alloc] init] 
autorelease];
[[tableViewPresetsMainList tableColumnWithIdentifier:COLUMN_ID_DESC] 
setDataCell:aTableViewListCell3];
[[[tableViewPresetsMainList tableColumnWithIdentifier:COLUMN_ID_DESC] 
dataCell] setEditable:YES];

The object value returned for this cell in method, - (id)tableView:(NSTableView 
*)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn 
row:(NSInteger)rowIndex, is a NSMutableDictionary containing the text to 
display in the cell as well an NSImage object to display in the cell.

Then in NSTextFieldCell subclass TableViewListCell, in method, - 
(void)drawInteriorWithFrame:(NSRect)theCellFrame inView:(NSView 
*)theControlView, I'm drawing the image (32x32 pixels) and then text to the 
right side of image, after obtaining these image and text from the cell's 
objectValue, which is the NSMutableDictionary.

Now the problem is that when I click on the cell for editing the text 
displayed, the field that pops up shows the value same as description of the 
mutable dictionary.
e.g. 
{
Description = Preset #0;
Icon = NSImage 0x1001a3ab0 Name=Presets Size={32, 32} Reps=(\n
\NSBitmapImageRep 0x1001f75e0 Size={32, 32} ColorSpace=Device RGB colorspace 
BPS=8 BPP=32 Pixels=32x32 Alpha=YES Planar=NO Format=2 
CurrentBacking=CGImageRef: 0x1001f76f0 CGImageSource=0x1005a48e0\\n);
}

Whereas I want to show and edit only the drawn name Preset #0,.

Also I want to set the editing field's rect to a smaller one, which I guess I 
can do by over-riding the method, - (void)editWithFrame:(NSRect)aRect 
inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject 
event:(NSEvent*)theEvent

Any suggestions?

Wishes,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Thread safety, some basic questions about accessing mutable objects across threads

2013-08-06 Thread Nick Rogers
Hi,

Please look at the following situations:

1. Created a mutable array in main thread, can I read its values in a secondary 
thread safely, while no other thread is modifying this mutable array?

2. I need to add objects to this mutable array from a secondary thread, and no 
other thread is modifying it. Can I simply add an object like, [array 
addObject:obj]; or if this is wrong how to achieve the same? The object to add 
is mostly NSString or NSNumber or a mutable dictionary of NSString and NSNumber.

Please help.

Best,
Nick


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

drawing outside the dirtyRect (of a NSView sub class) and overlapping NSTableView

2013-08-04 Thread Nick Rogers
Hi,

I have a column of buttons stacked up one over the other and on clicking a 
button I want to draw an image on it with an arrow protruding to the right. And 
on the right side there is a tab view and in it there is a table view.
So the arrow part of the image must overlap the tab view and table view and the 
table view is required to have normal behaviour even after this.

Is this even possible?

Thanks,
Nick


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

how to draw a elliptical pie chart?

2013-06-06 Thread Nick Rogers
Hi,

I'm new to core graphics.
The target oval (target oval.jpg) and current oval (oval.jpg) are available at 
http://www5.snapfish.in/snapfishin/thumbnailshare/AlbumID=9188624025/a=11429776025_11429776025/otsc=SHR/otsi=SALBlink/
 .
In oval after drawing the top filled ellipse I'm creating a path that moves 
from a point on the ellipse to its centre and then back to another point on the 
ellipse thus forming a slice.
The problem is how to fill this elliptical slice with a different colour.

Please help.
Nick


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Fwd: how to draw a elliptical pie chart?

2013-06-06 Thread Nick Rogers
Sorry earlier link to images required signup.

Here are the new links:

http://picturepush.com/public/13243485
and
http://picturepush.com/public/13243495

Wishes,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: way to update Apple Menu's Recents Items

2013-05-14 Thread Nick Rogers
Hi,

But a commercially available program is doing it.
And I have gone through process list in activity monitor before and after 
Recent Items is updated by this program.
And found no difference in number of processes or any change in PIDs of the 
processes. Means probably no re-spawning.

I have to do this.
Please suggest.

Wishes,
Nick

On 14-May-2013, at 9:30 AM, Kyle Sluder k...@ksluder.com wrote:

 On Mon, May 13, 2013, at 08:50 PM, Nick Rogers wrote:
 Hi,
 
 I can remove the recent items from the plist where they are stored.
 
 But when I try and update the Recent Items submenu, it doesn't.
 
 I'm getting Apple Menu by using [[NSApp mainMenu] itemAtIndex:0].
 
 OR do I need to kill some process (which will then restart) to achieve
 this.
 
 Recent Items are managed by Powerbox, and the number of included items
 is set by the user in System Preferences. You should not attempt to
 modify this submenu.
 
 --Kyle Sluder


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


way to update Apple Menu's Recents Items

2013-05-13 Thread Nick Rogers
Hi,

I can remove the recent items from the plist where they are stored.

But when I try and update the Recent Items submenu, it doesn't.

I'm getting Apple Menu by using [[NSApp mainMenu] itemAtIndex:0].

OR do I need to kill some process (which will then restart) to achieve this.

Thanks,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: delaying forced sleep after initial 30 seconds delay

2013-05-03 Thread Nick Rogers
Hi,

Thanks for all the inputs.
The app doesn't run any scheduled operations.
So the situation would occur only when the user wants it to.

Best,
Nick

On 03-May-2013, at 10:26 AM, Kyle Sluder k...@ksluder.com wrote:

 On Thu, May 2, 2013, at 09:16 PM, Nick Rogers wrote:
 Hi,
 
 I want my app to delay forced sleep even after requesting the initial
 delay of 30 seconds.
 
 Forced sleep exists for cases in which keeping the machine awake can
 cause hardware failure.
 
 
 I have seen my macbook pro sometime taking more than 2 minutes to go into
 sleep, after closing the lid. So is this possible at all?
 
 This shouldn't happen. It's a bad thing when it does. So the system is
 designed to prevent you from causing it to happen.
 
 Please don't try to give your users a Ruin My Hardware checkbox.
 
 --Kyle Sluder

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


delaying forced sleep after initial 30 seconds delay

2013-05-02 Thread Nick Rogers
Hi,

I want my app to delay forced sleep even after requesting the initial delay of 
30 seconds.
This have to be specifically set by the user in the Preferences of the app and 
only when the user clicks  a button to run some operation, for the duration of 
that operation which could extent to a minute or two.

I know it would be against the mac os x design principles, but I think in the 
end it has to be the user's wish.

I have seen my macbook pro sometime taking more than 2 minutes to go into 
sleep, after closing the lid. So is this possible at all?

The scenario is that user has set the preference to delay forced sleep and then 
he clicks the button on the app and then closes the laptop lid, knowing fully 
well that it may delay sleep for a few minutes.

Wishes,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


multiple profiles in preferences mechanism

2013-04-13 Thread Nick Rogers
Hi,

I wish to use NSUserDefaultsController to ease up on writing glue code as well 
as for its features.
But the problem is I need to have profiles (or rather Presets) for preferences. 
Each preset would have the same set of preferences.
I am thinking of a table view on left where presets could be added/removed and 
on right there would be UI controls for preferences (basically all are check 
boxes).

Is it possible to save the same set of preferences with different profiles in 
the system provided mechanism or do I have to come up with a scheme of my own 
(I guess I'd then be storing preferences in a plist in app bundle)?

Best,
Nick
 
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: multiple profiles in preferences mechanism

2013-04-13 Thread Nick Rogers
Thanks for the valuable input.

Thanks,
Nick

On 13-Apr-2013, at 9:26 PM, Jerry Krinock je...@ieee.org wrote:

 
 On 2013 Apr 13, at 07:39, Nick Rogers roger...@mac.com wrote:
 
 Is it possible to save the same set of preferences with different profiles 
 in the system provided mechanism or do I have to come up with a scheme of my 
 own (I guess I'd then be storing preferences in a plist in app bundle)?
 
 I don't think that NSUserDefaults has that mechanism.
 
 Using a scheme of my own is how the Google Chrome web browser supports 
 multiple user profiles.  Preferences are in Application Support.  Each 
 profile gets a subfolder in ~/Library/Application Support/Google/Chrome/, 
 which contains, among many other things, a JSON Preferences file.
 
 I'd also consider layering my profiles into NSUserDefaults somehow.  To do 
 this, you'll need to do lots of digging into and out of dictionaries with key 
 paths such as foo.profileName.bar.  I've added a category to NSUserDefaults 
 which creates and removes the required subdictionaries automatically, and 
 also understands key path arrays such as {foo, profileName, bar}. If 
 you're interested,
 
 https://github.com/jerrykrinock/CategoriesObjC/blob/master/NSUserDefaults%2BKeyPaths.h
 
 
 
 
 
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Hover button and tracking area questions

2013-01-24 Thread Nick Rogers
Hi,

The code that I pasted was going thru change.
In the original copy, I was removing tracking area before adding the new.

So now my thinking goes that I shouldn't have added tracking areas after the 
initial one, at least I am now doing that and hoping it not to crash.

The exception was:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000d, 0x


Any ideas?

Thanks,
Nick
 
On 24-Jan-2013, at 2:18 PM, Kyle Sluder k...@ksluder.com wrote:

 On Jan 24, 2013, at 12:30 AM, Kyle Sluder k...@ksluder.com wrote:
 
 
 But considering that the API is intended to be used to create and
 install tracking areas on objects that are potentially different from
 their owner, it seems sensible that -addTrackingArea: might not retain
 the tracking area.
 
 I did some snooping, and it's apparently stuffing the tracking areas into a 
 standard NSArray. In fact, I believe it's the same array we see being copied 
 in Nick's stack trace. So there goes that theory.
 
 --Kyle Sluder
 
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Hover button and tracking area questions

2013-01-24 Thread Nick Rogers
Hi,

Thanks for the reply.

The code for HoverButton class is almost same as I posted in the first email 
with the exception that in the following method I was removing trackingArea 
before releasing it.

- (void)updateTrackingAreas
{
   if (trackingArea) {
[self removeTrackingArea:trackingArea];// its there in the code that I 
have
   [trackingArea release];
   trackingArea = nil;
   }
   [self ensureTrackingArea];
   [self addTrackingArea:trackingArea];
   [super updateTrackingAreas];
}
mouseEntered: and mouseExited: and other methods do not touch the trackingArea 
at all.

This puzzled me and so I asked whether the tab view showing these button 
changing tab item to another and thus making these buttons invisible would have 
any repercussions. Or calling [super updateTrackingAreas]; at the beginning or 
end of the method updateTrackingAreas would make any difference.

Another was any ill effect of removing and adding tracking area, which I am not 
doing now as the button is not resizable.

Thanks,
Nick

On 24-Jan-2013, at 7:24 PM, Markus Spoettl ms_li...@shiftoption.com wrote:

 On 1/24/13 12:06 PM, Nick Rogers wrote:
 The code that I pasted was going thru change. In the original copy, I was
 removing tracking area before adding the new.
 
 So now my thinking goes that I shouldn't have added tracking areas after the
 initial one, at least I am now doing that and hoping it not to crash.
 
 I'm doing this (dynamically removing and adding tracking areas) all the time, 
 and while it does have drawbacks that Kyle explained, it works just fine. If 
 your memory management is OK, this will work. The fact that you're crashing 
 indicates that you're over-releasing your tracking area (or something else 
 is). Post your real code, we may spot something.
 
 Regards
 Markus
 -- 
 __
 Markus Spoettl
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


can update the UI from sheetDidEnd:…. ?

2013-01-23 Thread Nick Rogers
Hi,

I was updating a few textfields from my sheetDidEnd:…. method.
Just wondering if that was causing the crash (UI related error in main thread).

Thanks,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: can update the UI from sheetDidEnd:…. ?

2013-01-23 Thread Nick Rogers
Hi,

Thanks for the replies.
Sorry I didn't provide enough info in the beginning.
Here it is.

On 24-Jan-2013, at 9:55 AM, Graham Cox graham@bigpond.com wrote:

 
 On 24/01/2013, at 1:30 PM, Nick Rogers roger...@mac.com wrote:
 
 Hi,
 
 I was updating a few textfields from my sheetDidEnd:…. method.
 Just wondering if that was causing the crash (UI related error in main 
 thread).
 
 
 If written correctly, the sheetDidEnd method is free to access stuff still in 
 the sheet. In fact, it often has to to ensure any last minute entries in 
 fields are committed - I usually start my sheetDidEnd methods with [sheet 
 makeFirstResponder:sheet] to force a focused text field to push its content 
 to its action method.
 
 sheetDidEnd methods also often call their delegates, and the delegate must be 
 able to assume it can access anything (public) in the sheet.
 
 So whatever your problem is, it's not that. Show your code.

The text fields to update are on the main window.

On 24-Jan-2013, at 9:03 AM, Andy Lee ag...@mac.com wrote:

 On Jan 23, 2013, at 9:30 PM, Nick Rogers roger...@mac.com wrote:
 I was updating a few textfields from my sheetDidEnd:…. method.
 Just wondering if that was causing the crash (UI related error in main 
 thread).
 
 What happens if you *don't* update the text fields in your sheetDidEnd 
 method? Does it still crash?

The crash doesn't happen always, so no way to tell if not updating the text 
fields from sheetDidEnd:.. has taken care of it.

 
 Can you show us the code for the sheetDidEnd method just in case there's a 
 clue there?
 
The code is simple. just updating the text fields on the main window, using 
setStringValue:@some string.
Now I am doing this using performSelectorOnMainThread:.

 Are you passing a contextInfo pointer to the sheetDidEnd message? If it's an 
 object reference, maybe you need to retain it (and then autorelease it in 
 sheetDidEnd), assuming you're not using ARC.
 
No context info. its NULL.
 Are you using ARC?
 
The code is not ARC or GC.

 Are you remembering to call orderOut: as mentioned in the Sheet Programming 
 Guide (unlikely to cause a crash, but worth checking)?
 
I am calling orderOut:self but not from sheetDidEnd:… but from other method 
which ends the sheet.
method is like:

[NSApp endSheet:sheetWindow];
[sheetWindow orderOut:self];

Is it okay to do so as between these two statements the sheetDidEnd:… will 
execute? So, will the execution of second statement happen only after sheet 
ends.

 https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/sheets/Tasks/UsingCustomSheets.html#//apple_ref/doc/uid/20001290-BABFIBIA
 
 Are the text fields in question *on* the sheet? If so, maybe you're trying to 
 modify them after they've been dealloc'ed due to the sheet being dismissed.
 

The text fields are on the main window.

 Does the stack trace show any of your code, or is it all Apple stuff?
 
The stack trace shows internal UI problem. selector is retain.
Now I am not sure if the sheet is problem, it could be something else too. But 
knowing the answer will help rule out the sheet part of the code.
 Are there any meaningful error messages being logged?
 
The crash actually show _updateTrackingAreas being called repeatedly and the 
crash happened just after sheet ends so I just wanted to know the best 
practices regarding sheet. I am going to post another one with crash report and 
details of hover button where I am using updateTrackingAreas. The crash 
happened many seconds after the last hover button was pushed. And after a sheet 
ended, so started this thread to make sheets clear.

 Are you actually crashing or just throwing an exception? What if you add a 
 breakpoint exception?
 
Crash happened only once and is not reproducible.

Wishes,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: can update the UI from sheetDidEnd:…. ?

2013-01-23 Thread Nick Rogers
Hi,

Sorry if I caused any confusion.
But I don't know if _updateTrackingAreas would or would not be called by the 
system for its own UI display mechanism even if I don't use it in code.

Best,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Hover button and tracking area questions

2013-01-23 Thread Nick Rogers
Hi,

I have just a tab view on my main window and I switch tabs based on user input.
First tab has three hover buttons and on clicking one of them, it takes to 
another tab which two hover buttons.
After clicking one of the two hover buttons, I switch tab and show a table view 
and then show and end a sheet.
On clicking another button there I bring another sheet with radio buttons and 
on clicking a radio button, it just crashed, many seconds after the last hover 
button was clicked.

The crash report says something about _updateTrackingAreas, so I have detailed 
about the situation above.

Part of code is reproduced below.

@interface HoverButton : NSButton
{
NSTrackingArea *trackingArea;
BOOL hovering;
}

// Implementation
- (void)ensureTrackingArea
{
if (trackingArea == nil) {
trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds]
options: 
(NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | 
NSTrackingInVisibleRect)
  owner:self userInfo:nil];
}
}

- (void)updateTrackingAreas
{
if (trackingArea) {
[trackingArea release];
trackingArea = nil;
}
[self ensureTrackingArea];
[self addTrackingArea:trackingArea];
[super updateTrackingAreas];
}

- (void)mouseExited:(NSEvent *)theEvent
{
// shows one image over the button
}

- (void)mouseEntered:(NSEvent *)theEvent
{
// shows another image over the button
}

Part of the crash report stack trace:

Application Specific Information:
objc_msgSend() selector name: retain
objc[347]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib 0x7fff97c31350  
objc_msgSend_vtable13 + 16
1   com.apple.CoreFoundation0x7fff96525b87  +[__NSArrayI 
__new::] + 167
2   com.apple.CoreFoundation0x7fff96525a75  
-[__NSPlaceholderArray initWithObjects:count:] + 245
3   com.apple.CoreFoundation0x7fff965287c0  -[NSArray 
initWithArray:range:copyItems:] + 816
4   com.apple.CoreFoundation0x7fff96528482  -[NSArray 
initWithArray:copyItems:] + 66
5   com.apple.CoreFoundation0x7fff9654caf6  -[__NSArrayM 
copyWithZone:] + 54
6   com.apple.CoreFoundation0x7fff96524d54  -[NSObject 
copy] + 20
7   com.apple.AppKit0x7fff942a7ad2  
-[NSView(NSInternal) _updateTrackingAreas] + 1295
8   com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
9   com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
10  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
11  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
12  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
13  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
14  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
15  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
16  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
17  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
18  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
19  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
20  com.apple.CoreFoundation0x7fff96574cee  
__NSArrayEnumerate + 718
21  com.apple.AppKit0x7fff942a7aeb  
-[NSView(NSInternal) _updateTrackingAreas] + 1320
22  com.apple.AppKit0x7fff942a7444  __-[NSWindow 
_postInvalidCursorRects]_block_invoke_1 + 1107
23  com.apple.CoreFoundation0x7fff9653c8e7 
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24  com.apple.CoreFoundation0x7fff9653c846  
__CFRunLoopDoObservers + 374
25  com.apple.CoreFoundation0x7fff96511af9  __CFRunLoopRun 
+ 825
26  com.apple.CoreFoundation0x7fff96511486  
CFRunLoopRunSpecific + 230
27  com.apple.HIToolbox 0x7fff959702bf  
RunCurrentEventLoopInMode + 277
28  com.apple.HIToolbox 0x7fff959774bf  
ReceiveNextEventCommon + 181
29  com.apple.HIToolbox 0x7fff959773fa  
BlockUntilNextEventMatchingListInMode + 62
30  com.apple.AppKit0x7fff941e1779  _DPSNextEvent + 
659
31  com.apple.AppKit0x7fff941e107d   

Re: how to make a task less cpu intensive

2012-12-31 Thread Nick Rogers
Hi,

Thanks for all the input.
The problem solved when I did this: [progressIndicator 
setUsesThreadedAnimation:YES]; in the awakeFromNib method.
With out this the progress bar doesn't animate no matter if the sheet is in the 
main thread or secondary or no heavy computations.

I can't have any rough estimates on how much memory i'd need to malloc, some 
times it can be less than 1 MB and grow to 1GB. Also the tree is incremental, 
so can not predict its final size.

Thanks again,
Nick

On 29-Dec-2012, at 12:53 AM, Scott Ribe scott_r...@elevated-dev.com wrote:

 On Dec 28, 2012, at 10:40 AM, Nick Rogers wrote:
 
 I have a tree in memory (all nodes malloc'ed blocks) and when I start 
 freeing this large tree, I traverse the tree and free all nodes.
 
 Are you really only free'ing the malloc'd pointers? Or are you calling some 
 higher-level tree maintenance function which does additional work? Example: 
 calling some node-delete() function which re-balances the tree...
 
 -- 
 Scott Ribe
 scott_r...@elevated-dev.com
 http://www.elevated-dev.com/
 (303) 722-0567 voice
 
 
 
 

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


how to make a task less cpu intensive

2012-12-28 Thread Nick Rogers
Hi,

I have a tree in memory (all nodes malloc'ed blocks) and when I start freeing 
this large tree, I traverse the tree and free all nodes.
This becomes cpu intensive and so the progress bar on my sheet doesn't animate.

In similar other situations the progress bar animates, when different code is 
executed in the background.

Any ideas on how to make tree freeing process less intensive?

Thanks,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


sheet is divided horizontally in two shades

2012-12-11 Thread Nick Rogers
Hi,

The example sheet's grab is attached here.
In this one the sheet seems divided in half, but in smaller sheets with less 
height, the lighter shaded bottom portion is smaller.

Occurs in Mac OS X Lion and Mountain Lion. On Leopard and Snow Leopard it 
doesn't occur.

The beginSheet: modalForWindow: …… …… method is called from the main thread.

Any ideas would really help.


Thanks,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: sheet is divided horizontally in two shades

2012-12-11 Thread Nick Rogers
Hi,

The image is at following link (in the album):

http://www5.snapfish.com/snapfish/thumbnailshare/AlbumID=7802925026/a=13244939026_13244939026/otsc=SHR/otsi=SALBlink/COBRAND_NAME=snapfish/

And the app has GC required.

Wishes,
Nick

On 12-Dec-2012, at 12:24 AM, Jeff Johnson publicpost...@lapcatsoftware.com 
wrote:

 On Dec 11, 2012, at 11:30 AM, Nick Rogers wrote:
 
 Hi,
 
 The example sheet's grab is attached here.
 In this one the sheet seems divided in half, but in smaller sheets with less 
 height, the lighter shaded bottom portion is smaller.
 
 Occurs in Mac OS X Lion and Mountain Lion. On Leopard and Snow Leopard it 
 doesn't occur.
 
 The beginSheet: modalForWindow: …… …… method is called from the main thread.
 
 Any ideas would really help.
 
 
 Thanks,
 Nick
 
 Hi Nick.
 
 I think I know what your issue is. However, your message didn't have an 
 attachment. Perhaps the mailing lists don't allow attachments. Could you post 
 the screenshot someone on the web?
 
 -Jeff
 
 


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: sheet is divided horizontally in two shades

2012-12-11 Thread Nick Rogers
oops! that requires a sign up

here's the direct link:

http://s13.postimage.org/ci00lrbsn/divided_sheet.jpg

Best,
Nick

On 12-Dec-2012, at 2:20 AM, Nick Rogers roger...@mac.com wrote:

 Hi,
 
 The image is at following link (in the album):
 
 http://www5.snapfish.com/snapfish/thumbnailshare/AlbumID=7802925026/a=13244939026_13244939026/otsc=SHR/otsi=SALBlink/COBRAND_NAME=snapfish/
 
 And the app has GC required.
 
 Wishes,
 Nick
 
 On 12-Dec-2012, at 12:24 AM, Jeff Johnson publicpost...@lapcatsoftware.com 
 wrote:
 
 On Dec 11, 2012, at 11:30 AM, Nick Rogers wrote:
 
 Hi,
 
 The example sheet's grab is attached here.
 In this one the sheet seems divided in half, but in smaller sheets with 
 less height, the lighter shaded bottom portion is smaller.
 
 Occurs in Mac OS X Lion and Mountain Lion. On Leopard and Snow Leopard it 
 doesn't occur.
 
 The beginSheet: modalForWindow: …… …… method is called from the main thread.
 
 Any ideas would really help.
 
 
 Thanks,
 Nick
 
 Hi Nick.
 
 I think I know what your issue is. However, your message didn't have an 
 attachment. Perhaps the mailing lists don't allow attachments. Could you 
 post the screenshot someone on the web?
 
 -Jeff
 
 
 


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: sheet is divided horizontally in two shades

2012-12-11 Thread Nick Rogers
Thanks for the valuable info.

Thanks,
Nick

On 12-Dec-2012, at 2:39 AM, Jeff Johnson publicpost...@lapcatsoftware.com 
wrote:

 rdar://problem/11656928 Discolored stripe drawn at bottom of textured 
 non-resizable windows
 Duplicate of rdar://problem/11716883
 
 It turns out that this only affects windows with content border autosize. If 
 you set the window content border to none, that should fix the problem.
 
 -Jeff
 
 
 On Dec 11, 2012, at 2:54 PM, Nick Rogers wrote:
 
 oops! that requires a sign up
 
 here's the direct link:
 
 http://s13.postimage.org/ci00lrbsn/divided_sheet.jpg
 
 Best,
 Nick
 
 On 12-Dec-2012, at 2:20 AM, Nick Rogers roger...@mac.com wrote:
 
 Hi,
 
 The image is at following link (in the album):
 
 http://www5.snapfish.com/snapfish/thumbnailshare/AlbumID=7802925026/a=13244939026_13244939026/otsc=SHR/otsi=SALBlink/COBRAND_NAME=snapfish/
 
 And the app has GC required.
 
 Wishes,
 Nick
 
 On 12-Dec-2012, at 12:24 AM, Jeff Johnson 
 publicpost...@lapcatsoftware.com wrote:
 
 On Dec 11, 2012, at 11:30 AM, Nick Rogers wrote:
 
 Hi,
 
 The example sheet's grab is attached here.
 In this one the sheet seems divided in half, but in smaller sheets with 
 less height, the lighter shaded bottom portion is smaller.
 
 Occurs in Mac OS X Lion and Mountain Lion. On Leopard and Snow Leopard it 
 doesn't occur.
 
 The beginSheet: modalForWindow: …… …… method is called from the main 
 thread.
 
 Any ideas would really help.
 
 
 Thanks,
 Nick
 
 Hi Nick.
 
 I think I know what your issue is. However, your message didn't have an 
 attachment. Perhaps the mailing lists don't allow attachments. Could you 
 post the screenshot someone on the web?
 
 -Jeff
 


___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: a way to clear inactive RAM

2012-11-06 Thread Nick Rogers
Hi,

Thanks for the replies.
I was trying to achieve what essentially free memory apps on the Mac AppStore 
do.
The RAM usage can be divided into four parts as shown in Activity Monitor.
1. Free
2. In-active
3. Active
4. Wired

When I used my earlier app to allocate memory equal to free + inactive bytes, 
for the execution of the program it used to make the system less responsive for 
a few seconds and on release and quitting the app, most of the inactive memory 
would shift under free.

e.g. if free is 1GB and inactive is 1.5GB, then after run, free would be 2.45GB 
and inactive just 50MB.

Thanks again,
Nick

On 06-Nov-2012, at 2:29 AM, Alex Zavatone z...@mac.com wrote:

 Not sure what RAM clearing means but if you want to purge the disk cache, 
 check out man purge in the terminal.
 
 On Nov 5, 2012, at 1:54 PM, Nick Rogers wrote:
 
 Hi,
 
 I am assigned this small utility which should clear inactive RAM.
 I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
 purpose.
 But I have to make this.
 
 Prior to Mountain Lion I was allocating memory in my app that was roughly 
 equivalent to free + inactive RAM.
 And it used to work perfectly, i.e. most inactive RAM used to become free.
 
 But in Mountain Lion, aggressive allocations are not affecting RAM at all.
 
 I want this util to also work on systems that don't have Xcode installed.
 
 I saw the post where someone posted notes of purge disassembly. But that 
 isn't leading anywhere. Also purge comes with Xcode only.
 
 There are apps on Mac App Store that do this kind of thing.
 
 How to go about it? Any pointers would be really appreciated.
 
 Wishes,
 Nick
 
 ___
 
 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 Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
 
 This email sent to z...@mac.com
 

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


a way to clear inactive RAM

2012-11-05 Thread Nick Rogers
Hi,

I am assigned this small utility which should clear inactive RAM.
I know Mac OS X manages memory quite efficiently and inactive RAM also has a 
purpose.
But I have to make this.

Prior to Mountain Lion I was allocating memory in my app that was roughly 
equivalent to free + inactive RAM.
And it used to work perfectly, i.e. most inactive RAM used to become free.

But in Mountain Lion, aggressive allocations are not affecting RAM at all.

I want this util to also work on systems that don't have Xcode installed.

I saw the post where someone posted notes of purge disassembly. But that isn't 
leading anywhere. Also purge comes with Xcode only.

There are apps on Mac App Store that do this kind of thing.

How to go about it? Any pointers would be really appreciated.

Wishes,
Nick

___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


to highlight a outline view row on mouse over

2012-07-20 Thread Nick Rogers
Hi,

I wish to highlight a row on mouse over by changing the background color to 
light blue. And back to regular when mouse moves away from the row.

Have seen a few examples of it on the internet.
But is there any efficient way to do this?

Any help would be greatly appreciated...

Thanks,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


vm keeps increasing when in a rigorous loop

2012-07-08 Thread Nick Rogers
Hi,

The code is like:

- (void)myMethod
{
.

while (flag) {
UInt32 temp;
. and lot of other ints etc.
if (someCondition == 1) {
UInt8 *buff = (UInt8*)calloc(1, sizeof(aStruct));
if (someOtherCondition == 1) {
[self addPointerToATree:buff];
}
else
free(buff);
}
}
}

The while loop runs very rigorously without having much delay in it.
Memory for buff is only needed when certain condition is met.
I have seen that even when this condition is not met and no memory is 
allocated, the VM keeps growing steadily as seen in Activity Monitor.
So the only thing contributing to it would be the various ints etc.
But the app is GC enabled (required), so the VM size should reset to some level 
every few seconds, but doesn't.
The loop does many thousands of iterations per second.

Any idea on how to limit this usage?
Shall  help.
I have a auto release pool drained at the end of every iteration in a loop in 
some other method but that doesn't seem to have much effect.

Wishes,
Nick



___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


GC and malloc question

2012-05-31 Thread Nick Rogers

Hi,

My program has to build a tree structure, the number of nodes, in  
which can run into many millions.
So I began to make changes to allocate a node using malloc. Earlier I  
was using a object for a node.


I have GC enabled (required). And basically I'm making a linked list  
of nodes to store children nodes.
The root node pointer is a member of a class and children nodes  
pointer are stored in root node.


Immediately after malloc'ing a node I'm using Garbage Collector method  
- disableCollectorForPointer, just to make sure, although GC is  
supposed to work only on objects, if I'm right.


My question is: will GC affect the node allocations in anyway and,  
also (GC or No GC) will the tree starting from a root node able to  
stay in memory until I free it.
Because I'm getting EXC_BAD_ACCESS/KERN_PROTECTION_FAILURE, one after  
the other.


Will using - disableCollectorForPointer have any effect on this.

Best,
Nick
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Save panel showing as a blank sheet

2012-04-27 Thread Nick Rogers

Hi,

I'm running a NSSavePanel as sheet, but on some systems the sheet is totally 
blank and having odd dimensions like twice the normal height.

code is:
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setRequiredFileType:@rrs];
[panel setExtensionHidden:YES];
[panel setCanCreateDirectories:YES];
[NSDateFormatter 
setDefaultFormatterBehavior:NSDateFormatterBehavior10_4];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@ dd, , h_mm_ss a];
NSString *suggestedFileName = [NSString stringWithFormat:@session file 
%@, [dateFormatter stringFromDate:[NSDate date]]];
[panel beginSheetForDirectory:nil
file:suggestedFileName
modalForWindow:window
modalDelegate:self

didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:)
contextInfo:NULL];
I also saw something related to errors in mounting of a volume in system log. 
Could it be the reason?
Any thoughts?

Wishes,
Nick
Sent from iCloud
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Save panel showing as a blank sheet

2012-04-27 Thread Nick Rogers

Thanks for the interest.


Yes, the panel is run from the main thread.


The problem has occurred only thrice on different user's machines in a span of 
2 years.

In one case I was able to get system log and it showed some problem with 
getting a mounted volume's attributes.

The log also indicated an error in loading some framework. Was long ago, and I 
haven't kept the details.


I'm just guessing that it may have to do something with the elements that needs 
to be shown in a panel, like Devices, Volumes etc.

Also does something, like a broken framework problem on a mac, could exist?


Thanks,

Nick

Sent from iCloud

On Apr 27, 2012, at 09:22 PM, Nick Zitzmann n...@chronosnet.com wrote:







On Apr 27, 2012, at 2:34 AM, Nick Rogers wrote:


Hi,
 

I'm running a NSSavePanel as sheet, but on some systems the sheet is totally 
blank and having odd dimensions like twice the normal height.
 

code is:

 NSSavePanel *panel = [NSSavePanel savePanel];
 [panel setRequiredFileType:@rrs];
 [panel setExtensionHidden:YES];
 [panel setCanCreateDirectories:YES];
 [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4];
 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
 [dateFormatter setDateFormat:@ dd, , h_mm_ss a];
 NSString *suggestedFileName = [NSString stringWithFormat:@session file %@, 
[dateFormatter stringFromDate:[NSDate date]]];
 [panel beginSheetForDirectory:nil
 file:suggestedFileName
 modalForWindow:window
 modalDelegate:self
 didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:)
 contextInfo:NULL];
 I also saw something related to errors in mounting of a volume in system log. 
Could it be the reason?
 Any thoughts?

Just checking: You are running the save panel from the main thread, right? And 
you're sure of that, right?

Nick Zitzmann
http://www.chronosnet.com/
___

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 Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: table view and custom cell optimization problem

2011-03-03 Thread Nick Rogers
Hi,
Thanks for the reply.

But the problem is that I don't have anything common in the rows.
The image (128x128) are different, the four lines of text are different and the 
lines I draw are different in each cell.

Any Ideas?

Regards,
Nick

On 03-Mar-2011, at 9:48 PM, jonat...@mugginsoft.com wrote:

 
 On 3 Mar 2011, at 04:06, Nick Rogers wrote:
 
 Hi,
 I have a table view with the custom cell class assigned to its only column 
 in awakeFromNib method using setDataCell:.
 Then I'm doing some drawing in drawInteriorWithFrame: of the NSCell subclass.
 The problem is that drawing include four lines of text and an image and a 
 few lines using NSBezierPath.
 
 This is relatively time consuming and hence when I scroll the table view, 
 the scrolling is not that smooth and is a bit jerky.
 
 Is there a way to do all this custom drawing in a manner that could make the 
 scrolling faster.
 
 I use the following approach in an NSView but you can adapt it.
 
 The idea is to cache your background (that is common to all cells) in an 
 NSImage instance.
 When the cell needs drawn you copy from the image cache into your focus 
 locked view.
 Then you can draw the unique cell content - text etc.
 
 Obviously when the cell size changes you have to regenerate your background 
 image cache.
 
 - (void)drawRect:(NSRect)rect 
 { 
 
   if (!_imageCache) {
   
   // draw to image cache
   _cacheRect  = [self bounds];
   _imageCache = [[NSImage alloc] initWithSize:_cacheRect.size];
   [_imageCache lockFocus];
   
   // draw background with beziers etc
   
   [_imageCache unlockFocus]; 
   }
 
   [_imageCache drawInRect:rect fromRect:rect 
 operation:NSCompositeSourceOver fraction:1.0f];
 
   // now draw unique foreground
 } 
 
 
 
 
 Regards
 
 Jonathan Mitchell
 
 Developer
 Mugginsoft LLP
 http://www.mugginsoft.com___
 
 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 Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com
 
 This email sent to roger...@mac.com

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


table view and custom cell optimization problem

2011-03-02 Thread Nick Rogers
Hi,
I have a table view with the custom cell class assigned to its only column in 
awakeFromNib method using setDataCell:.
Then I'm doing some drawing in drawInteriorWithFrame: of the NSCell subclass.
The problem is that drawing include four lines of text and an image and a few 
lines using NSBezierPath.

This is relatively time consuming and hence when I scroll the table view, the 
scrolling is not that smooth and is a bit jerky.

Is there a way to do all this custom drawing in a manner that could make the 
scrolling faster.

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


converting app to a document based app

2011-02-15 Thread Nick Rogers
Hi,
Googled a lot but didn't find anything.
Can some one send definitive steps for converting a non-document based app to a 
document based app.

In my app, there is a MainMenu.nib and an AppController class.
I'd also want to convert the nib to a xib.

I'd really appreciate any help on this.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


running a timer while displaying a sheet

2010-10-16 Thread Nick Rogers
Hi,
When I run a sheet, I want it to display a text field which has to be updated 
every second or so (basically showing a count down 60 Seconds, 59 Seconds 
and so on.
I am starting a timer in main thread using:
timerRawScanMsg = [NSTimer timerWithTimeInterval:1.0 target:self 
selector:@selector(myTimerFireMethod:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg 
forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:timerRawScanMsg 
forMode:NSEventTrackingRunLoopMode];
Then I'm starting the sheet using:
[NSApp beginSheet:windowRawScanMsg modalForWindow:windowMain 
modalDelegate:self 
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:nil];

The myTimerFireMethod: is not getting called, which would update the text field 
in the sheet.

Any help would be greatly appreciated.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


strange horizontal line in scroll view

2010-08-01 Thread Nick Rogers
Hi,
I have three matrices (all same sub class of NSMatrix, having prototype as a 
subclass of NSTextFieldCell), initially inited to have 1 row each and 1, 16 and 
16 columns respectively. I'm trying to make a simple hex viewer using matrix 
instead of complex custom views for display.

Then I add rows (typically 256 or so) to all three matrices using addRow to 
accommodate the number of 16 byte rows in the to be displayed disk (iPod) 
sector.

The three matrices are to be added as subviews to a vertical split view 
(created in IB).
Then I send - sizeToCells and setScrollable:YES to the 3 matrices.
Then I send setFrameSize to split view keeping the width same, but increasing 
the height to accommodate the matrix height (matrix height + 4).
Then I add each matrix as sub view of the split view, the split view is a sub 
view of an scroll view (created in IB).

When I scroll down to a particular location in scroll view, I see this 
horizontal line (across all three matrices columns) with the upper area having 
a dark shade and lower area being brighter, both slowly fades.
This line repeats many times in 256 rows, spaced at constant interval.

Please take a look at the attached image.

Please suggest what I am doing wrong or need to do.

Wishes,
Nick
inline: screen_shot_line.jpg___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: strange horizontal line in scroll view

2010-08-01 Thread Nick Rogers
Hi,
Thanks for the reply.
I used matrix to display data inside a sector years ago, when I had just 
started learning cocoa.
I know its a crude and inefficient way to make a hex viewer, but currently its 
not required to be sophisticated at all and I didn't have the time to make any 
big changes.

I'm pasting here all of the code related to views, if it can give any clues.

My sub-class of NSTextFieldCell: (currently does nothing but sets highlight 
color)
@implementation HexCell
-(NSColor *)highlightColorWithFrame:(NSRect)rect inView:(NSView *)controlView
{
return [NSColor yellowColor];
}
@end
My NSMatrix sub-class: (I'm not calling drawRect:)
@implementation MatrixHex
- (id)initWithFrame:(NSRect)frameRect rows:(int)rows columns:(int)columns
{
HexCell *aCell = [self prototype];  
// initiates matrix:
[self initWithFrame:frameRect
mode:NSListModeMatrix
   prototype:aCell
numberOfRows:rows
 numberOfColumns:columns];
[self setScrollable:YES];
return self;
}

- (id)prototype
{
HexCell *aCell = [[ HexCell alloc] init];
[aCell setEnabled:YES];
[aCell setStringValue:@00];
[aCell setFont:[NSFont systemFontOfSize:10.0]];
return aCell;
}
@end
In my AppController, I have:
id matOffset = matrixOffset;
id matHex = matrixHex;
id matAscii = matrixAscii;


matrixOffset = [[MatrixHex alloc] initWithFrame:NSMakeRect(0.0, 0.0, 44.0, 
16.0) rows:1 columns:1];
[matrixOffset setCellSize:NSMakeSize(40.0, 13.0)];
[matrixOffset setIntercellSpacing:NSMakeSize(0.0, 2.0)];

matrixAscii = [[MatrixHex alloc] initWithFrame:NSMakeRect(0.0, 0.0, 
192.0, 16.0) rows:1 columns:16];
[matrixAscii setCellSize:NSMakeSize(12.0, 13.0)];
[matrixAscii setIntercellSpacing:NSMakeSize(0.0, 2.0)];

matrixHex = [[MatrixHex alloc] initWithFrame:NSMakeRect(0.0, 0.0, 
364.0, 16.0) rows:1 columns:16];
[matrixHex setCellSize:NSMakeSize(19.0, 13.0)];
[matrixHex setIntercellSpacing:NSMakeSize(4.0, 2.0)];

rowsInSector = sectorSize / 16;
int i = 0;
for (i = 0; i  rowsInSector; i++)//one row already there. so one extra 
row for showing ---
{
[matrixOffset addRow];
[matrixHex addRow];
[matrixAscii addRow];
}

[matrixOffset sizeToCells];
[matrixAscii sizeToCells];
[matrixHex sizeToCells];

[splitViewForMatrices setVertical:YES];
[splitViewForMatrices setFrameSize:NSMakeSize([splitViewForMatrices 
frame].size.width, [matrixOffset frame].size.height + 4)];
if (matOffset)
{
[splitViewForMatrices replaceSubview:matOffset 
with:matrixOffset];
[splitViewForMatrices replaceSubview:matHex with:matrixHex];
[splitViewForMatrices replaceSubview:matAscii with:matrixAscii];
matOffset = matrixOffset;
matHex = matrixHex;
matAscii = matrixAscii;
}
else
{
[splitViewForMatrices addSubview:matrixOffset];
[splitViewForMatrices addSubview:matrixHex];
[splitViewForMatrices addSubview:matrixAscii];
}
[scrollView setNeedsDisplay:YES];


Please share any insights you may have about the problem.

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


app crashing, some errors in console are related to drawing of UI elements

2010-06-02 Thread Nick Rogers
Hi,
The app sometime (not always) crashes when run on Leopard OS (32-bit) on an old 
mac mini. On Leopard (64-bit) and Snow Leopard, the crash never happens.
The app is GC enabled.

I'm running a separate thread to do some processing, and it does update a few 
text fields and a progress bar on the main window.
The updating of these text fields is done by calling a method 
(updateTreeProgress:) on main thread using performSelectorOnMainThread: 
(waitUntilDone: YES) and passing it an NSMutableDIctionary, the method on main 
thread then picks values from the dictionary and updates the text fields and 
the progress bar.
I have a NSLog at the beginning of this method.
But after its called once, and about to be called second time (an NSLog tells 
me its about to be called using performSelectorOnMainThread:), the NSLog at the 
very beginning of this method doesn't get printed on console.

However, there are other console msgs, that are shown below:

1. updateTreeProgress: called (first time called, only sets min and max value 
of a progress bar and doesn't sets the text fields)
2. Error: CGContextSetFillColorWithColor: invalid context
3. other NSLog msgs
4. Error: CGContextSetTextMatrix: invalid context
5. Error: CGContextSetFont: invalid context
6. Error: CGContextSetFontSize: invalid context
7. Error: CGContextGetShouldSmoothFonts: invalid context
8. Error: CGContextSetFontRenderingStyle: invalid context
9. Error: CGContextSetFillColorWithColor: invalid context
10. Error: CGContextSetStrokeColorWithColor: invalid context
11. Error: CGContextSetTextPosition: invalid context
12. Error: CGContextShowGlyphsWithAdvances: invalid context
13. Error: CGContextSetTextPosition: invalid context
14. Error: CGContextShowGlyphsWithAdvances: invalid context
15. Error: CGContextSetTextPosition: invalid context
16. Error: CGContextShowGlyphsWithAdvances: invalid context
17. Error: CGContextSaveGState: invalid context
18. Error: CGContextTranslateCTM: invalid context
19. Error: CGContextScaleCTM: invalid context
20. Error: CGContextConvertSizeToDeviceSpace: invalid context
21. Error: CGContextConvertSizeToDeviceSpace: invalid context
22. Error: CGContextGetCTM: invalid context
23. Error: CGContextGetAlpha: invalid context
24. Error: CGContextSaveGState: invalid context
25. Error: CGContextSetAlpha: invalid context
26. Error: CGContextGetCompositeOperation: invalid context
27. Error: CGContextSetCompositeOperation: invalid context
28. Error: CGContextDrawImage: invalid context
29. Error: CGContextRestoreGState: invalid context
30. Error: CGContextRestoreGState: invalid context
31. Error: CGContextConcatCTM: invalid context
32. updateTreeProgress: about to be called using performSelectorOnMainThread: 
but doesn't get called. and the app crashes here.

There are other NSLog msgs between these msgs.
Also there are similar msgs, as reproduced below, on system log for various 
system apps which say that ATSServer died
Jun  3 00:30:02 ddlabss-mac-mini 
/Applications/TextEdit.app/Contents/MacOS/TextEdit[1396]: received ATSServer 
died message.  (old server pid = 3221, new pid = 3285, session ID = 256)

Any insights, comments would be greatly appreciated.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


changing dock label name of my app

2009-11-26 Thread Nick Rogers
Hi,
 for some reasons, my app is named like MyApp-1.
And I want the label over the dock icon to appear as MyApp.

how to go about it?

thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: changing dock label name of my app

2009-11-26 Thread Nick Rogers
hi,
thanks for the reply.
actually my app  project itself is named as MyApp. Later I'm renaming it to 
MyApp-1 in the finder before using it (a must).
So the folder hierarchy is MyApp-1/Contents/MacOS/MyApp
And I want it to remain this way and just want to change the dock icon label 
from MyApp-1 to MyApp.

Wishes,
Nick

On 26-Nov-2009, at 2:53 PM, Symadept wrote:

 Project= Edit Active Target
 
 Search for MyApp in the search bar. Whereever you find MyApp-1, replace it to 
 MyApp.
 
 Regards
 Mustafa
 
 On Thu, Nov 26, 2009 at 5:15 PM, Nick Rogers roger...@mac.com wrote:
 Hi,
  for some reasons, my app is named like MyApp-1.
 And I want the label over the dock icon to appear as MyApp.
 
 how to go about it?
 
 thanks,
 Nick
 
 ___
 
 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 Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/symadept%40gmail.com
 
 This email sent to symad...@gmail.com
 

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: changing dock label name of my app

2009-11-26 Thread Nick Rogers
hi,
i'm changing the app name to MyApp-1 only in the finder, still the name 
displayed in the dock when launched is MyApp-1.
i'm using OS 10.6.2.

thanks,
Nick

On 26-Nov-2009, at 3:26 PM, Graham Cox wrote:

 Not 100% sure but isn't the displayed name CFBundleName in the info.plist?
 
 --Graham
 
 
 
 On 26/11/2009, at 8:50 PM, Nick Rogers wrote:
 
 hi,
 thanks for the reply.
 actually my app  project itself is named as MyApp. Later I'm renaming it 
 to MyApp-1 in the finder before using it (a must).
 So the folder hierarchy is MyApp-1/Contents/MacOS/MyApp
 And I want it to remain this way and just want to change the dock icon label 
 from MyApp-1 to MyApp.
 

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


GC, variable optimized away wrongly?

2009-11-25 Thread Nick Rogers
Hi,
In my app running on snow leopard, in a particular situation I'm getting an 
undesired behavior.
Debugging a for loop shows a still in scope variable being optimized away.

code: (problem occurs after the loop has been iterated thousands (may be more) 
of time.

for loop statement here()
{
NSDate *currentDate = [NSDate date];// ok value here
NSTimeInterval interval = [currentDate 
timeIntervalSinceDate:startDate];// ok value here
NSTimeInterval etaDouble = interval  * ((totalBlocks - blockCount) / 
blockCount);   // * debugger doesn't list this variable, mouse shows a pop 
up saying variable optimized away by compiler
int eta = (int)etaDouble;   // value is 0 here instead of something
int seconds = eta % 60; // value is 0 here instead of something
int minutes = (eta / 60) % 60;  // value is 0 here instead of something
int hours = ((eta / 60) / 60) % 24; // value is 0 here instead of 
something
int days = ((eta / 60) / 60) / 24;  // value is 0 here instead of 
something


}

Why the certain variables are not listed in debugger window (only in GC-only 
projects)?
Why is etaDouble is being optimized away?
Any suggestions?


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


programmatically determining whether a system would run a GC only app

2009-10-27 Thread Nick Rogers

hi,
is it possible to do so, if yes how?
googled, seen gestalt, sysctl()... no yield.

thanks
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Moving from standalone apps to some internet related programming

2009-10-26 Thread Nick Rogers

Hi,
In my some 2 yrs of cocoa programming with cocoa, I have been able to  
make a main app (which is selling) and a few related small apps.
Now I have to make a small utility that would download the appropriate  
(best) version of main app that would run on the user system by  
polling for the MacOS type and its ability to run 64-bit apps.

I have no internet related programming experience till now.
Are there any resources available for a beginner for developing such a  
utility.

How should I proceed?

Also how to know if a particular mac would be able to run a 64-bit  
app? Some earlier Macs like PowerPC G4 could run Leopard but are not  
able to run 64-bit apps.


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Moving from standalone apps to some internet related programming

2009-10-26 Thread Nick Rogers

hi,
the package is 6 MB for the demo  11 MB for the full version, so  
packaging all is not desired.


thanks,
Nick

On 27-Oct-2009, at 4:32 AM, Philip Ershler wrote:



On Oct 26, 2009, at 4:50 PM, Nick Rogers wrote:


Hi,
In my some 2 yrs of cocoa programming with cocoa, I have been able  
to make a main app (which is selling) and a few related small apps.
Now I have to make a small utility that would download the  
appropriate (best) version of main app that would run on the user  
system by polling for the MacOS type and its ability to run 64-bit  
apps.

I have no internet related programming experience till now.
Are there any resources available for a beginner for developing  
such a utility.

How should I proceed?

Also how to know if a particular mac would be able to run a 64-bit  
app? Some earlier Macs like PowerPC G4 could run Leopard but are  
not able to run 64-bit apps.


Wishes,
Nick




Depending on the size of your app, might it be easier to package up  
various versions and let the Installer take care if it?


Phil


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to roger...@mac.com


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


is GC not available on 10.5.8?

2009-10-23 Thread Nick Rogers

Hi,
I compiled using Xcode3.2 on 10.6.1, 10.5 base sdk and for Intel 64- 
bit only with GC only option.
The program compiles fine, but the following error is there when  
launching it on 10.5.8 system: (window doesn't appear)


EXC_BREAKPOINT (SIGABRT)

Dyld error message:
unknown required load command: 0x8022

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: is GC not available on 10.5.8?

2009-10-23 Thread Nick Rogers

HI,
I checked all the project and target settings, they are in order and I  
cleaned all targets before testing.


Thanks,
Nick
On 23-Oct-2009, at 5:34 PM, Nick Rogers wrote:


Hi,
I compiled using Xcode3.2 on 10.6.1, 10.5 base sdk and for Intel 64- 
bit only with GC only option.
The program compiles fine, but the following error is there when  
launching it on 10.5.8 system: (window doesn't appear)


EXC_BREAKPOINT (SIGABRT)

Dyld error message:
unknown required load command: 0x8022

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to roger...@mac.com


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


to implement a 1 sec repeating timer in a separate thread

2009-10-22 Thread Nick Rogers

Hi,
I have been trying to implement a 1 second repeating timer, but its  
leading to retaining the target object of a thread from which I'm  
launching this timer thread.

Here's my implementation.

I'm running this method from my thread.
- (void)setUpTimer
{
	timerThread = [[NSThread alloc] initWithTarget:self selector:@selector 
(startTimer) object:nil];

[timerThread start];
}

- (void)startTimer
{
	timer = [NSTimer timerWithTimeInterval:1.0 target:self  
selector:@selector(myTimerFireMethod:) userInfo:nil repeats:YES];

NSRunLoop *theRL = [NSRunLoop currentRunLoop];
[theRL addTimer:timer forMode:NSDefaultRunLoopMode];
	while (keepTimerRunning  [theRL runMode:NSDefaultRunLoopMode  
beforeDate:[NSDate distantFuture]]);

}

- (void)myTimerFireMethod:(NSTimer*)theTimer
{
[self setUpdateStatus:YES];
}

From my thread I'm doing something when updateStatus is YES and then  
I'm setting it to NO, which is again set to YES by this timer, so that  
I get to do something at 1 second interval.
But its leading to referencing the target object of my thread, by 3-4  
non-objects (bytes), which shows different descriptions every time as  
per GC Monitor Instrument (kind of undefined behavior).


Whats wrong with the above scheme, or how can I make it safe?
Googled a lot but couldn't find a simple timer example that would suit  
my need. Can you point me to some example code etc.?


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: to implement a 1 sec repeating timer in a separate thread

2009-10-22 Thread Nick Rogers

Hi,
Thanks for the reply. My question was very vague, I admit.
But now I have moved to your suggestion.
I'm setting up the timer via  [NSTimer scheduledTimerWithTimeInterval:  
1.0 target: self selector: @selector(doSomething:) userInfo: nil  
repeats: YES];

But the doSomething is not getting called at all.
May be because this thread is busy doing something else, so do I have  
to setup the timer in say main Thread.
Earlier I was doing so, by setting up the timer by calling this  
setting up method as [self performSelectorOnMainThread:],  
and it was working, but even after invalidating the timer, the timer  
was still referencing the object that contained NSTimer *timer.


Any suggestions?
Nick

On 22-Oct-2009, at 2:32 PM, Dave Keck wrote:


I'm having a really hard time making sense of you message...

 I have been trying to implement a 1 second repeating timer, but  
its leading

 to retaining the target object

That's expected behavior - NSTimers retain their targets. The target  
won't be deallocated until the timer has been invalidated (assuming  
the timer was the only thing keeping the target alive.)


 But its leading to referencing the target object of my thread, by  
3-4
 non-objects (bytes), which shows different descriptions every time  
as per GC

 Monitor Instrument (kind of undefined behavior).

Woah, this sentence has my completely baffled:

 o Prior to this sentence, you were talking about retaining/ 
releasing, not you're talking about garbage collection. I think I'm  
still following you though - regardless, the timer is keeping the  
target alive.


 o 3-4 bytes of what? Why do these bytes matter?

== Moment of clarity in 3... 2... 1...

Oh. I think you're just trying to have a method called every second.  
If that's the case, no need to concern yourself with threads and...  
well, whatever it is that's going on in that code snippet. :D


   [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self  
selector: @selector(doSomething:) userInfo: nil repeats: YES];


That will call self's -doSomething: method every second. Is that  
what you're trying to accomplish?


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


info gc-roots interpretation

2009-10-21 Thread Nick Rogers

Hi,
I have an ivar in AppController, a pointer to the class Volume.
When running info gc-roots on it before setting it nil, the results are:

(gdb) info gc-roots 0x2004f9340
Number of roots: 40
Root:
   0 Kind: bytes   rc:   1  Address: 0x000200543b40  Offset:  
0x0008

   1 Kind: object  rc:   0  Address: 0x0002004f9340  Class: Volume
Root:
   0 Kind: stack   rc:   0  Address: 0x7fff5fbfeab0  Frame level:  
1  Symbol: unknown
   1 Kind: object  rc:   0  Address: 0x00020015d000  Class:  
AppController  ivar: selectedPTVolume

   2 Kind: object  rc:   0  Address: 0x0002004f9340  Class: Volume
.
.
.
and 38 more, most with rc: 0.

When I set this ivar to nil. the results are:

(gdb) info gc-roots 0x2004f9340
Number of roots: 1
Root:
   0 Kind: bytes   rc:   1  Address: 0x000200543b40  Offset:  
0x0008

   1 Kind: object  rc:   0  Address: 0x0002004f9340  Class: Volume

When I try to run info gc-roots on the first entry, the results are:

(gdb) info gc-roots 0x000200543b40
Number of roots: 1
Root:
   0 Kind: bytes   rc:   1  Address: 0x000200543b40

Is there a retain cycle problem.
The memory gathered by this ivar is not freed, as per Obj-Alloc  
Instrument.


What shall I make out of these results and how can they lead to  
refinement (so that all the memory referenced by this ivar is freed)?


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: info gc-roots interpretation

2009-10-21 Thread Nick Rogers

Hi,
Thanks for all the valuable replies.
I tried GC Monitor instrument and this Volume pointer, is referenced  
by (apart from the AppController object) by just 32 bytes (non-object).
Extended detail description shows different non-related objects on  
different runs.

The stack trace in every such run shows a method [Volume setUpTimer].
While a thread is running with target Volume object, I call setUpTimer  
from this thread using [self performSelectorOnMainThread:@selector 
(setUpTimer) withObject:nil waitUntilDone:YES];
So I don't see any direct access to ivars from this thread. The method  
is as follows:


- (void)setUpTimer
{
	timer = [NSTimer timerWithTimeInterval:1.0 target:self  
selector:@selector(myTimerFireMethod:) userInfo:nil repeats:YES];
	[[NSRunLoop currentRunLoop] addTimer:timer  
forMode:NSDefaultRunLoopMode];  //Run loop needs to be running to fire  
the timer

}
Here timer is an ivar in Volume of type NSTimer*. Is setting timer in  
the above method causing the problem?


Here's the myTimerFireMethod:

- (void)myTimerFireMethod:(NSTimer*)theTimer
{
	[self performSelectorOnMainThread:@selector(setUpdateStatus:)  
withObject:[NSNumber numberWithBool:YES] waitUntilDone:NO];

}

Thanks,
Nick

On 21-Oct-2009, at 9:09 PM, Bill Bumgarner wrote:



On Oct 21, 2009, at 1:39 AM, Nick Rogers wrote:


(gdb) info gc-roots 0x2004f9340
Number of roots: 1
Root:
 0 Kind: bytes   rc:   1  Address: 0x000200543b40  Offset:  
0x0008

 1 Kind: object  rc:   0  Address: 0x0002004f9340  Class: Volume

Is there a retain cycle problem.
The memory gathered by this ivar is not freed, as per Obj-Alloc  
Instrument.


What shall I make out of these results and how can they lead to  
refinement (so that all the memory referenced by this ivar is freed)?


rc: 1 means that the object has been CFRetain'd by something.   
That is, something somewhere decided that it was going to bypass the  
collector and has failed to call CFRelease when done.


Use the ObjectAlloc instrument in Instruments to track it down. You  
can also:


set env MallocStackLoggingNoCompact 1
set env AUTO_REFERENCE_COUNT_LOGGING 1

And then use 'info malloc 0x2004f9340'. It'll typically show all  
CFRetain/CFRelease events.  (But not always -- there is a bug that  
prevents it from showing all of 'em.  However, ObjectAlloc works  
around it.)


b.bum



___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


GC Basic questions

2009-10-20 Thread Nick Rogers

Hi,
Since the methods -release, -retain and -autorelease are no-ops with  
GC only enabled, How do I release everything associated with an ivar  
(pointer to a class) in AppController?

Currently I'm doing it by setting this pointer as nil. Is it ok?

Also when I follow certain steps, this pointer gets a lot of memory  
attached, down the line. which gets released (when I set it to nil) as  
per Obj-Alloc instrument.
But when following another certain steps, this memory doesn't get  
released (when setting this pointer nil), why? With GC only enabled  
this should get freed up.


Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Should VM shrink to original when releasing huge memory

2009-10-13 Thread Nick Rogers

Hi,
I'm using Snow Leopard and Xcode 3.2.
When my program runs the VM grows from 50MB to around 550MB.
So when I release the memory, should VM shrink to the original 50MB,  
in this case it isn't so?


Thanks,
Nick


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Object Alloc Instrument and releasing question

2009-10-13 Thread Nick Rogers

Hi,
I'm running Xcode 3.2 on Snow Leopard.
There is an object of type HDIR which can contains a mutable array of  
children objects of type HDIR, so a tree is formed.
I can go back using the Back button and release this HDIR type root  
object.

And then again form a new tree.
When a tree is formed the VM according to Activity Monitor reaches a  
high value and when I release this tree, it doesn't come any lower,  
but when I again form the tree, it starts increasing from that max  
value.
Does it mean that VM is not being freed, due to some bug in my  
releasing the tree?


Here is some Object Alloc instrument data after the first tree is  
formed (1), after releasing that tree (2) and after again making a  
tree (3):

CategoryLive Bytes  #Living #Transitory 
Overall Bytes   #Overall
1.  HDIR1.73 MB 10333   10428   
3.48 MB 20761
2.  HDIR0   0   20761   
3.48 MB 20761
3.  HDIR1.73 MB 10333   31189   
6.97 MB 41522

Does the #Living being added to #Transitory means that tree is not  
actually freed?


The Instrument docs says about Object Alloc:

This instrument captures the following information:

Category - typically a Core Foundation object, an Objective-C class,  
or a raw block of memory.
Net Bytes - the number of bytes of this type currently allocated but  
not yet released.
# Net - the number of objects or memory blocks of this type currently  
allocated but not yet released.
Overall Bytes - the total number of bytes of this type that have been  
allocated, including those that have been released.
# Overall - the total number of objects or memory blocks of this type  
that have been allocated, including those that have been released.
# Allocations (Net / Overall) - A histogram of the current and total  
counts. The bars are normally shades of blue. They are colored shades  
of yellow when the ratio between the total number of objects and the  
peak, or the ratio between the peak and the current number, is 1/3 or  
less. The bars are shades of red when the ratio is 1/10 or less.

It doesn't list the meaning of #Transitory.

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSZombieEnabled giving rise to new bug

2009-10-12 Thread Nick Rogers

Hi,
I order to track a bug which made an outline view hang the GUI, I set  
NSZombieEnabled with value YES in the app's environment variable.
Now even before I could get to the point of GUI hangs the following is  
reported in console:


2009-10-12 20:28:53.651 My Program[33987:6263] *** -[CFArray count]:  
message sent to deallocated instance 0x1149a9310

[Switching to process 33987]
[Switching to process 33987]
sharedlibrary apply-load-rules all
2009-10-12 20:29:03.917 My Program[33987:6263] *** NSInvocation:  
warning: object 0x1149a9310 of class '_NSZombie_CFArray' does not  
implement methodSignatureForSelector: -- trouble ahead
2009-10-12 20:29:03.918 My Program[33987:6263] *** NSInvocation:  
warning: object 0x1149a9310 of class '_NSZombie_CFArray' does not  
implement doesNotRecognizeSelector: -- abort

kill
quit

The code is so complex and its also hard to reach the point where I'm  
doing the wrong -[CFArray count].
Is it possible to some how to get it automatically stop at [CFArray  
count] OR is it possible to set a breakpoint at all [CFArray count] in  
Xcode or in .gdbinit.


Any other suggestions are also welcome.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


releasing an object

2009-10-10 Thread Nick Rogers

Hi,
There is a instance variable in my AppController class named Volume.
I'm doing alloc and initWithDictionary to get an instance of Volume.
I have to do [selectedPTVolume retain]; when allocing to get it to  
work properly.
 When destroying this object to get a new one, I'm doing  
[selectedPTVolume release]; but then the retainCount is still one.
If I release it twice, the GUI hangs (selectedPTVolume contains the  
root item of a outline view).


How to release it properly?
Shall I get its retainCount and then release it that many times?

Thanks,
Nick


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: releasing an object

2009-10-10 Thread Nick Rogers

Hi, Thanks for the reply.

In AppController.h I have an ivar:
Volume *selectedPTVolume;

In a method in AppController, I have the following:
NSMutableDictionary *data = [partitionListDictArray objectAtIndex: 
[tableViewPTList selectedRow]];

selectedPTVolume = [[Volume alloc] initWithDictionary:data];
[selectedPTVolume retain];// if I comment this the GUI hangs,  
selectedPTVolume contains an ivar HDIR *dirRoot; which is passed as  
the root item of an outline view. dirRoot has an mutable array, which  
contains other HDIR objects as its children and so on a tree is formed.


In a method, where I need to release selectedPTVolume, I have:
if (selectedPTVolume)
{
	volumeScanType = [selectedPTVolume volumeScanType];//  
selectedPTVolume retainCount = 2 here

[selectedPTVolume release];
[selectedPTVolume release];// selectedPTVolume retainCount = 1 here
	selectedPTVolume = nil;// selectedPTVolume retainCount = 0 here and  
sometimes still shows as 1 while debugging.

if (outlineViewData)
[outlineViewData reloadData];/ crashes here
}

Releasing selectedPTVolume also releases HDIR *dirRoot.

Wishes,
Nick


On 10-Oct-2009, at 4:06 PM, Graham Cox wrote:



On 10/10/2009, at 9:31 PM, Nick Rogers wrote:


Shall I get its retainCount and then release it that many times?



For heavens' sake, NO!

Ignore retain counts. They are not reliable evidence of anything you  
can use. Instead, just follow the rules:


http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html


I'm doing alloc and initWithDictionary to get an instance of Volume.
I have to do [selectedPTVolume retain]; when allocing to get it to  
work properly.


Show your code. This sounds wrong, but without seeing the code it  
can't really be inferred from the description.





--Graham




___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


releasing a object containing others in a array

2009-10-03 Thread Nick Rogers

Hi,

I have a class as following:

@interface NodeTypeOrph : NSObject {
int count;
ItemTypeOrph*key[4];   // Warning: indexing starts at 0, not 1
NodeTypeOrph*branch[5];   // Fake pointers to child nodes
}

when I'll send a release to an object of this type, will it  
automatically release the arrays of ItemTypeOrph and NodeTypeOrph  
objects.

Or do I have to explicitly traverse and release?

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSRunLoop method - configureAsServer alternative in 10.6.1?

2009-09-30 Thread Nick Rogers

Hi,
When I use [[NSRunLoop currentRunLoop] configureAsServer]; after  
creating a service using NSConnection, it works.
But -configureAsServer is declared as deprecated with no alternative  
suggested.

I tried removing it and the code doesn't work.

server code snippet: (doesn't work)

MYMessageServer   *server = self;// here self is in instance of  
MyMessageServer class

NSConnection  *defaultConnection;
[[NSNotificationCenter defaultCenter] addObserver:server
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:nil];
defaultConnection = [NSConnection  
serviceConnectionWithName:@MyCompanyName.MyProductName.serverFull  
rootObject:server];

[defaultConnection addRunLoop:[NSRunLoop currentRunLoop]];
// not doing [[NSRunLoop currentRunLoop] run]; here as its the main  
thread.


Client code snippet:
server = [[NSConnection  
rootProxyForConnectionWithRegisteredName 
:@MyCompanyName.MyProductName.serverFull host:nil] retain];

server is nil after the above line is executed.

Where can I find a simple implementation?
Or what changes to make to the above code?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [Solved] NSRunLoop method - configureAsServer alternative in 10.6.1?

2009-09-30 Thread Nick Rogers

Hi,
Very basic error:
did [defaultConnection retain];
in server code.
Seems very basic but when I was doing - configureAsServer, it was  
working without retaining.


Thanks,
Nick

On 30-Sep-2009, at 7:53 PM, Nick Rogers wrote:


Hi,
When I use [[NSRunLoop currentRunLoop] configureAsServer]; after  
creating a service using NSConnection, it works.
But -configureAsServer is declared as deprecated with no alternative  
suggested.

I tried removing it and the code doesn't work.

server code snippet: (doesn't work)

MYMessageServer   *server = self;// here self is in instance of  
MyMessageServer class

NSConnection  *defaultConnection;
[[NSNotificationCenter defaultCenter] addObserver:server
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:nil];
defaultConnection = [NSConnection  
serviceConnectionWithName:@MyCompanyName.MyProductName.serverFull  
rootObject:server];

[defaultConnection addRunLoop:[NSRunLoop currentRunLoop]];
// not doing [[NSRunLoop currentRunLoop] run]; here as its the main  
thread.


Client code snippet:
server = [[NSConnection  
rootProxyForConnectionWithRegisteredName 
:@MyCompanyName.MyProductName.serverFull host:nil] retain];

server is nil after the above line is executed.

Where can I find a simple implementation?
Or what changes to make to the above code?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to roger...@mac.com


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Xcode3.2 build and analyze warning for NSString allocation

2009-09-27 Thread Nick Rogers

Hi,

When I alloc and init a NSString the following way, there is warning  
that:
Potential leak of an object allocated on line 526 and stored in  
sizeDisp.
		1. Method returns an Objective-C object with a +1 retain count  
(owning reference).
	2. Object returned to caller as an owning reference (single retain  
count transferred to caller).
	3. Object allocated on line 526 and stored into 'sizeDisp' is  
returned from a method whose name  
('tableView:objectValueForTableColumn:row:') does not contain 'copy'  
or otherwise starts with 'new' or 'alloc'.  This violates the naming  
convention rules given in the Memory Management Guide for Cocoa  
(object leaked).


The code is as follows:

if ([[tableColumn identifier] isEqual:@Size] == YES)
{
NSString *sizeDisp;// line 526
NSNumber *size = [data objectForKey:@kDeviceSize];
unsigned long long sizeInBytes = [size 
unsignedLongLongValue];
if (sizeInBytes  1000*1000)
{
sizeDisp = [[NSString alloc] initWithFormat:@%.2f KB, ((float) 
sizeInBytes/1000)];

}
else if (sizeInBytes  1000*1000*1000)
{
sizeDisp = [[NSString alloc] initWithFormat:@%.2f MB, ((float) 
sizeInBytes/(1000*1000))];// warning number 1 (as listed above)

}
else
{
sizeDisp= [[NSString alloc] initWithFormat:@%.2f GB, ((float) 
sizeInBytes/(1000*1000*1000))];

}
return sizeDisp;// warning 2  3 (as listed above)
}

When I do sizeDisp = [NSString stringWithFormat:@%.2f MB, ((float) 
sizeInBytes/(1000*1000))];

The warning disappears in the next build and analyze.

Can I hope for a small analysis of the above from anybody?

Thanks,
Nick


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Stability on Snow Leopard

2009-09-22 Thread Nick Rogers

Hi,
The program which worked perfectly on Leopard, crashes frequently at  
various stages on Snow Leopard.
Also it may or may not crash at the same stage on different runs, e.g.  
on bringing up a NSSavePanel in a sheet.


What do I need to do to make it robust on Snow Leopard. Is it less  
forgiving in terms of Memory Management?

Do I need to go for code signing, will that help improve stability?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


basic threading question: if parent thread completes

2009-09-17 Thread Nick Rogers

Hi,
I need to know this before going in for changes that are too complex.

I spawned a thread from AppController (thread1).
From thread1, I spawn another thread2.
thread1 completes.
Will thread2 terminate, give rise to anything else, or just keep on  
working usually?


Wishes,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


saving files/folders in foreign language names

2009-08-31 Thread Nick Rogers

Hi,
I have the following hierarchy to save programatically (e.g.):

my english path name/some french dir name/some french file name.file

Now I'm using NSFileManager to do this:
1. create a folder at my english path name. correctly done.
2. change current dir to my english path name and creating some  
french dir name. correctly done.
3. change current dir to my english path name/some french dir name.  
fails as the file is saved eventually in the folder my english path  
name 's last dir, and not in some french dir name.
4. I write to the file using write(), for this I get the FileHandle  
(using NSFileHandle) and then file descriptor from file handle. The  
data goes into the file but after closing the file handle, the file is  
showing zero bytes.


I need to fix this immediately.
Please help.
What other options I have besides NSFileManager and NSFileHandle, that  
would work?


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


debug control not reaching init method

2009-08-20 Thread Nick Rogers

Hi,
This is my third app in Xcode3. Had to use Xcode3 becuase it has to be  
a 64-bit app.


In earlier two apps, the control reaches to the breakpoint on the  
first line of the init method of AppController class, while debugging.


But in this third one, it is not reaching the breakpoint, and the  
window appears.
TableView data source methods are being called (in AppController) as  
the table view shows data.


I have tried everything. Clean All Targets, checked all target  
memberships of all the classes.

Same is happening when I set the config to i386.
The mode set is debug.

What I may be missing here?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


which temp dir to use?

2009-05-23 Thread Nick Rogers

Hi,
NSTemporaryDirectory(), returns something like /var/temp/we/weOIDM 
+mck

Whereas I want to store files at a place with a fixed path.

So where should I save temp files? and how can I get that path  
programatically everytime?


Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


To run a block of code at every 1 second

2009-03-03 Thread Nick Rogers

Hi,
Here's the code:

the following method is running in a separate thread:

- (void)myFucntion
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

	for (;;)// for loop starts here and is very quick, 100s of iterations  
per second

{

{
// this block of code needs to be run at around 1 
second interval
// code here
			[appController  
performSelectorOnMainThread:@selector(updateProgress:) withObject:data  
waitUntilDone:YES];

}
// other loop code here
}
[loop release];
}

I have tried some crude methods for implementing this running of block  
of code at 1 second interval but they don't perform as expected, for  
that I used running a separate thread setting a BOOL var to YES at  
every 1 second.


Is there a better way to do it?

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


autorelease problem

2009-01-26 Thread Nick Rogers

Hi,

My program is crashing when releasing the NSAutoreleasePool.
I have in my code:

- (void)MyFunction
{
while (count)
{
NSAutoreleasePool *innerloop = [[NSAutoreleasePool alloc] init];
HDIR *dir = [someArray objectAtIndex:count];
		NSString *fileNameNew = [self suggestedRepeatFileName:[dir fileName]  
inDir:someDir];

[dir setFileName:fileNameNew];
[innerloop release];//crashing here
count--;
}
}

- (NSString*)suggestedRepeatFileName:(NSString *)fileName inDir:(HDIR  
*)dir

{
// some code here
	NSString *fileNameReturned = [NSString stringWithFormat:@%@,  
someString];

return fileNameReturned;
}

Is there any problem with the code here?
Please help.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: autorelease problem

2009-01-26 Thread Nick Rogers

hi,
thanks for the reply.
someString in the method suggestedRepeat... is an NSMutableString  
allocated and initialized within that method.


-[HDIR setFileName] is as follows:
- (void)setFileName:(NSString *)name
{
name = [name copy];
[fileName release];
fileName = name;
}

Also the [innerloop release]; is crashing the first time through the  
loop.


Regards,
Nick

On 26-Jan-09, at 10:53 PM, Matt Gough wrote:



On 26 Jan 2009, at 18:12, Nick Rogers wrote:

- (NSString*)suggestedRepeatFileName:(NSString *)fileName inDir: 
(HDIR *)dir

{
// some code here
	NSString *fileNameReturned = [NSString stringWithFormat:@%@,  
someString];

return fileNameReturned;
}

Is there any problem with the code here?



Hard to tell without knowing where someDir or someString came from,  
or what -[HDIR setFileName] is up to.


Does it crash the first time though the loop or later?

Matt


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSTextField super imposes the text

2008-12-26 Thread Nick Rogers

Hi,
I have to frequently show text in the status field of my app.
The status field is an NSTextField.
but it super imposes the text that is sent to it thru setStringValue:
I tried setting the text to @, between the calls, but to no avail.
This is happening only in Prior-Leopard Mac OSX.

please help.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSActionCell, is there a double click?

2008-12-26 Thread Nick Rogers

Hi,
I have the outlineview cell which is a subclass of NSActionCell.
I can set its target and action with setTarget: and setAction:.
But it invokes the method on single click.
Whereas I want the method to be called only on double click, I have  
seen the docs and there is no method like setDoubleAction.


How to do it.

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTextField super imposes the text

2008-12-26 Thread Nick Rogers
Here super-imposition means that text appears garbled and is put over  
the previous text.


Thanks,
Nick

On 26-Dec-08, at 7:48 PM, Nick Rogers wrote:


Hi,
I have to frequently show text in the status field of my app.
The status field is an NSTextField.
but it super imposes the text that is sent to it thru setStringValue:
I tried setting the text to @, between the calls, but to no avail.
This is happening only in Prior-Leopard Mac OSX.

please help.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to roger...@mac.com


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSActionCell, is there a double click?

2008-12-26 Thread Nick Rogers

Thanks for the reply.

I have earlier tried setDoubleAction: for the entire outlineview, but  
its working only on Leopard and not before Leopard.
I'm setting the dataCell of all the columns as non-editable, may be it  
has something to do with that.
But I have also tried setting the desired column's dataCell as both  
editable and non-editable.

Even then it doesn't work on Prior-Leopard.

Thanks,
Nick

On 26-Dec-08, at 8:01 PM, Jerry Krinock wrote:



On 2008 Dec, 26, at 6:23, Nick Rogers wrote:


I have the outlineview cell which is a subclass of NSActionCell.
I can set its target and action with setTarget: and setAction:.
But it invokes the method on single click.
Whereas I want the method to be called only on double click, I have  
seen the docs and there is no method like setDoubleAction.


How to do it.


It looks like you must set the action for the entire table --  
NSTableView has a setDoubleAction: method.


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to roger...@mac.com


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


saving filename suggestion in NSSavePanel

2008-12-23 Thread Nick Rogers

Hi,
I looked the docs for NSSavePanel, but it doesn't list any method for  
putting in a suggested filename to the user.

How to do it?

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Memory Management Q. 1 and 2

2008-12-21 Thread Nick Rogers

Hi,
While learning to program in cocoa, people usually start out without  
giving much thought to memory management especially about freeing the  
used up memory.
I can say so, because I know a few people like that and also I'm one  
of them.
My focus was on to get started on the project quickly and complete it  
ASAP.
But now that its almost finished up, I'm forced to think about freeing  
memory.

These are 2 questions in a series of more upcoming ones.

1. There is an instance variable (NSMutableArray*) in my object, that  
I use to hold a large number of elements.

Now when I destroy this object, I don't release the array.
Will it have any effect like making the program crash, subsequently?
Especially when I again create the same kind of object again and again  
fill the array.


2. I'm feeding an object of type HDIR* named dirRoot to the  
NSOutlineView.
This HDIR can have a number of children of type HDIR* stored in an  
NSMutableArray * named children (an ivar in HDIR object).

So its a tree.

When I run the program, the Activity Monitor shows the virtual memory  
increasing as this tree is populated.
After a substantial increase in VM, I stop the tree and then release  
this dirRoot (HDIR*) object.

But at this time the VM remains the same in Activity Monitor.
The dirRoot may also be retained by some other object, but I have  
taken care to release those objects as well.
So my question is whether this tree is released and the VM shown in  
Activity Monitor may not be released back to the system.

OR the tree may not have been released at all?

the dealloc method of HDIR is as follows:
- (void)dealloc
{
if (children)
{
while ([children count])
{
HDIR *child = [children lastObject];
[children removeLastObject];
[child release];
}
[children release];
children = nil;
}
if (fileName)
{
[fileName release];
}
if (pathName)
{
[pathName release];
}
[super dealloc];
}

Is there a problem in this method?

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


splash screen how to?

2008-12-17 Thread Nick Rogers

Hi,
I have to show a splash screen at the software launch.
The window should have no edges etc and should stay for a few seconds.
How to go about it?
Is there any good resource available for this?

Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


how to pass arguments by reference

2008-12-10 Thread Nick Rogers

Hi,
I have the following in my .m file:


- (UInt32)traverseTreeStraightReturnedDirection:(int)treeDirection
  returnedTreeDepth:(int)treeDepth
returnedKey:(HPlusCatalogKey)catKey
 lookForKey:(HPlusCatalogKey)lastKey
{
// code here
}

But the error when compiling is parse error before  token.
Is passing by reference not allowed or is there any other syntax that  
I should follow?


Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: how to pass arguments by reference

2008-12-10 Thread Nick Rogers

Hi, thanks for the reply.
Now I have:

- (UInt32)traverseTreeStraightReturnedDirection:(int)treeDirection
  returnedTreeDepth:(int)treeDepth
returnedKey:(HPlusCatalogKey)catKey
 lookForKey:(HPlusCatalogKey)lastKey
{
// code here
}

Still the same error: parse error before  token

Thanks,
Nick

On 10-Dec-08, at 9:15 PM, Dave DeLong wrote:


Put the  before the variable type:

- (UInt32) traverseTreeStraightReturnedDirection: 
(int)treeDirection...


HTH,

Dave

On Dec 10, 2008, at 8:43 AM, Nick Rogers wrote:


Hi,
I have the following in my .m file:


- (UInt32)traverseTreeStraightReturnedDirection:(int)treeDirection
  returnedTreeDepth:(int)treeDepth
returnedKey:(HPlusCatalogKey)catKey
 lookForKey:(HPlusCatalogKey)lastKey
{
// code here
}

But the error when compiling is parse error before  token.
Is passing by reference not allowed or is there any other syntax  
that I should follow?


Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%40mac.com

This email sent to [EMAIL PROTECTED]


___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


any control over NSRunAlertPanel placing on screen

2008-12-04 Thread Nick Rogers

Hi,
I want the alert panel to be placed in the middle of my main window.
Is it possible?

I gather that NSRunAlertPanelRelativeToWindow() is declared deprecated.


Thanks,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


to get handle to File/1.jpg

2008-11-26 Thread Nick Rogers

Hi,
How do I obtain a NSFileHandle to this file which has a forward slash  
in the name to be able to write to this file.

Supplying the path to NSFileHandle with filename in quotes also fails.
If not possible is there any other way to write to such a file.
I can't use open(), as the file name could contain chars from other  
language.


Thanks,
nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


placing a window in the top left corner

2008-11-19 Thread Nick Rogers

Hi,
whenever my app opens a second preview window, I want it to be  
positioned at the top left corner of the desktop screen.


I have come across two methods in NSWindow, they are:
– setFrameTopLeftPoint:
and
– cascadeTopLeftFromPoint:
But these require a point as input.
How do I calculate this point?
Also if the user has the dock vertical on the left side, how do I  
adjust for that?

What if the user has different resolution like 800x600?

Thanks,
Nick___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSOutlineView setDoubleAction: working on 10.5, but not on 10.4.11

2008-11-15 Thread Nick Rogers

Hi,
when double clicking on an item the action method is not being called  
in 10.4.11.

While the Apple docs say it is Available in Mac OS X v10.0 and later.
Is there something I may be missing.
Its working fine on Leopard.


Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


to raise another cocoa app's window from the dock

2008-11-04 Thread Nick Rogers

Hi,
Have searched the net a lot and even tried AppleScript-enabling the  
app, but nothing would work.


My app should be able to bring to front another cocoa app's window to  
the front.
I have tried SetFrontProcess(), but all it does is to bring the menus  
to the front and not the minimized window of another app.
This is possible and also without AppleScript, as I have seen another  
commercial app (unrelated) do the same thing (i.e. raising the  
minimized window to the front).
That app's dictionary doesn't show in script editor, so I guess they  
may have done it without AppleScript.

Please help.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


how to prevent sleep mode when app is running

2008-06-12 Thread Nick Rogers

Hi,
When the computer goes into sleep mode my app also seems to be taking  
forever in doing the current task.
So how can I prevent the computer from going into sleep mode when my  
app is running?


Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


how to run my app in privileged mode

2008-06-03 Thread Nick Rogers

Hi,
I wish to access disk sectors using open() and pread(). but it fails  
for the system disk.
So how can I get the user to type in admin passwd and then run my app  
in privileged mode.

Please point me to any sample code etc.
I tried BetterAuthorizationSample code from apple, but using it to  
access disk sectors is 10 times slower then open() and pread(), cause  
it installs a helper tool in the system and to get sectors from it is  
slow.


Wishes,
Nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


how to implement ETA

2008-06-01 Thread Nick Rogers

Hi,
I want to show time remaining while executing a loop.
How to go about it?

WIshes,
nick
___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


main menu's missing connection

2008-06-01 Thread Nick Rogers

Hi,
In the instance window there is a yellow dot on the main menu as well  
as the main window.

How to find which children has a bad or missing connection?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


creating a resource fork and writing raw bytes to it

2008-05-21 Thread Nick Rogers

Hi,
My app has to create the resource fork of a file and then write raw  
bytes picked up from the disk to it.

Is there any support in cocoa for this.

For writing to the data fork I'm creating the file with NSFileManager  
and then writing using write().

Is there any similar mechanism for creating resource fork.
Have googled a lot, but to no avail.

Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


whether to use NSSavePanel or something else

2008-05-19 Thread Nick Rogers

Hi,
I have to let the user browse thru the filesystem and choose a  
directory for saving some data.

So is NSSavePanel right for the job or there is something else too.
cause from what I gather NSSavePanel requires to type in a fileName  
and then returns the path to that file.

Where as I don't want the fileName typing field in the save panel.

WIshes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


holding NSOutlineView from display

2008-05-09 Thread Nick Rogers

Hi,
my app has only one window, with the outline view in a tab, which I  
show after the data is ready.
The problem is how can I hold outline view until, the data is ready  
completely.


I gather that I'd have to do something with the method:

- (id)outlineView:(NSOutlineView *)ov child:(int)index ofItem:(id)item
{
if (item)
return [item childAtIndex:index];
else
return [selectedPTVolume dirRoot];
}

if I return nil in this method (until my data is ready) instead of  
dirRoot, will it do the trick, and will i have to make changes to  
other methods in my outlineview implementation?

If this doesn't work is there any other way?

Wishes,
nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


do i have to convert each unichar on ppc and intel

2008-04-30 Thread Nick Rogers

hi,
I'm using:
[NSString stringWithCharacters:gptEntry.partName length:36];
where gptEntry struct have been filled in from the disk.
The string shows correct on ppc, while shows garbage on intel.
So how can I convert an entire such unichar array to correct-endian  
format?

Is there any built-in support?

Thanks,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSImage and NSImageView issues (not drawing correctly)

2008-04-23 Thread Nick Rogers

Hi,
1. I'm using:
NSImage *image = [[NSImage alloc] initWithData:data];
NSImageRep *imageRep = [image bestRepresentationForDevice:nil];
NSImage *imageToBeDrawn = [[NSImage alloc] init];
[imageToBeDrawn addRepresentation:imageRep];
if ([imageToBeDrawn isValid] == YES)
[previewImage setImage:imageToBeDrawn];
else
[previewImage setImage:nil];
[data release];

// where previewImage is of (NSImageView *) type.

But certain images (even the small size like 100KB) are not  
completely drawn, and the display shows garbled image.
certain PNG image shows only a black rectangle. only some small  
images are drawn in good quality.


2. Can I show text in NSImageView. Certain same category software are  
showing text in the same place as their NSIMageView. So I was  
wondering, how thats possible. (I have checked their nib files, and  
the text show at the same place as thier NSImageView).




Any help would be greatly appreciated.
Wishes,
Nick

___

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 Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


  1   2   >