• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cocoa-dev Digest, Vol 8, Issue 148
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa-dev Digest, Vol 8, Issue 148


  • Subject: Cocoa-dev Digest, Vol 8, Issue 148
  • From: Heinrich Giesen <email@hidden>
  • Date: Sat, 26 Feb 2011 16:53:30 +0100

Send Cocoa-dev mailing list submissions to
	email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.apple.com/mailman/listinfo/cocoa-dev
or, via email, send a message with subject or body 'help' to
	email@hidden

You can reach the person managing the list at
	email@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cocoa-dev digest..."


Today's Topics:

   1. NSProgressIndicator tintcolor (Gustavo Pizano)
   2. UIWebView: Scale factor (Phillip Mills)
   3. First Responder (koko)
   4. Re: First Responder (Kyle Sluder)
   5. Re: First Responder (Graham Cox)
   6. Re: First Responder (koko)
   7. Re: First Responder (Graham Cox)
   8. Re: First Responder (koko)
   9. NSWindowController (koko)
  10. Re: First Responder (Kyle Sluder)
  11. Re: NSWindowController (Louis Demers)
  12. Re: First Responder (koko)
  13. Re: First Responder (Kyle Sluder)
  14. Re: NSWindowController (koko)
  15. Re: First Responder (koko)
  16. Re: NSWindowController (koko)
  17. XCode question: "Copy Header" build step doesn't work for my
      Framework target. (Motti Shneor)


----------------------------------------------------------------------

Message: 1
Date: Fri, 25 Feb 2011 23:31:11 +0100
From: Gustavo Pizano <email@hidden>
Subject: NSProgressIndicator tintcolor
To: Cocoa Developer <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

Hello all.


Im just wondering why changing the tint color using the setControlTint of the progress bar to NSGraphiteControlTint doesn't has any effect, I keep seeing that aqua colors...


I have tried finding answers online but it seems everybody has that problem.. or everybody is doing something wrong.. hehehe.. including me.


what am I doing wrong?


here is the code that I use to create the progress indicator

progressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(10, 5, 280, 8)];
[progressIndicator setMinValue:0.0f];
[progressIndicator setMaxValue:100.0f];
[progressIndicator setDoubleValue:50.0f];
[progressIndicator setIndeterminate:NO];
[progressIndicator setBezeled:YES];
[progressIndicator setControlTint:NSGraphiteControlTint];
[progressIndicator setDisplayedWhenStopped:YES];
[self.view addSubview:progressIndicator];




Thx

Gustavo



------------------------------

Message: 2
Date: Fri, 25 Feb 2011 17:35:30 -0500
From: Phillip Mills <email@hidden>
Subject: UIWebView: Scale factor
To: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

I'm loading files into a UIWebView on an iPad and need to be able to scroll them programatically to positions in the displayed files. Many of these files are PDF, but generally it could be any of the types supported by loadRequest. I'm able to do what I want using JavaScript if I set up my UIWebView with "scalesPagesToFit = NO". However, doing that looks terrible.

The problem with allowing automatic scaling is that I know my scrolling requirements in screen units but JavaScript interprets them as document units. Depending on the original file and the iPad orientation the error factors I've seen are in the 20-to-40% range. How do I set "scalesPagesToFit = YES" and know what scaling was applied?

(I have a truly terrible hack in mind but I hope to be saved from that madness. :-) )




------------------------------

Message: 3
Date: Fri, 25 Feb 2011 22:31:40 -0700
From: koko <email@hidden>
Subject: First Responder
To: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain;	charset=us-ascii

I connect a menu item to an action in first responder. The action is defined in a .h and .m in the project

In applicationDidFinishLaunching I alloc, init and retain an object that contains the action connected to the menu item in first responder.

At run time the menu item is not enabled.  I don't get it.

I guess this is basic but I have done this before with no problem.

Advice please.

-koko

------------------------------

Message: 4
Date: Fri, 25 Feb 2011 21:59:46 -0800
From: Kyle Sluder <email@hidden>
Subject: Re: First Responder
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

On Feb 25, 2011, at 9:31 PM, koko <email@hidden> wrote:

I connect a menu item to an action in first responder. The action is defined in a .h and .m in the project

