Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-05-2009, 02:24 PM   #1 (permalink)
Registered Member
 
Jume's Avatar
 
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 254
Send a message via Skype™ to Jume
Default initialFirstResponder

This is making me crazy.

I have a simple NIB file where I put two NSTextFields and one subclassed NSImageView under UIWindow... I want my NSImageView be the firstResponder for key events... I have read the documentation and according to that I set my custom subbclassed NSImageView as initialFirstResponder.

But that wont work... still the text fields are focused automatically and are firstRespodners... Even when I switch the focus with Tab key, the NSImageview wont be selected so it never becomes a first responder.

How do I solve this? I wan't to listen to key events on my custom NSImageView...
Jume is offline   Reply With Quote
Old 07-06-2009, 04:43 PM   #2 (permalink)
New Member
 
Join Date: May 2009
Posts: 18
Default

Quote:
Originally Posted by Jume View Post
This is making me crazy.

I have a simple NIB file where I put two NSTextFields and one subclassed NSImageView under UIWindow... I want my NSImageView be the firstResponder for key events... I have read the documentation and according to that I set my custom subbclassed NSImageView as initialFirstResponder.

But that wont work... still the text fields are focused automatically and are firstRespodners... Even when I switch the focus with Tab key, the NSImageview wont be selected so it never becomes a first responder.

How do I solve this? I wan't to listen to key events on my custom NSImageView...
In cases like this you want to look at the reference for the class you are having a problem with. In this case, a quick look reveals that NSImageView is derived from, among others, the NSResponder class. As such, a scan of methods in NSResponder yields the following:

NSResponder Class Reference

This may or may not be the answer, but I have a feeling it will.

Bart
barrrt is offline   Reply With Quote
Old 07-07-2009, 02:26 AM   #3 (permalink)
Registered Member
 
Jume's Avatar
 
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 254
Send a message via Skype™ to Jume
Default

Quote:
Originally Posted by barrrt View Post
In cases like this you want to look at the reference for the class you are having a problem with. In this case, a quick look reveals that NSImageView is derived from, among others, the NSResponder class. As such, a scan of methods in NSResponder yields the following:

NSResponder Class Reference

This may or may not be the answer, but I have a feeling it will.

Bart
I figure out what was the problem. The NSImageView has by default enabled "Reject initial responder". This needs to be unchecked in IB in order to set is as initalFirstResponder. And it needs to be checked as Editable in IB in order to receive events. Once I did that, it solved my problem.
Jume is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,181
Threads: 38,954
Posts: 170,899
Top Poster: smasher (2,565)
Welcome to our newest member, Zephyros
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:31 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0