bare bones app crashing, is it a code signing issue?

2017-10-12 Thread Navneet Kumar
Hi,
I have MacOS High Sierra and Xcode 9.
When I start a new project without any development team, choosing Obj-c, and 
adding nothing to the code, the app starts and shows the window.

Now I added my Apple ID in Xcode accounts preferences, a cert is created and a 
personal team is created bearing my name.
I am not part of Developer Program.

Now if I create a new project, this time choosing the personal team and adding 
nothing to the code, the app crashes.
The only warning when compiling is about unable to build chain to self signed 
root.
I have set the cert to “Always trust” for all in keychain access. 

Main Thread-> EXC_BAD_INSTRUCTION at instruction ud2.

Same happens with other projects where I have coded and tried to code sign.

Please help.

Thanks,
Navneet
___

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: Focus ring of NSComboBox and text field visible through overlaid views

2017-06-30 Thread Navneet Kumar
Hi,

Thanks for the valuable insights.
I think I’m gonna go with child windows and not sheets as I have to support os 
x 10.7.

Thanks again,

Navneet

> On 30-Jun-2017, at 11:25 PM, Quincey Morris 
>  wrote:
> 
> On Jun 30, 2017, at 08:07 , Navneet Kumar  <mailto:navnee...@me.com>> wrote:
>> 
>> I also have a small project uploaded […]
>> 
>> Which shows both the focus ring problem and tooltip problem
> 
> I don’t know why, but the focus ring doesn’t bleed through for me (Xcode 9, 
> macOS 10.12).
> 
> However, I think your solution in the test project is correct: change the 
> first responder. My reasoning is philosophical. The window doesn’t really 
> understand the view geometry as perceived by the user. That fact that 
> siblings overlap (in terms of frame rectangles) doesn’t mean it looks that 
> way when transparency and possibly tricky event routing are involved. As far 
> as the window is concerned, though, firstResponder is firstResponder, and it 
> seems wrong for the combo box to keep the focus ring if you can’t type in it 
> (if keystrokes don’t go there by default). Note that you could set 
> firstResponder to the window instead of one of the overlay views, with 
> approximately the same effect.
> 
> In regard to the tooltip, the correct outcome is a bit murky for the same 
> reason. The window truly doesn’t know that the significant piece of real 
> estate is occluded from the user’s point of view. (Plus, the current behavior 
> may well be left over from the days when siblings weren’t really supposed to 
> overlap.) I don’t see that you have much choice but to kill the tooltips when 
> displaying the overlay, and restore them later.
> 
> However, I think the real answer is to use a child window. You really do have 
> window-occlusion mechanics — the part of your current window that’s under the 
> overlay effectively loses “key” status — and using a separate window would 
> resolve the ambiguity of your intentions (from the window’s point of view).
> 
> A sheet may work for this, especially since it’s possible to customize the 
> placement of a sheet within its window — it doesn’t have to be at the top. 
> Also, since the last couple of versions of macOS (10.10+, maybe?), you can 
> display a sheet on top of a sheet if you want.
> 
> Or, use a separate window and set it to be a child of the initial window. 
> I’ve never done it, but it’s been mentioned on this list several times, and 
> it seems straightforward.
> 
> The child window or sheet might also so another slight problem in your sample 
> app. The overlay has a shadow, but it’s the wrong shadow for macOS’s window 
> composition metaphor. It’s a subtle thing, and you may actually prefer the 
> “wrong” shadow, but using separate windows would give you the standard shadow 
> look (and give it to you for free).
> 

___

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: Focus ring of NSComboBox and text field visible through overlaid views

2017-06-30 Thread Navneet Kumar
Hi,

Thanks for the reply.
Yes I admit that question was at best vague.
And the last couple of lines of your email says correctly, that I have to float 
alerts on top of the rest of the window contents. But not just alerts….
Here is the scenario:

I have the window with a lot of UI elements like a outline view which 
highlights rows when mouse hovering and a custom view which has a lot of small 
square views as its subviews and each such square has a tooltip. I also have 
hover buttons on the window. All these views are in tab view’s tabs, I change 
tabs as I progress further when taking input from the user.

Now I have to show not just small alert like views but some elaborate views 
having a lot of small elements like that are in the window, on top of the 
window. So first I overlap the window by adding a layer-backed transparent view 
to self.window.contentView. And then add my top view to this transparent view 
as its subview. The transparent view is there just to give a drop shadow to the 
top view. Some times depending on app’s processing I also show another top view 
(maybe small alert like or maybe a bit more complex) over the current top view. 
For this I again add a transparent sub view to window’s contentView and add the 
new top view to this transparent view.

So I kind of cascade views.

While this approach was working fine. The focus ring belonging to a combo box 
on the window seeped thru to the last top view.
Also the tooltip in small square views on the window are visible even when 
covered by overlapping views.

I hope I have been able to describe the problem better now.

I also have a small project uploaded at 
http://s000.tinyupload.com/?file_id=49187580361848226909 
<http://s000.tinyupload.com/?file_id=49187580361848226909>

Which shows both the focus ring problem and tooltip problem and I have inserted 
appropriate comments in the method - 
(IBAction)buttonToAddViewsClicked:(id)sender in ViewController.m

I don’t know If I abandon this approach and use sheets, will I be able to put a 
sheet over another sheet. OR I just might use separate windows for this, but 
this overlapping views thing seems much easier if not for these problems.

I also read in this article which has comments by ex-apple engineers saying 
overlapping sibling views (layer-backed or not) are okay since os x 10.5.
link: 
https://stackoverflow.com/questions/10720062/are-layer-backed-nsview-siblings-allowed-to-overlap
 
<https://stackoverflow.com/questions/10720062/are-layer-backed-nsview-siblings-allowed-to-overlap>

Wishes,
Navneet