In applicationDidFinishLaunching I alloc, init and retain an object that contains the action connected to the menu item in first responder.

At run time the menu item is not enabled. I don't get it.

Is the object in the responder chain at all? The menu item can't magically know about the object; it needs to look through the responder chain to find it.


--Kyle Sluder

------------------------------

Message: 5
Date: Sat, 26 Feb 2011 17:03:44 +1100
From: Graham Cox <email@hidden>
Subject: Re: First Responder
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii


On 26/02/2011, at 4:31 PM, koko wrote:

I connect a menu item to an action in first responder. The action is defined in a .h and .m in the project

In applicationDidFinishLaunching I alloc, init and retain an object that contains the action connected to the menu item in first responder.

At run time the menu item is not enabled. I don't get it.


If the object isn't in the responder chain, it can't respond. If it's not a subclass of NSResponder, it can't be in the responder chain.

The application delegate itself is in the responder chain (on behalf of NSApplication), so this is where the action should be implemented (even if it just passes it on to the helper object). If something in the responder chain can respond to the action, the menu item will be automatically enabled.


--Graham




------------------------------

Message: 6
Date: Fri, 25 Feb 2011 23:05:19 -0700
From: koko <email@hidden>
Subject: Re: First Responder
To: Kyle Sluder <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

The object is a subclass of NSResponder with overridden acceptsFirstResponder to return yes.

-koko


On Feb 25, 2011, at 10:59 PM, Kyle Sluder wrote:

On Feb 25, 2011, at 9:31 PM, koko <email@hidden> wrote:

I connect a menu item to an action in first responder. The action is defined in a .h and .m in the project

In applicationDidFinishLaunching I alloc, init and retain an object that contains the action connected to the menu item in first responder.

At run time the menu item is not enabled. I don't get it.

Is the object in the responder chain at all? The menu item can't magically know about the object; it needs to look through the responder chain to find it.


--Kyle Sluder



------------------------------

Message: 7
Date: Sat, 26 Feb 2011 17:11:23 +1100
From: Graham Cox <email@hidden>
Subject: Re: First Responder
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii


On 26/02/2011, at 5:05 PM, koko wrote:

The object is a subclass of NSResponder with overridden acceptsFirstResponder to return yes.


That still doesn't make it part of the responder CHAIN. You have to put it in the chain.

--Graham




------------------------------

Message: 8
Date: Fri, 25 Feb 2011 23:18:45 -0700
From: koko <email@hidden>
Subject: Re: First Responder
To: Graham Cox <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

Really!  So just do

 [window makeFirstResponder:object]:

Wow. too much work.

[object makeFirstResponder}
On Feb 25, 2011, at 11:11 PM, Graham Cox wrote:


On 26/02/2011, at 5:05 PM, koko wrote:

The object is a subclass of NSResponder with overridden acceptsFirstResponder to return yes.


That still doesn't make it part of the responder CHAIN. You have to put it in the chain.

--Graham






------------------------------

Message: 9
Date: Fri, 25 Feb 2011 23:58:10 -0700
From: koko <email@hidden>
Subject: NSWindowController
To: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain;	charset=us-ascii

I have a xib in which is defined a NSPanel

In code I do

m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];
NSWindow *window = [m_designViewerController window];
[window setDelegate:self];
[m_designViewerController showWindow:self];



The NSPanel shows BUT window is 0x0 ... how can this be?

-koko



------------------------------

Message: 10
Date: Fri, 25 Feb 2011 23:03:18 -0800
From: Kyle Sluder <email@hidden>
Subject: Re: First Responder
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID:
	<AANLkTi=sda=W_wGrp1hMnBprDPTW6-BJMm4XP=email@hidden>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Feb 25, 2011 at 10:18 PM, koko <email@hidden> wrote:
Really!  So just do

 [window makeFirstResponder:object]:

Wow. too much work.

[object makeFirstResponder}

NO!

You have this penchant for not reading documentation.
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/ doc/uid/10000060i-CH3-SW2


--Kyle Sluder


------------------------------

Message: 11
Date: Sat, 26 Feb 2011 02:18:35 -0500
From: Louis Demers <email@hidden>
Subject: Re: NSWindowController
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; CHARSET=US-ASCII

