The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   OS X Developer (http://hintsforums.macworld.com/forumdisplay.php?f=27)
-   -   New developer to Mac OS X (http://hintsforums.macworld.com/showthread.php?t=43343)

maheshstms 08-13-2005 03:50 PM

Thanks trevor
 
Thanks trevor,
I got things working by including IOKiMultimediadevice in the bundle library.
Now my CD Filter driver is loaded.
Can u help me with a other doubt of mine. I make a application that will use the driver that i have made, In the application there is a module where i read a INI file, Is there any API like windows (getprivateprofilestring, ) to retreave data from the ini (or any similar file used in MAC, If it is any different file please do mention the file extension too trevor). I use MAC 10.2 and project builder and the application is made with cocoa.

I am very new to MAC and I have a text box in my application, I need to capure the text box type event(user typing something on the text box). I dont know how to do, can u help me with step by step procedure. since i am just born in the wonderfull world of MAC programmers

please trevor

Thanks in advcance for ur replies

bye
Mahesh

yellow 08-13-2005 08:36 PM

Greetings,

MAC is an acronym for Media Access Control, the ethernet hardware address of network cards. What you have there is a Mac, short for Macintosh. No need to capitailize it all. It's a common misnomer, don't worry about it.

As for your Developer question, you would probably have better luck posting it in our Developer's forum, so I will move your post there.

And finally, there is a TON of documentation at http://developer.apple.com for using developing for Mac OS X.

Cheers and good luck!

(Originally part of this thread: http://forums.macosxhints.com/showthread.php?p=227258)

hayne 08-14-2005 05:14 AM

Quote:

Originally Posted by maheshstms
In the application there is a module where i read a INI file, Is there any API like windows (getprivateprofilestring, ) to retreave data from the ini (or any similar file used in MAC, If it is any different file please do mention the file extension

In OS X, user-customizable settings are stored under the user's home folder, in a file under the ~/Library/Preferences/ folder. The files have the suffix ".plist" and are in an XML-based format. There is automatic support for reading and writing these preference files in the Cocoa framework. You need to look at examples of how to do this such as are in Apple's documentation, or in any good book on Cocoa. You really need to buy a book on Cocoa - it is too hard to learn it all by yourself. See book recommendations (and lots of useful info too) at www.cocoadev.com

But if the settings are not user-customizable, then you might want to put them under the "Library/Application Support" folder.

Quote:

I have a text box in my application, I need to capture the text box type event(user typing something on the text box).
This is one of the things that is covered in some of the earliest example programs in any Cocoa book. It is also illustrated by some examples in Apple's documentation. Start by reading the "Concepts" section in Apple's documentation.

maheshstms 08-14-2005 12:51 PM

Thanks Hayne
I searched the net and found few stuff, explaining how to get the text edit event. Since, I am new I couldn’t follow them. Please can u get me a link that explains the text edit event incase u meet with that, or if u don’t mind please do explain me the steps, this will be very much helpful for further new people like me.

awaiting ur replies

bye

Mahesh

hayne 08-14-2005 01:44 PM

Quote:

Originally Posted by maheshstms
I searched the net and found few stuff, explaining how to get the text edit event. Since, I am new I couldn’t follow them. Please can u get me a link that explains the text edit event

You really do need to buy a book on Cocoa as I said above.
But you can perhaps stumble along by using Apple's docs and looking at the sample programs provided. Start by looking at the Currency Converter tutorial:
http://developer.apple.com/documenta...uid/TP40000863
(If that link doesn't work, just google for: Apple currency converter site:developer.apple.com)

maheshstms 08-15-2005 03:55 AM

Ya I used this tutorial to get my command button working, and that help me larn a little abt. cocoa. please help me with a step by step procedure, of text edit event, sorry for disturbing you again

Mahesh

hayne 08-15-2005 04:20 AM

Quote:

Originally Posted by maheshstms
Ya I used this tutorial to get my command button working, and that help me larn a little abt. cocoa. please help me with a step by step procedure, of text edit event, sorry for disturbing you again

Step 1: Read some more documentation - e.g. start with Apple's Cocoa Concepts doc
Step 2: Look at some more example code from Apple's web site and what is supplied with the XCode install
Step 3: Read some more documentation - e.g. concept doc on text handling
Step 4: Try some more small test programs of your own.
Step 5: Buy a book on Cocoa and read it through, trying its example programs
Step 6: Come back here (or on the Cocoa mailing lists - see www.cocoadev.com) and ask more specific questions, show some of your code and explain what is and isn't working.

yellow 08-15-2005 11:11 AM

It's better to learn it on your own and ask specific questions about what you don't understand, then have it spoon fed to you so you can pop it in a proggy without understanding what you're doing.

maheshstms 08-16-2005 01:04 PM

Oh Yellow
I too have the habit of learning things myself, but this is not the important thing, i just wanted to include this as a feture. I found very few links that would help me, but i am not so strong in cocoa, so it is too hard for me to follow
this is the reason Mr. Yellow
Please do help me with a link that will help me catch the text edit event

Mahesh

hayne 08-16-2005 06:51 PM

Quote:

Originally Posted by maheshstms
i am not so strong in cocoa, so it is too hard for me to follow

That is why you need to sit down and dedicate a few weeks to learning Cocoa from the beginning, starting with the conceptual documents - and (as I keep on saying) buying a book on Cocoa and reading it cover to cover. Then you will be able to understand what functionality is available via Cocoa and what you need to do to implement your program. Part of what you will learn is the terms used in Cocoa programming and this will help you to ask more specific questions.

But perhaps you want to try to describe - in high-level terms (i.e. from the point of view of the user of your software) what you are trying to achieve and then we can point you in the right direction. Note: don't ask about implementation-level things - instead describe what functionality the user will see.

maheshstms 08-17-2005 01:24 PM

I am sorry
I will explain my problem, I have a text box will holds password as the user types. When the password length reaches a length of 4, I will have to enable "OK" button and if the password exceeds a length of ten, i should stop getting further inputs

please help me present my software with this functionality

I am very sorry for not explaining this properly,

Mahesh

hayne 08-17-2005 01:46 PM

Quote:

Originally Posted by maheshstms
I have a text box will holds password as the user types. When the password length reaches a length of 4, I will have to enable "OK" button and if the password exceeds a length of ten, i should stop getting further inputs

First of all, you should be using NSSecureTextField for password input.

And to do the validation-on-the-fly of the password, you should use the delegate methods provided. See, for example, the overview page on text editing (on your hard disk):
OverviewEditing.html
or on Apple's developer site:
OverviewEditing.html

Quote:

Originally Posted by hayne
Step 3: Read some more documentation - e.g. concept doc on text handling

Just to point out that I had already referred you to the documentation that you needed to read in a previous post.

maheshstms 08-18-2005 02:08 PM

thanks Hayne
i will try this and post a reply back
thankyou all

Mahesh

maheshstms 08-20-2005 03:02 AM

Adding data to a NSPopUpButton
 
Hai
I am involved in a project where i will have to add few titles to NSPopUpButton.

i add all user name to it

I tried doing this from init, i found the object created for my NSPopUpButton has a null(nil) value.

I will have to insert all user name before the user views my window

please do help me

thanks

Mahesh

hayne 08-20-2005 04:50 AM

Quote:

Originally Posted by maheshstms
I tried doing this from init, i found the object created for my NSPopUpButton has a null(nil) value.

I will have to insert all user name before the user views my window

I'm not sure why - but it still seems to me that you have not followed my advice about taking the time to read through the Cocoa documentation - and to buy a book on Cocoa.
You are wasting your time (and ours) by trying to solve your immediate problems (i.e. continuing to program) without learning the basics.

In the particular case that you ask about, I suspect that the problem is that you are trying to access the UI components too early - before they have been initialized. Read the docs about NIB files and in particular, look at 'awakeFromNib'

maheshstms 08-20-2005 10:59 AM

Sorry hayne,
I dint neglect ur advice, sorry if i have wasted ur time.

I dont have a MAC PC at home I have a Athlon
so, I cannot practice or learn manythings at home.
My company has accepted to go for a book abt cocoa please do suggest me a good one
and
thanks, i got my title loaded to NSPopUpButton by placing my code on awakeFromNib
and i captured the edit event too by registering to notification

Thanks hayne
I am 5 months exp. to the software industry. I will rectify my mistakes in the furure hayne

Mahesh

hayne 08-20-2005 12:35 PM

Quote:

Originally Posted by maheshstms
My company has accepted to go for a book abt cocoa please do suggest me a good one

Quote:

Originally Posted by hayne (post #3)
See book recommendations (and lots of useful info too) at www.cocoadev.com

The book by Hillegass is probably the best one for starting with.

maheshstms 08-22-2005 12:31 AM

thanks for a quick reply like this people
I will bye the book

i will post the step by step procedure of how to capture text edit event in next post

bye

Mahesh

maheshstms 08-30-2005 01:28 PM

sorry in the delay in the posting, i added this in awakeFromNib tocapture text edit event

[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(textDidChange:)
name: NSControlTextDidChangeNotification
object: myTextBox];

where textDidChangeis the name of method to be called during NSControlTextDidChangeNotification event on myTextBox

Thanks guys

maheshstms 08-30-2005 01:32 PM

I have this functionality working i my application works fine
I have all my functionality working
there is a place module in my application where the user selects a user name from a popupbutton i like to focus on my textbox when this is done

can u guys help me with the function that i will have to call

please, i dint get my cocoa book in hand still,

thanks

Mahesh

hayne 08-30-2005 05:47 PM

Quote:

Originally Posted by maheshstms
there is a place module in my application where the user selects a user name from a popupbutton i like to focus on my textbox when this is done

Go to www.cocoadev.com (which I mentioned above)
and search for: Focus
Read all of those pages until you find the answer.


All times are GMT -5. The time now is 06:02 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.