> On 27-Jun-2017, at 10:56 PM, Quincey Morris 
>  wrote:
> 
> On Jun 27, 2017, at 06:57 , Navneet Kumar  <mailto:navnee...@me.com>> wrote:
>> 
>> A custom view when overlapped with a transparent view (subview to window’s 
>> contentView) and a subview on top of transparent view, also shows the custom 
>> cursor and tooltip assigned to the custom view. Even when the custom view’s 
>> tracking area is with option NSTrackingActiveInVisibleRect.
> 
> This may be the correct behavior. If the overlapping view *doesn’t* have a 
> tracking area, there may be nothing to change the cursor back again when it 
> enters the overlapping view from the custom view. What happens depends on 
> exactly what how you implement setting the cursor, and the behavior can be 
> quite subtle and difficult to follow.
> 
>> Sadly I got no responses, not even some clue to guide me in the right 
>> direction….
> 
> I don’t think anyone fully understands your scenario. You refer to the 
> various views so vaguely that I can’t keep track. (You’re having trouble with 
> a custom view, but your image shows an issue with a combo box. Is that the 
> custom view or is something else the custom view? What does "--subview—>” 
> mean? Is it a subview relationship, or does it represent an intermediate 
> subview in the hierarchy?)
> 
> You would need to lay out the exact hierarchy of your window, with the 
> geometry of all the views (i.e. how they overlap). That’s not so easy in a 
> test message. You could try posting a sample project somewhere, and a few 
> people might be prepared to look at it in details.
> 
> However, based on the image you posted, it kinda looks like your intention is 
> to “float” some kind of alert over the rest of the window contents. If that’s 
> what you’re doing, you might have better success if you use a child window 
> rather than subviews. Or a sheet.
> 

___

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: Focus ring of NSComboBox and text field visible through overlaid views

2017-06-27 Thread Navneet Kumar
Hi everyone,

The problem is still there.
The problem is everywhere in my project.
A custom view when overlapped with a transparent view (subview to window’s 
contentView) and a subview on top of transparent view, also shows the custom 
cursor and tooltip assigned to the custom view. Even when the custom view’s 
tracking area is with option NSTrackingActiveInVisibleRect.

So far I have been finding workarounds for this, like disabling combo boxes and 
setting tool tip to nil while the view is being overlapped.

Sadly I got no responses, not even some clue to guide me in the right 
direction….

Is it too dumb of a question? Something very basic I maybe missing?

Please look at the earlier question, it has a link to a image showing the 
problem.

Please help.

Navneet

> On 16-May-2017, at 9:44 PM, Navneet Kumar  wrote:
> 
> Hi,
> 
> I have the following view hierarchy in question:
> 
> self.window.contentView --subview--> Transparent view (in code, main purpose 
> to have a drop shadow for subview) of same size with setWantsLayer and a drop 
> shadow, also acceptsFirstResponder --subview--> a smaller centred view 
> (subclassed for background colour using NSRectFill()), doesn't have layer.
> 
> The problem is that the focus ring belonging to a combo box (in the 
> self.window.contentView) is visible through to the last subview.
> 
> The image is uploaded and url is: http://i63.tinypic.com/2v3sk6b.jpg
> 
> Tried with all combinations of isOpaque and acceptsFirstResponder etc in all 
> concerned views.
> How to make it go away without having to part with focus ring (they are there 
> for a purpose)?
> 
> Thanks,
> Navneet
> 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/navneet_6%40me.com
> 
> This email sent to navnee...@me.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


Focus ring of NSComboBox and text field visible through overlaid views

2017-05-16 Thread Navneet Kumar

Hi,

I have the following view hierarchy in question:

self.window.contentView --subview--> Transparent view (in code, main purpose to 
have a drop shadow for subview) of same size with setWantsLayer and a drop shadow, 
also acceptsFirstResponder --subview--> a smaller centred view (subclassed for 
background colour using NSRectFill()), doesn't have layer.

The problem is that the focus ring belonging to a combo box (in the 
self.window.contentView) is visible through to the last subview.

The image is uploaded and url is: http://i63.tinypic.com/2v3sk6b.jpg

Tried with all combinations of isOpaque and acceptsFirstResponder etc in all 
concerned views.
How to make it go away without having to part with focus ring (they are there 
for a purpose)?

Thanks,
Navneet
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: [solved] View based outline view checkboxes not showing state when window is not front most

2017-05-08 Thread Navneet Kumar
macOS Sierra . Setting state of checkboxes directly via setState:.

I removed the two lines: setting bezel style and border and it started working 
as expected.

Thanks,
Navneet 

Sent from my iPhone

> On 08-May-2017, at 10:17 PM, Quincey Morris 
>  wrote:
> 
>> On May 8, 2017, at 05:20 , Navneet Kumar  wrote:
>> 
>> If a checkbox is checked, it starts showing as unchecked the moment the 
>> window gets in background.
> 
> What platform? What mechanism are you using to provide the checkbox value 
> generally?
> 
___

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


View based outline view checkboxes not showing state when window is not front most

2017-05-08 Thread Navneet Kumar
Hi,
I have a view based outline view with first column for checkboxes.
I'm adding the checkbox button as a sub view to the custom supplied view for 
the item for the first column.

If a checkbox is checked, it starts showing as unchecked the moment the window 
gets in background.

Same way all the checkboxes show as unchecked when saving outline view data 
using dataWithPDFInRect:.

Any clues?

Wishes,
Navneet 

___

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: Visible difference in text: NSTextField vs drawInRect:

2017-04-12 Thread Navneet Kumar
Hi,

Thanks for the valuable insights.

Wishes,
Navneet

> On 12-Apr-2017, at 12:42 AM, Quincey Morris 
>  wrote:
> 
> On Apr 11, 2017, at 08:32 , Navneet Kumar  <mailto:navnee...@me.com>> wrote:
>> 
>>> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, 
>>> that determines whether it knows the background color and therefore whether 
>>> it anti-aliases using the background color.
>>> 
>> Tried anti-aliasing, explicitly turning it ON and OFF. No change.
> 
> Well, I nearly had the right answer here. I tried a simple test project, 
> using black text, and saw the effect you describe. Zooming into the display 
> (Control+scroll) revealed the difference pretty clearly, since I could see 
> the colors of the anti-aliased pixels. In the NSTextField text, LCD font 
> smoothing is being used; in the drawn text, it is not. There is behind the 
> scenes magic when drawing text, that determines whether it knows that LCD 
> smoothing can be applied.
> 
> When I turned the LCD smoothing option off in System Preferences -> General, 
> the text rendered the same in both cases.
> 
> Note that your choice of text color made the problem appear worse, because 
> sub pixels were apparently being turned on both for smoothing and for 
> coloring, which made the text look bolder than if it had been black.
> 

___

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: Visible difference in text: NSTextField vs drawInRect:

2017-04-11 Thread Navneet Kumar
Yes, I tried inside drawRect:, both YES and NO. The effect was still there.

Thanks,
Navneet 

Sent from my iPhone