I recently ot bit by this. it seems that the window will only be allocated when you call showWindow. Just reorder you sequence.

On 2011-02-26, at 01:58 , koko wrote:

I have a xib in which is defined a NSPanel

In code I do

m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];

at this point the controller has been created but not the window.

	NSWindow *window = [m_designViewerController window];
	[window setDelegate:self];
	[m_designViewerController showWindow:self];

now it's been allocated, but you already set you window variable ...



The NSPanel shows BUT window is 0x0 ... how can this be?

-koko

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden

Louis Demers eng. www.obzerv.com




------------------------------

Message: 12
Date: Sat, 26 Feb 2011 00:19:24 -0700
From: koko <email@hidden>
Subject: Re: First Responder
To: Kyle Sluder <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

Penchant is a great word. Did you know that the average vocabulary is less that 200 words? And I be penchant is not in that set.

I guess I should rethink my design although I got around things by getting a pointer the Menu Item and then setting its target to be my object. I just thought this is a few steps too many

1. define an outlet - one line of code
2. connect the outlet - one IB action
3. set the target on the outlet - one more line of code

Seems like a lot. But if my action was in a view in the view hierarchy all is well with just an IB connection.

Comments ?

-koko



On Feb 26, 2011, at 12:03 AM, Kyle Sluder wrote:

On Fri, Feb 25, 2011 at 10:18 PM, koko <email@hidden> wrote:
Really!  So just do

 [window makeFirstResponder:object]:

Wow. too much work.

[object makeFirstResponder}

NO!

You have this penchant for not reading documentation.
http://developer.apple.com/library/mac/documentation/Cocoa/ Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#// apple_ref/doc/uid/10000060i-CH3-SW2


--Kyle Sluder




------------------------------

Message: 13
Date: Fri, 25 Feb 2011 23:25:05 -0800
From: Kyle Sluder <email@hidden>
Subject: Re: First Responder
To: koko <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID:
	<AANLkTimxdzW=email@hidden>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Feb 25, 2011 at 11:19 PM, koko <email@hidden> wrote:
Penchant is a great word. Did you know that the average vocabulary is less that 200 words? And I be penchant is not in that set.

I guess I should rethink my design although I got around things by getting a pointer the Menu Item and then setting its target to be my object. I just thought this is a few steps too many

1. define an outlet - one line of code
2. connect the outlet - one IB action
3. set the target on the outlet - one more line of code

Seems like a lot. But if my action was in a view in the view hierarchy all is well with just an IB connection.

Yes, this is the point of the responder chain. It is very much related to what views and windows are onscreen, and where the keyboard focus happens to be at the time.

If you always want your message to go to the same object (by which I
do _not_ mean "the same type of object in each window"), then it is
appropriate to point the menu item's target property at your object.
But if the object you want to message exists in one or more instance
per window, you should use the responder chain. That might mean that
your window controller might need to respond to the action message and
forward it along to the object in question.

--Kyle Sluder


------------------------------

Message: 14
Date: Sat, 26 Feb 2011 00:25:09 -0700
From: koko <email@hidden>
Subject: Re: NSWindowController
To: Louis Demers <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain;	charset=us-ascii

Apparently something else is going on ...

1 m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];
2 [m_designViewerController showWindow:self];
3 NSWindow *window = [m_designViewerController window];
4 [window setDelegate:self];


at line 4 window is nil

The window does show however. Yikes, I have a proclivity for inconsistent results !

Any thoughts ?

-koko




On Feb 26, 2011, at 12:18 AM, Louis Demers wrote:

I recently ot bit by this. it seems that the window will only be allocated when you call showWindow. Just reorder you sequence.

On 2011-02-26, at 01:58 , koko wrote:

I have a xib in which is defined a NSPanel

In code I do

m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];

at this point the controller has been created but not the window.

	NSWindow *window = [m_designViewerController window];
	[window setDelegate:self];
	[m_designViewerController showWindow:self];

now it's been allocated, but you already set you window variable ...



The NSPanel shows BUT window is 0x0 ... how can this be?

-koko

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40mac.com


This email sent to email@hidden

Louis Demers eng. www.obzerv.com






------------------------------