> On 11-Apr-2017, at 9:31 PM, gerti-cocoa...@bitart.com wrote:
> 
> Did you try the
> 
>CGContextRefctx=(CGContextRef)[[NSGraphicsContext 
> currentContext]graphicsPort];
>
>CGContextSetShouldSmoothFonts(ctx,YES);
> 
> stuff inside the -drawRect: method? That is where it needs to be. Try both 
> YES and NO. Should be a visible difference.
> 
> Gerd
> 
> 
>> On Apr 11, 2017, at 10:55, Navneet Kumar  wrote:
>> 
>> Hi,
>> 
>> Here is another image with a character in each case zoomed in using 
>> ColorMeter.
>> 
>> http://i66.tinypic.com/2w5m795.jpg
>> 
>> Wishes,
>> Navneet
>> 
>> 
>>> On 11-Apr-2017, at 2:00 AM, Quincey Morris 
>>>  wrote:
>>> 
>>> On Apr 10, 2017, at 11:20 , Navneet Kumar >> <mailto:navnee...@me.com>> wrote:
>>>> 
>>>> Actually I’m using text fields for simplicity at a lot of places. And 
>>>> drawInRect: at some places, in order to vertically centre the multi-line 
>>>> text more conveniently.
>>> 
>>> Here are some possibilities to consider:
>>> 
>>> 1. Shadow. What happens if you don’t specify the shadow?
>>> 
>>> 2. Resolution. It may be that the text drawing ends up in drawing contexts 
>>> with different resolution backing stores (1x vs. 2x vs. 3x).
>>> 
>>> 3. Size. Does the weird effect scale with point size? If you draw the text 
>>> much larger, are the results much closer to each other?
>>> 
>>> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, 
>>> that determines whether it knows the background color and therefore whether 
>>> it anti-aliases using the background color.
>>> 
>>> 5. Overlays. It’s possible that NSTextField already draws the text more 
>>> than once, to give a partial outline effect that increases contrast with 
>>> mid-level color backgrounds.
>>> 
>>> 6. Traits. NSTextField may be opting into the trait behavior that 
>>> classifies text as Body, Headline, Caption, etc. These things might cause 
>>> some adjustment to the font weight. Or the accessibility features that 
>>> change the font appearance. (But I’m not sure which of those is available 
>>> on macOS.)
>>> 
>>> 
>> 
>> ___
>> 
>> 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/gerti-cocoadev%40bitart.com
>> 
>> This email sent to gerti-cocoa...@bitart.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: Visible difference in text: NSTextField vs drawInRect:

2017-04-11 Thread Navneet Kumar
Hi,

Here is another image with a character in each case zoomed in using ColorMeter.

http://i66.tinypic.com/2w5m795.jpg

Wishes,
Navneet


> On 11-Apr-2017, at 2:00 AM, Quincey Morris 
>  wrote:
> 
> On Apr 10, 2017, at 11:20 , Navneet Kumar  <mailto:navnee...@me.com>> wrote:
>> 
>> Actually I’m using text fields for simplicity at a lot of places. And 
>> drawInRect: at some places, in order to vertically centre the multi-line 
>> text more conveniently.
> 
> Here are some possibilities to consider:
> 
> 1. Shadow. What happens if you don’t specify the shadow?
> 
> 2. Resolution. It may be that the text drawing ends up in drawing contexts 
> with different resolution backing stores (1x vs. 2x vs. 3x).
> 
> 3. Size. Does the weird effect scale with point size? If you draw the text 
> much larger, are the results much closer to each other?
> 
> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, 
> that determines whether it knows the background color and therefore whether 
> it anti-aliases using the background color.
> 
> 5. Overlays. It’s possible that NSTextField already draws the text more than 
> once, to give a partial outline effect that increases contrast with mid-level 
> color backgrounds.
> 
> 6. Traits. NSTextField may be opting into the trait behavior that classifies 
> text as Body, Headline, Caption, etc. These things might cause some 
> adjustment to the font weight. Or the accessibility features that change the 
> font appearance. (But I’m not sure which of those is available on macOS.)
> 
> 

___

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: Visible difference in text: NSTextField vs drawInRect:

2017-04-11 Thread Navneet Kumar
Hi,

The image with bigger (21.0 points) Arial font is uploaded here: 
http://i65.tinypic.com/118g0fl.jpg
The effect is clearly visible.
The window is of a new small project made to show/resolve this issue only.
I can send this small (around 50KB) project via email if you want.

Please look at my responses to the points raised below.

> On 11-Apr-2017, at 2:00 AM, Quincey Morris 
>  wrote:
> 
> On Apr 10, 2017, at 11:20 , Navneet Kumar  <mailto:navnee...@me.com>> wrote:
>> 
>> Actually I’m using text fields for simplicity at a lot of places. And 
>> drawInRect: at some places, in order to vertically centre the multi-line 
>> text more conveniently.
> 
> Here are some possibilities to consider:
> 
> 1. Shadow. What happens if you don’t specify the shadow?
> 
I have not specified any shadow to text field.

> 2. Resolution. It may be that the text drawing ends up in drawing contexts 
> with different resolution backing stores (1x vs. 2x vs. 3x).
> 
I do have retina display, but shouldn’t that be same for the two cases (text 
field and drawInRect:).

> 3. Size. Does the weird effect scale with point size? If you draw the text 
> much larger, are the results much closer to each other?
> 
Now using the font: “Arial Bold”, 21.0 points. The effect is still there and 
more clear.

> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, 
> that determines whether it knows the background color and therefore whether 
> it anti-aliases using the background color.
> 
Tried anti-aliasing, explicitly turning it ON and OFF. No change.

> 5. Overlays. It’s possible that NSTextField already draws the text more than 
> once, to give a partial outline effect that increases contrast with mid-level 
> color backgrounds.
> 
Is there a way to determine/change overlays by text field?

> 6. Traits. NSTextField may be opting into the trait behavior that classifies 
> text as Body, Headline, Caption, etc. These things might cause some 
> adjustment to the font weight. Or the accessibility features that change the 
> font appearance. (But I’m not sure which of those is available on macOS.)
> 
Tried with changing traits like font weight (for drawInRect:) from 0 to 15, but 
the effect is still there.



> 

___

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: Visible difference in text: NSTextField vs drawInRect:

2017-04-10 Thread Navneet Kumar
Hi,

Checked. Both the fonts (text field’s as well as descAttribs) are same with 
same “spc” values, at run time.
Tried with “Arial Bold”, but same result: text field rendering looks bolder and 
darker.

As Rob suggested, if its a more deeper thing like “updateLayer vs not” case, 
what can be done?

Actually I’m using text fields for simplicity at a lot of places. And 
drawInRect: at some places, in order to vertically centre the multi-line text 
more conveniently.

But it looks odd in contrast when I’m doing both on the same window. I want 
both to match.

Wishes,
Navneet

> On 10-Apr-2017, at 10:50 PM, Jens Alfke  wrote:
> 
> That's weird. I think you'll need to do some detective work.
> - Break at runtime and check what the value of textField.font actually is.
> - Try using a different font and see if it makes any difference.
> 
> —Jens

___

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: Visible difference in text: NSTextField vs drawInRect:

2017-04-10 Thread Navneet Kumar
Yes, the text field seems to draw bold font, but I have set the same bold font 
in drawInRect: as well.
Here’s the code snippet.
———
For text field:
bgColor = [[NSColor orangeColor] blendedColorWithFraction:0.25 
ofColor:[NSColor yellowColor]];
[bgColor retain];
[textField setTextColor:[bgColor shadowWithLevel:0.25]];
[textField setFont:[NSFont boldSystemFontOfSize:11.0]];
[textField setStringValue:string];
For drawInRect:
NSMutableParagraphStyle * aParagraphStyle = [[[NSMutableParagraphStyle 
alloc] init] autorelease];
[aParagraphStyle setLineBreakMode:NSLineBreakByWordWrapping];
NSDictionary *descAttribs = [NSDictionary 
dictionaryWithObjectsAndKeys:[NSFont boldSystemFontOfSize:11.0], 
NSFontAttributeName, [bgColor shadowWithLevel:0.25], 
NSForegroundColorAttributeName, aParagraphStyle, 
NSParagraphStyleAttributeName,nil];

[string drawInRect:rectDrw withAttributes:descAttribs];
———
After trying CGContextSetShouldSmoothFonts(ctx,YES);,
the result is same as before, the text field seems to display bolder, darker 
font.

I have macOS Sierra. Latest Xcode, and latest build settings.

Thanks,
Navneet


> On 10-Apr-2017, at 9:06 PM, Jens Alfke  wrote:
> 
> 
>> On Apr 10, 2017, at 7:41 AM, Navneet Kumar > <mailto:navnee...@me.com>> wrote:
>> 
>> The image URL to a sample image: http://i63.tinypic.com/xbe0bc.jpg 
>> <http://i63.tinypic.com/xbe0bc.jpg>
>> The top text is using a text field and bottom text is using drawInRect:.
> 
> What are the exact text attributes? It looks as though the top line is bold 
> and the bottom isn't.
> 
> —Jens

___

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

Visible difference in text: NSTextField vs drawInRect:

2017-04-10 Thread Navneet Kumar
Hi,

There is visible difference in text when setting the same string, same font, 
same text colour to a text field.
And when the same is done via NSString drawInRect method having same attributes 
for text.

The image URL to a sample image: http://i63.tinypic.com/xbe0bc.jpg

The top text is using a text field and bottom text is using drawInRect:.

The rect supplied to drawInRect: is many time bigger than needed.

I have both ways implemented in my project, so would it be possible to make 
drawInRect: draw as boldly as a text field?

Is there any other neater, more consistent way to draw text?

Thanks,
Navneet

___

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: Mouse tracking under a transparent view still working

2015-01-11 Thread Navneet Kumar
Hi,
Implemented tracking area in the transparent view, still the under view's 
button shows hovering.

It seems complicated after reading:
http://www.cocoabuilder.com/archive/cocoa/19-the-nstrackingarea-report.html 
<http://www.cocoabuilder.com/archive/cocoa/19-the-nstrackingarea-report.html>

Still not able to understand as to fix this problem.

Wishes,
Navneet

> On 11-Jan-2015, at 3:53 pm, Markus Spoettl  wrote:
> 
> On 11/01/15 07:12, Navneet Kumar wrote:
>> So the mouse click etc are not passing through, but the hover button under it
>> still shows hovering effect by drawing the border.
> 
> You probably need to establish a tracking area on the view that is supposed to
> absorb the mouse events. The reason is that -mouseMoved: events will not
> automatically be called just by implementing the event method (unlike the 
> other mouse methods), you need a tracking area for that to work.
> 
> 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/navneet_6%40me.com
> 
> This email sent to navnee...@me.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

Mouse tracking under a transparent view still working

2015-01-10 Thread Navneet Kumar
Hi,

I have a hover button in my window, implemented tracking area and mouseEntered: 
and mouseExited: to achieve this (the button draws a border around it on mouse 
entered).

Now sometimes I need to put a window size transparent view over the entire 
window and block mouse events from filtering through it to the views under it.

For this I have implemented the following methods in transparent view:

- (void)mouseDown:(NSEvent*)event {}
- (void)mouseDragged:(NSEvent*)event {}
- (void)mouseUp:(NSEvent*)event {}
- (void)mouseEntered:(NSEvent *)theEvent {}
- (void)mouseExited:(NSEvent *)theEvent {}
- (void)mouseMoved:(NSEvent *)theEvent {}

- (BOOL)acceptsFirstResponder {
return YES;
}

So the mouse click etc are not passing through, but the hover button under it 
still shows hovering effect by drawing the border.

Please help.

Regards,
Navneet

___

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: wits end with nsview and nsrectfill()

2014-12-13 Thread Navneet Kumar
Hi
After trying out everything, I finally found how to remove that difference in 
background color.
I couldn’t find any rationale in this patch effect, so I turned the outline 
selection highlight to none (regular, i.e. plain white also works).

So if you take a view-based outline view (or maybe table view as well) and fill 
a table column’s view’s background with NSRectFill() or any other and add as 
sub view a transparent text field, upon refresh the text field and the rest of 
the background will differ in color as long as selection highlight is set to 
“Source List”. As if source list color superimposes on the area other than the 
text field.

But I still can’t understand the nitty gritty of this.

But in this solution, the outline view loses source list style color in its 
appearance.

Also I found that setting the background color does not lead to this patch.

Is there anyway I can still get the same source list style color in its 
appearance and not have this patch? If setting background color is the 
solution, how to get source list color without applying it?

Any ideas?

Wishes,
Navneet