Message: 15
Date: Sat, 26 Feb 2011 00:29:03 -0700
From: koko <email@hidden>
Subject: Re: First Responder
To: Kyle Sluder <email@hidden>
Cc: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

Good lesson.

At least I know I am not twisting things around the axel. (as in my earliest Cocoa dev attempts, sacre bleu!)

Thanks !

-koko


On Feb 26, 2011, at 12:25 AM, Kyle Sluder wrote:

On Fri, Feb 25, 2011 at 11:19 PM, koko <email@hidden> wrote:
Penchant is a great word. Did you know that the average vocabulary is less that 200 words? And I be penchant is not in that set.

I guess I should rethink my design although I got around things by getting a pointer the Menu Item and then setting its target to be my object. I just thought this is a few steps too many

1. define an outlet - one line of code
2. connect the outlet - one IB action
3. set the target on the outlet - one more line of code

Seems like a lot. But if my action was in a view in the view hierarchy all is well with just an IB connection.

Yes, this is the point of the responder chain. It is very much related to what views and windows are onscreen, and where the keyboard focus happens to be at the time.

If you always want your message to go to the same object (by which I
do _not_ mean "the same type of object in each window"), then it is
appropriate to point the menu item's target property at your object.
But if the object you want to message exists in one or more instance
per window, you should use the responder chain. That might mean that
your window controller might need to respond to the action message and
forward it along to the object in question.

--Kyle Sluder




------------------------------

Message: 16
Date: Sat, 26 Feb 2011 01:08:50 -0700
From: koko <email@hidden>
Subject: Re: NSWindowController
To: Cocoa Developers <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

OK. My error was not setting Files Owner to NSWindowController which let me now set Files Owner window to my window.

-koko


On Feb 26, 2011, at 12:25 AM, koko wrote:

Apparently something else is going on ...

1 m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];
2 [m_designViewerController showWindow:self];
3 NSWindow *window = [m_designViewerController window];
4 [window setDelegate:self];


at line 4 window is nil

The window does show however. Yikes, I have a proclivity for inconsistent results !

Any thoughts ?

-koko




On Feb 26, 2011, at 12:18 AM, Louis Demers wrote:

I recently ot bit by this. it seems that the window will only be allocated when you call showWindow. Just reorder you sequence.

On 2011-02-26, at 01:58 , koko wrote:

I have a xib in which is defined a NSPanel

In code I do

m_designViewerController = [[[NSWindowController alloc] initWithWindowNibName:@"DesignViewer"] retain];

at this point the controller has been created but not the window.

	NSWindow *window = [m_designViewerController window];
	[window setDelegate:self];
	[m_designViewerController showWindow:self];

now it's been allocated, but you already set you window variable ...



The NSPanel shows BUT window is 0x0 ... how can this be?

-koko

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40mac.com


This email sent to email@hidden

Louis Demers eng. www.obzerv.com




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden




------------------------------

Message: 17
Date: Sat, 26 Feb 2011 11:57:58 +0200
From: Motti Shneor <email@hidden>
Subject: XCode question: "Copy Header" build step doesn't work for my
	Framework target.
To: email@hidden
Message-ID:
	<email@hidden>
Content-Type: text/plain;	charset=us-ascii

Hello.

I did all I know, and all I found in the Framework programming guide.

The header file is checked on the Frameworks' target, and I see it when I open the "Copy Headers" build step. However --- in the built Framework, there's no "Headers" directory, and no header files.

Please advise....

Motti Shneor,
Senior Software Engineer and Team Leader,  Spectrum Reflections LTD.
Software Development for the Macintosh
Office eMail: email@hidden
---
ceterum censeo microsoftiem delendam esse
---












------------------------------

_______________________________________________

Cocoa-dev mailing list      (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

http://lists.apple.com/mailman/listinfo/cocoa-dev


End of Cocoa-dev Digest, Vol 8, Issue 148 ***************************************** _______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: XCode question: "Copy Header" build step doesn't work for my Framework target.
  • Next by Date: MPVolumeView
  • Previous by thread: Re: XCode question: "Copy Header" build step doesn't work for my Framework target.
  • Next by thread: MPVolumeView
  • Index(es):
    • Date
    • Thread