> On 04-Dec-2014, at 8:13 pm, Navneet Kumar  wrote:
> 
> Hi,
> 
> The problem is not there if I create a new project and add a text field as 
> subview to a custom view with a background color. There is no difference in 
> color in text field and rest of the area.
> 
> And also this wasn’t there a couple of months ago, and not using git or 
> subversion, I am not able to locate what I did to get to the current problem.
> 
> Any ideas what could be happening?
> 
> Can I get clear on some things?:
> 
> 1. If a view is send the msg -display, is the msg sent to all its subviews 
> without exception?
> 2. Could it be that so many views when trying to display (in the main thread 
> of course), could block some views from refreshing altogether?
> 
> If I could get a few pointers, I might get to the bottom of this problem.
> 
> Best,
> Navneet
> 
>> On 01-Dec-2014, at 11:28 am, Navneet Kumar  wrote:
>> 
>> Thanks for the responses.
>> 
>> The problem is still there.
>> 
>> I don’t need to dynamically add or remove views and was following the wrong 
>> way to setup view hierarchy in drawRect:.
>> 
>> I have changed it to the following order: initWithFrame: then 
>> -(void)setupSubViews in all related classes.
>> So in app delegate I call initWithFrame: and then immediately setupSubViews. 
>> The entire view comes to front a lot later.
>> 
>> The view hierarchy is complex, starting with a view based outline view, then 
>> child of a root node has box views (2 in a row). Every box has this bottom 
>> view which has this problem. I’m adding a non-selectable, non-editable text 
>> field with setDrawsBackground set to NO, as a subview to this bottom view.
>> 
>> In drawRect:, I’m just using NSRectFill() with:
>> 
>> NSColor *bgColor = [[NSColor blackColor]blendedColorWithFraction:0.25 
>> ofColor:[NSColor whiteColor]];
>>   [bgColor set];
>>   NSRectFill([self bounds]);
>> And initially the background is same in text field and rest of the area. but 
>> on refresh, the rest of the area becomes darker, which shouldn’t be as 
>> NSRectFill() is supposed to draw opaquely.
>> 
>> 
>> Thanks,
>> Navneet
>> 
>> 
>>> On 30-Nov-2014, at 11:24 pm, Kyle Sluder  wrote:
>>> 
>>> On Nov 30, 2014, at 9:30 AM, Navneet Kumar  wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I have a custom view in which I am setting the background using 
>>>> NSRectFill() in drawRect:.
>>> 
>>> You’re aware that this function is only really suitable for drawing opaque 
>>> colors, yes? If you NSRectFill() with a transparent color, it will not 
>>> blend that color with the existing backing store. Instead, it will replace 
>>> all pixels in that rect with transparent ones, obliterating any drawing 
>>> performed by ancestor views in the hierarchy.
>>> 
>>>> I am also adding a text field as subview in this method.
>>> 
>>> This is not allowed. -drawRect: is for drawing, not mutating your view 
>>> hierarchy.
>>> 
>>> If you want to position/install views at the last possible second before 
>>> the drawing pass, use -viewWillDraw. But you have not offered any reasons 
>>> why you need to dynamically add or remove views at all, much less in tandem 
>>> with the drawing pass.
>>> 
>>> --Kyle Sluder
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Ple

Re: wits end with nsview and nsrectfill()

2014-12-04 Thread Navneet Kumar
Hi,

The problem is not there if I create a new project and add a text field as 
subview to a custom view with a background color. There is no difference in 
color in text field and rest of the area.

And also this wasn’t there a couple of months ago, and not using git or 
subversion, I am not able to locate what I did to get to the current problem.

Any ideas what could be happening?

Can I get clear on some things?:

1. If a view is send the msg -display, is the msg sent to all its subviews 
without exception?
2. Could it be that so many views when trying to display (in the main thread of 
course), could block some views from refreshing altogether?

If I could get a few pointers, I might get to the bottom of this problem.

Best,
Navneet

> On 01-Dec-2014, at 11:28 am, Navneet Kumar  wrote:
> 
> Thanks for the responses.
> 
> The problem is still there.
> 
> I don’t need to dynamically add or remove views and was following the wrong 
> way to setup view hierarchy in drawRect:.
> 
> I have changed it to the following order: initWithFrame: then 
> -(void)setupSubViews in all related classes.
> So in app delegate I call initWithFrame: and then immediately setupSubViews. 
> The entire view comes to front a lot later.
> 
> The view hierarchy is complex, starting with a view based outline view, then 
> child of a root node has box views (2 in a row). Every box has this bottom 
> view which has this problem. I’m adding a non-selectable, non-editable text 
> field with setDrawsBackground set to NO, as a subview to this bottom view.
> 
> In drawRect:, I’m just using NSRectFill() with:
> 
> NSColor *bgColor = [[NSColor blackColor]blendedColorWithFraction:0.25 
> ofColor:[NSColor whiteColor]];
>[bgColor set];
>NSRectFill([self bounds]);
> And initially the background is same in text field and rest of the area. but 
> on refresh, the rest of the area becomes darker, which shouldn’t be as 
> NSRectFill() is supposed to draw opaquely.
> 
> 
> Thanks,
> Navneet
> 
> 
>> On 30-Nov-2014, at 11:24 pm, Kyle Sluder  wrote:
>> 
>> On Nov 30, 2014, at 9:30 AM, Navneet Kumar  wrote:
>>> 
>>> Hi,
>>> 
>>> I have a custom view in which I am setting the background using 
>>> NSRectFill() in drawRect:.
>> 
>> You’re aware that this function is only really suitable for drawing opaque 
>> colors, yes? If you NSRectFill() with a transparent color, it will not blend 
>> that color with the existing backing store. Instead, it will replace all 
>> pixels in that rect with transparent ones, obliterating any drawing 
>> performed by ancestor views in the hierarchy.
>> 
>>> I am also adding a text field as subview in this method.
>> 
>> This is not allowed. -drawRect: is for drawing, not mutating your view 
>> hierarchy.
>> 
>> If you want to position/install views at the last possible second before the 
>> drawing pass, use -viewWillDraw. But you have not offered any reasons why 
>> you need to dynamically add or remove views at all, much less in tandem with 
>> the drawing pass.
>> 
>> --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/navneet_6%40me.com
> 
> This email sent to navnee...@me.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: wits end with nsview and nsrectfill()

2014-11-30 Thread Navneet Kumar
Thanks for the responses.

The problem is still there.

I don’t need to dynamically add or remove views and was following the wrong way 
to setup view hierarchy in drawRect:.

I have changed it to the following order: initWithFrame: then 
-(void)setupSubViews in all related classes.
So in app delegate I call initWithFrame: and then immediately setupSubViews. 
The entire view comes to front a lot later.

The view hierarchy is complex, starting with a view based outline view, then 
child of a root node has box views (2 in a row). Every box has this bottom view 
which has this problem. I’m adding a non-selectable, non-editable text field 
with setDrawsBackground set to NO, as a subview to this bottom view.

In drawRect:, I’m just using NSRectFill() with:

NSColor *bgColor = [[NSColor blackColor]blendedColorWithFraction:0.25 
ofColor:[NSColor whiteColor]];
[bgColor set];
NSRectFill([self bounds]);
And initially the background is same in text field and rest of the area. but on 
refresh, the rest of the area becomes darker, which shouldn’t be as 
NSRectFill() is supposed to draw opaquely.


Thanks,
Navneet


> On 30-Nov-2014, at 11:24 pm, Kyle Sluder  wrote:
> 
> On Nov 30, 2014, at 9:30 AM, Navneet Kumar  wrote:
>> 
>> Hi,
>> 
>> I have a custom view in which I am setting the background using NSRectFill() 
>> in drawRect:.
> 
> You’re aware that this function is only really suitable for drawing opaque 
> colors, yes? If you NSRectFill() with a transparent color, it will not blend 
> that color with the existing backing store. Instead, it will replace all 
> pixels in that rect with transparent ones, obliterating any drawing performed 
> by ancestor views in the hierarchy.
> 
>> I am also adding a text field as subview in this method.
> 
> This is not allowed. -drawRect: is for drawing, not mutating your view 
> hierarchy.
> 
> If you want to position/install views at the last possible second before the 
> drawing pass, use -viewWillDraw. But you have not offered any reasons why you 
> need to dynamically add or remove views at all, much less in tandem with the 
> drawing pass.
> 
> --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

Re: wits end with nsview and nsrectfill()

2014-11-30 Thread Navneet Kumar
Thank you Steve and Mike.
I'll try it tomorrow and post the result here.

Wishes,
Navneet
Sent from my iPhone

> On 30-Nov-2014, at 11:13 pm, Steve Christensen  wrote:
> 
> Why aren't you creating the subview in -initWithFrame: or in a 
> nib/storyboard? The purpose of -drawRect: is solely to [re-]draw the contents 
> of one view, not build a view hierarchy. I expect that modifying the view 
> hierarchy while in the middle of a drawing cycle is leaving views in an 
> inconsistent state.
> 
> 
>> On Nov 30, 2014, at 9:30 AM, Navneet Kumar  wrote:
>> 
>> I have a custom view in which I am setting the background using NSRectFill() 
>> in drawRect:. I am also adding a text field as subview in this method. The 
>> textfield is non-selectable, non-editable and is not set to draw background.
>> 
>> When the view comes to front, the background is same, but when it refreshes, 
>> the area apart from the text field becomes a bit darker and the text field 
>> area shows the original background, this creates a contrast which I want to 
>> get rid of.
>> 
>> The view is set to return YES to isOpaque.
>> 
>> I have tried a lot of things but to no avail.
>> I have tried CGContext approach to fill rect.
>> I also tried setting the color before NSRectFill() to a opaque color as well.
>> 
>> The problem is gone if I removeFromSuperview and create the custom view 
>> again and again on each drawRect: of the super view. But this consumes a lot 
>> of CPU.
>> 
>> An image showing the contrast is attached herewith.
>> 
>> Please help.
>> 
>> Best,
>> Navneet
> 

___

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

wits end with nsview and nsrectfill()

2014-11-30 Thread Navneet Kumar
Hi,

I have a custom view in which I am setting the background using NSRectFill() in 
drawRect:. I am also adding a text field as subview in this method. The 
textfield is non-selectable, non-editable and is not set to draw background.

When the view comes to front, the background is same, but when it refreshes, 
the area apart from the text field becomes a bit darker and the text field area 
shows the original background, this creates a contrast which I want to get rid 
of.

The view is set to return YES to isOpaque.

I have tried a lot of things but to no avail.
I have tried CGContext approach to fill rect.
I also tried setting the color before NSRectFill() to a opaque color as well.

The problem is gone if I removeFromSuperview and create the custom view again 
and again on each drawRect: of the super view. But this consumes a lot of CPU.

An image showing the contrast is attached herewith.

Please help.

Best,
Navneet
___

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

Storing a value to access across app launches and even re-install

2014-08-18 Thread Navneet Kumar
Hi,

I need to store a numeric value in the system and update and access it across 
every launch of my app.
Also is it possible to safely store it in the system so that it can be picked 
up even after a re-install of my app?
I want it to be secure, so that even a os x savvy user may not be able to 
delete/modify this value.

Its more like the apps that allow a certain number of launches with full 
functionality before requiring registration.

Thanks in advance.

Best,
Navneet


___

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: having both cell based and view based outline views in one project

2014-07-12 Thread Navneet Kumar
Hi,
Thanks for the valuable insight.
For now I'll try separating the data source & delegate, for the two outline 
views, just to save time.
And will switch to view based, in due time.

Thanks very much.

Navneet

Sent from my iPhone

> On 12-Jul-2014, at 9:02 pm, Keary Suska  wrote:
> 
>> On Jul 12, 2014, at 9:20 AM, Navneet Kumar wrote:
>> 
>> I had one (set cell-based in IB) outline view in my project using custom 
>> cell for one table Column (identifier : “Description”).
>> And it was working fine with my AppDelegate implementing the required 
>> datasource and some delegate methods.
>> 
>> I added another (set view-based in IB) outline view and I am returning 
>> custom views in the following method (in AppDelegate):
>> 
>> - (NSView *)outlineView:(NSOutlineView *)outlineView 
>> viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
>>NSString *identifier = [tableColumn identifier];
>>   if ([outlineView isEqualTo:outlineViewThumbs]) {
>>   if ([identifier isEqualToString:COLUMN_ID_DESC]) {// having only 
>> one table column
>>   return [item cellView];
>>   }
>>   }
>>   return nil;
>> }
>> 
>> This view-based outline view is working as expected, but the earlier 
>> cell-based outline is now showing empty rows (yes, it does populate as is 
>> evident from the vertical scroller and clicking also selects the row).
>> Adding a breakpoint in the above method, I can see it being called by 
>> cell-based outline view, and in this case this method returns nil. And the 
>> outlineView: objectValueForTableColumn: item: method doesn’t get called.
>> If I comment the last line in above method and return nothing for the 
>> cell-based outline view, the outlineView: objectValueForTableColumn: item: 
>> is called after the above method, but it leads to crash at another place in 
>> code where I’m doing [tabView display];. This tabView contains both the 
>> outline views in separate tabs.
>> 
>> How to tackle it?
>> Do I need to use two separate classes for datasource and delegate for the 
>> two outline views?
> 
> Most likely. As far as I can tell, there is no public property that tells an 
> NSTableView whether it is cell-based or view-based, so I am not surprised 
> that it determines this based on implemented delegate methods. Alternatively, 
> since cell-based table views are being deprecated, you could convert your 
> cell-based to view-based and then your app will have some future-proofing.
> 
> HTH,
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 

___

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

having both cell based and view based outline views in one project

2014-07-12 Thread Navneet Kumar
Hi,

I had one (set cell-based in IB) outline view in my project using custom cell 
for one table Column (identifier : “Description”).
And it was working fine with my AppDelegate implementing the required 
datasource and some delegate methods.

I added another (set view-based in IB) outline view and I am returning custom 
views in the following method (in AppDelegate):

- (NSView *)outlineView:(NSOutlineView *)outlineView 
viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
NSString *identifier = [tableColumn identifier];
if ([outlineView isEqualTo:outlineViewThumbs]) {
if ([identifier isEqualToString:COLUMN_ID_DESC]) {// having 
only one table column
return [item cellView];
}
}
return nil;
}

This view-based outline view is working as expected, but the earlier cell-based 
outline is now showing empty rows (yes, it does populate as is evident from the 
vertical scroller and clicking also selects the row).
Adding a breakpoint in the above method, I can see it being called by 
cell-based outline view, and in this case this method returns nil. And the 
outlineView: objectValueForTableColumn: item: method doesn’t get called.
If I comment the last line in above method and return nothing for the 
cell-based outline view, the outlineView: objectValueForTableColumn: item: is 
called after the above method, but it leads to crash at another place in code 
where I’m doing [tabView display];. This tabView contains both the outline 
views in separate tabs.

How to tackle it?
Do I need to use two separate classes for datasource and delegate for the two 
outline views?

Thanks,
Navneet

___

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

AVFoundation video not playing in root mode

2014-05-27 Thread Navneet Kumar
Hi,

The code I’m using is as follows: (it works well and videos plays when logged 
in as admin user, but doesn’t play when the app is run as root):

In awakeFromNib:
[[avPlayerView layer] 
setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
// Create the AVPlayer, add rate and status observers
avPlayer = [[AVPlayer alloc] init];// autorelease];
// Create an asset with our URL, asychronously load its tracks, its 
duration, and whether it's playable or protected.
// When that loading is complete, configure a player to play the asset.
NSURL *fileURL = [[NSBundle mainBundle] 
URLForResource:@"progress-movie" withExtension:@"mov"];
AVURLAsset *asset = [AVAsset assetWithURL:fileURL];
NSArray *assetKeysToLoadAndTest = [NSArray 
arrayWithObjects:@"playable", @"hasProtectedContent", @"tracks", @"duration", 
nil];
[asset loadValuesAsynchronouslyForKeys:assetKeysToLoadAndTest 
completionHandler:^(void) {
// The asset invokes its completion handler on an arbitrary 
queue when loading is complete.
// Because we want to access our AVPlayer in our ensuing 
set-up, we must dispatch our handler to the main queue.
dispatch_async(dispatch_get_main_queue(), ^(void) {
[self setUpPlaybackOfAsset:asset 
withKeys:assetKeysToLoadAndTest];
});
}];

- (void)playVideo {
[[NSNotificationCenter defaultCenter] addObserver:self
 
selector:@selector(playerItemDidReachEnd:)
 
name:AVPlayerItemDidPlayToEndTimeNotification
   object:[avPlayer currentItem]];
avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
[avPlayer seekToTime:kCMTimeZero];
[avPlayer play];
}

- (void)pauseVideo {
[avPlayer pause];
[[NSNotificationCenter defaultCenter] removeObserver:self 
name:AVPlayerItemDidPlayToEndTimeNotification object:[avPlayer currentItem]];
}

- (void)playerItemDidReachEnd:(NSNotification *)notification {
AVPlayerItem *p = [notification object];
[p seekToTime:kCMTimeZero];
}

- (void)setUpPlaybackOfAsset:(AVAsset *)asset withKeys:(NSArray *)keys
{
// Set up an AVPlayerLayer according to whether the asset contains 
video.
if ([[asset tracksWithMediaType:AVMediaTypeVideo] count] != 0)
{
// Create an AVPlayerLayer and add it to the player view if 
there is video, but hide it until it's ready for display
AVPlayerLayer *newPlayerLayer = [AVPlayerLayer 
playerLayerWithPlayer:avPlayer];
[newPlayerLayer setFrame:[[avPlayerView layer] bounds]];
[newPlayerLayer setAutoresizingMask:kCALayerWidthSizable | 
kCALayerHeightSizable];
//[newPlayerLayer setHidden:YES];
avPlayerLayer = newPlayerLayer;
[avPlayerLayer retain];
[[avPlayerView layer] addSublayer:newPlayerLayer];
}
// Create a new AVPlayerItem and make it our player's current item.
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];
[avPlayer replaceCurrentItemWithPlayerItem:playerItem];
}

Can it work when app is running as root?
Please help.


Best,
Navneet

___

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

[SOLVED] Re: is GC not available on 10.5.8?

2009-10-23 Thread Navneet Kumar

Hi,
Thanks for the valuable replies, they may come in handy in future.
Although the base sdk was chosen to be 10.5 at various places, the  
menu Project->Active SDK was still 10.6, did it to 10.5 and it is  
working now.


Thanks,
Nick


On 23-Oct-2009, at 9:26 PM, Jeremy Pereira wrote:

The load command is a 10.6 only mach-o load command  
(LC_DYLD_INFO_ONLY).  Something in your application is compiled and  
linked for 10.6.


On 23 Oct 2009, at 16:40, Nick Rogers wrote:


Hi,
Thanks for the reply.
The app actually works as a launcher of another app with root  
privileges (its only job is this).

Hence its a standard cocoa project with the following frameworks:
CoreFoundation, Cocoa, AppKit, CoreData, Foundation and Security  
frameworks.


Thanks,
Nick

On 23-Oct-2009, at 8:48 PM, Bill Bumgarner wrote:



On Oct 23, 2009, at 5:04 AM, Nick Rogers wrote:

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)// is actually (SIGTRAP) **

Dyld error message:
unknown required load command: 0x8022


GC is fully supported on 10.5.8.

Something else is broken.   Are you linking against any non-Apple  
libraries?  Have they been built correctly?


Also, what is the list of libraries / frameworks you are linking  
against?


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/adc%40jeremyp.net

This email sent to a...@jeremyp.net




___

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


where to release a CF object thats retained by a cocoa object

2009-09-27 Thread Navneet Kumar

Hi,
From a method in my AppController class I'm calling a function in  
another file as follows:


In AppController in init method:-
[self initialDriveList];


In AppController in initialDriveList method:
//some code here
[self volumeList];
// rest of the code here

In AppController in volumeList method:
finalArrayForVolumes = [[NSMutableArray alloc] init];// an ivar in  
AppController class
// adding some objects of type NSMutableDictionary to the  
finalArrayForVolumes here

FindVolumeNames((CFMutableArrayRef)finalArrayForVolumes);
[finalArrayForVolumes retain];


In another file in FindVolumeNames() function:
void FindVolumeNames(CFMutableArrayRef response)
{
CFIndex count = CFArrayGetCount(response);
int i;
for (i = 0; i < count; i++)
{
		CFMutableDictionaryRef data = (CFMutableDictionaryRef) 
CFArrayGetValueAtIndex (response, i);

// some code here
		CFStringRef outputVolumeName = CFStringCreateWithSubstring  
(kCFAllocatorDefault, pathName, rangeResult);// line 176, Call to  
function 'CFStringCreateWithSubstring' returns a Core Foundation  
object with a +1 retain count (owning reference)


CFDictionaryAddValue(data, CFSTR(kVolumeName), 
outputVolumeName);
// Shall I do CFRelease(outputVolumeName); here?
//some code here
	}//Object allocated on line 176 and stored into 'outputVolumeName' is  
no longer referenced after this point and has a retain count of +1  
(object leaked)


//some code here
}

The warnings returned by static analyzer in Xcode3.2 are mentioned in  
the code above.
Main warning was: Potential leak of an object allocated on line 176  
and stored into 'outputVolumeName'
The problem is where to release this outputVolumeName, which is added  
to a dictionary which is added to an array allocated in AppController?

And will that lead to removal of this warning?
I gather there is no autorelease in CF.

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: Stability on Snow Leopard

2009-09-22 Thread Navneet Kumar

Hi,
Thanks for the quick and appropriate reply.

My intention was to get some general responses on two things: Memory  
Management in a program on SnowLeopard (strictly needed?) and the need  
for code signing.


Of course, I'll need to tackle the crash situations individually, and  
they are a lot.


Thanks,
Nick

On 23-Sep-2009, at 8:18 AM, Kyle Sluder wrote:


This question is impossible to answer.  "My app crashes, why?!"

Your answer is in the crash logs, stack traces, logged unhandled
exceptions… everywhere but this mailing list.

If you have a crasher that you have investigated and think is not your
fault, *then* you can ask someone to take a look at it.  That means
posting your code and the stack trace from the crash.

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

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


Re: saving files/folders in foreign language names

2009-08-31 Thread Navneet Kumar

Hi,
Thanks for the reply.
Actually my program is a finder like program, which saves file (in  
path hierarchy).
And the hierarchy I mentioned earlier is the actual hierarchy on the  
user's file system.

I'm not hard coding anything.

What I think is happening is that NSFM's changeCurrentDirectoryPath:  
is failing, leading to a zero byte file.


Thanks,
Nick

On 01-Sep-09, at 5:27 AM, Kyle Sluder wrote:


What does foreign language have to do with it?  Are you perhaps using
accented characters like é in your pathnames?  You need to be very
careful when doing that, because the filesystem stores it in
decomposed form as e + ´, whereas if you've hardcoded this path in
your code (or strings file), you will try to access it as the composed
form é.

So in short, don't do this.  Use low-ASCII characters in all of your
hardcoded paths, and localize the directory if the user might see it.
The documentation has more information on localized pathnames:
http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/LocalizingPathnames.html

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

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


Re: debug control not reaching init method

2009-08-20 Thread Navneet Kumar

Hi,
AppController is not coming from an archive.
Dragged an NSObject to MainMenu.xib, set its class to AppController,  
made AppController the delegate of File's Owner.


Thanks,
Nick


On 20-Aug-09, at 4:47 PM, Graham Cox wrote:



On 20/08/2009, at 9:08 PM, Nick Rogers wrote:


What I may be missing here?



So maybe init isn't actually being called. Objects constructed from  
a nib are usually inited using -initWithCoder:. Is AppController  
coming from a nib?


--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


Re: thread count problem

2008-04-21 Thread Navneet Kumar

Thanks for the reply.
No, it doesn't affect my app. I was just asking whether it is a problem.

On 22-Apr-08, at 1:52 AM, David Duncan wrote:


On Apr 21, 2008, at 1:03 PM, Nick Rogers wrote:

when I run my cocoa app, Activity monitor shows it having 2  
threads, and thats ok, cause I'm running one POSIX thread with the  
start of the app and which remains till the app is exited.
The problem is when I detach a new NSThread, from which I'm  
calling "performSelectorOnMainThread:" frequently, the thread  
count goes to 4. and when this new NSThread finishes, the thread  
count comes to 3 and not 2. And it stays 3.


Is there something wrong?


Does this cause problems for your application? Mac OS X will spawn  
threads on behalf of your application to perform certain activities  
and this is generally beyond your control. This should typically be  
completely transparent to you.

--
David Duncan
Apple DTS Animation and Printing
[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]


Re: to write to file except NSData*

2008-04-15 Thread Navneet Kumar

ok,
so if i generate a header NSData object and write that to file, and  
then then write the larger NSData object,

how will i read one NSData after the another.
How will i know what length should I read.

excuse me if this sounds very newbie to you.

Wishes,
Nick

On 15-Apr-08, at 8:30 PM, Alastair Houghton wrote:


On 15 Apr 2008, at 15:49, Nick Rogers wrote:

I will use NSKeyedArchiver to create a lot of NSData objects  
before writing to file.
I can't write one whole NSData to file because i have to write in  
GBs and also have to show the progress bar.


So just use NSKeyedArchiver to generate a header before each of the  
larger NSData objects (for instance).


Or fill in an NSMutableData yourself, but if you do that you have  
to handle endianness somehow.


Kind regards,

Alastair.

--
http://alastairs-place.net




___

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]