performSelector: withObject: afterDelay help for noob please

2008-07-02 Thread Papa-Raboon
Hi There,

I have been scratching my head and trying everything to get this to
work and as a noob I find the docs a bit sparse of real world
examples.

I am trying to get performSelector: withObject: afterDelay to work but
not sure what to stick where.

I have a bit of static text I set with a value of: @record Added
with the following: [complete setStringValue:@Record added]; and I
want it to disappear after 3 seconds and I thought the easiest way
would be to just change the value to: @ with a timer.

Currently I have this: [self setStringValue:complete withObject:@
afterDelay:3.0];

Which doesn't seem to work and has the following warning:

'mainController' may not respond to '-setStringValue:withObject:afterDelay:'

What am I doing wrong please and what should my code really be?

Cheers
Paul
___

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]


Trying to display a static image on my window. Any tips would be great

2008-07-01 Thread Papa-Raboon
Hi All,

I have been trying to get a static image to display in a corner of my
window and it has to literally just sit there and do nothing however I
have searched and searched Apple's dodumentation but no success yet.

I have dropped an Image View onto the window in IB and set the
following in my .h file in Xcode:

   IBOutlet NSImageView *theImage;

Then in my .m file I have this so far:

NSString *imageName;
NSImage *tempImage;

imageName = [[NSBundle mainBundle] pathForResource:@logo 
ofType:@PNG];
tempImage = [[NSImage alloc] initWithContentsOfFile:imageName];

My image is set in my project in the resources folder and is called
logo.png and I hooked up the object to the NSImageView using IB.

Can't seem to get it to display. I believe I have a line of code
missing that will tie my MSImage to my NSImageView but not sure how.

Any Ideas please?

I'm pretty new to cocoa and don't understand all the lingo yet so be
gentle please.

Cheers
Paul
___

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]


Core animation

2008-06-30 Thread Papa-Raboon
Hi All,
I was wondering if many of you have had a go at core animation yet?
I am personally looking at making a piece of text fade in and fade out as a
confirmation that something worked in my latest project. Currently I am just
popping a bit of text on screen using:
[succcessFlag setStringValue:@Record Added];

I presume we are talking pretty simple here but the question is how simple.
If any of you knows of any cool tutorials on really quick and simple core
animation text effects could you please give me the heads up.

I've Googled loads for this but no joy yet.


Cheers
Paul Randall
___

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: NSTextView to replace NSTextList confused

2008-06-29 Thread Papa-Raboon
Hi Kyle and thanks for responding. I am not sure what part of the
documentation you refer to when you say cocoa text system but I
started reading about NSTextView and NSText and to be honest until I
get more familiar with cocoa and everything clicks into place the
documentation seems very confusing and tends to assume previous
programming knowledge and a good understanding of the nuances of this
sort of code. I have dabbled with other languages but the only
language I managed to get a good understanding of was PHP. Cocoa seems
a lot more disciplined in it's structure to me than PHP which is very
forgiving indeed.

So at the moment people have been kindly telling me what to do to
achieve each little bit of my project that I don't understand and I
have been figuring out bits myself along the way. this method seems to
work best for me as I have started to figure out more and more without
help. So I think I understand what you mean about not using NSString
with an NSTextView but if you fancy throwing together a couple of
lines of code so I can see visually how it's done then I think I will
have a better chance of understanding it eventually.

If you don't have time to then I understand totally. I am sure newbies
like me can be a little demanding at times :-)

Thanks

Paul

2008/6/29 Kyle Sluder [EMAIL PROTECTED]:
 On Sat, Jun 28, 2008 at 8:28 PM, Papa-Raboon [EMAIL PROTECTED] wrote:
 So I did this and changed the header file for my mainController to
 take the NSTextView into consideration by changing:

 IBOutlet NSTextField* theNotes;

 to:

 IBOutlet NSTextView *theNotes;

 I then built and ran the project and surprise surprise it didn't work.
 In Xcode I get the following:
 warning 'NSTextView' may not respond to '-stringValue'
 (Messages without a matching method signature will be assumed to
 return 'id' and accept '...' as arguments.).

 Any ideas what I am doing wrong please anyone.

 Look at the documentation for NSTextView.  Notice how it doesn't
 implement -stringValue?  Neither do any of its superclasses.
 Therefore you can't send an NSTextView a -stringValue message and
 expect anything meaningful.  NSTextView does inherit from NSText,
 though, which responds to -string by returning the backing store.

 Do read the documentation for the Cocoa Text System.  NSTextView is
 different from (and far more powerful than) NSTextField.

 --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 [EMAIL PROTECTED]


Re: NSTextView to replace NSTextList confused

2008-06-29 Thread Papa-Raboon
This is great, I changed the line that said:
myNotes = [theNotes stringValue];
to:
myNotes = [theNotes string];
And it worked.

I am not sure where abouts in the class reference for NSTextView it
states that you should pass it a -string rather than a -stringValue
but it worked all the same.

Brilliant

Thanks again
Paul

2008/6/29 Nathan Kinsinger [EMAIL PROTECTED]:

 On Jun 29, 2008, at 1:58 PM, Papa-Raboon wrote:

 Hi Kyle and thanks for responding. I am not sure what part of the
 documentation you refer to when you say cocoa text system but I
 started reading about NSTextView and NSText and to be honest until I
 get more familiar with cocoa and everything clicks into place the
 documentation seems very confusing and tends to assume previous
 programming knowledge and a good understanding of the nuances of this
 sort of code. I have dabbled with other languages but the only
 language I managed to get a good understanding of was PHP. Cocoa seems
 a lot more disciplined in it's structure to me than PHP which is very
 forgiving indeed.

 So at the moment people have been kindly telling me what to do to
 achieve each little bit of my project that I don't understand and I
 have been figuring out bits myself along the way. this method seems to
 work best for me as I have started to figure out more and more without
 help. So I think I understand what you mean about not using NSString
 with an NSTextView but if you fancy throwing together a couple of
 lines of code so I can see visually how it's done then I think I will
 have a better chance of understanding it eventually.

 If you don't have time to then I understand totally. I am sure newbies
 like me can be a little demanding at times :-)

 Thanks

 Paul

 If you look in the upper left corner of the NSTextView or NSText
 documentation page you will see a box labeled NSText[View] Class
 Reference, at the bottom of that box is a section labeled Companion Guide
 and in there is a link to Text System Overview, which is the doc that Kyle
 is referring to. You should probably read most of it, but especially read
 the Building a Text Editor in 15 Minutes chapter which has sample code
 that should do what you need or at least get you in the right direction.

 If you are just learning Cocoa then you should really start with the Cocoa
 Fundamentals Guide:
 http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/chapter_1_section_1.html
 or a Cocoa programming book.

 --Nathan





___

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]


Newbie Confused by ABMutableMultiValue and how to store emails and phone numbers using them.

2008-06-28 Thread Papa-Raboon
Hi again Cocoa geniuses,I am trying to get my head around the basics of the
AddressBook
framework. It seems there are not many examples of how to set/store email
addresses and phone numbers in the addressbook. I understand I need to
use ABMutableMultiValue to set my phone numbers and email addresses as
I do the actual fields of the addresses (home or work) but I can't
seem to figure out how it's done for either email addresses or phone
numbers.
I have this to set the home address:

homeAddr = [NSMutableDictionary dictionary];
[homeAddr setValue:myStreet forKey:kABAddressStreetKey];
[homeAddr setValue:myCity forKey:kABAddressCityKey];
[homeAddr setValue:myCounty forKey:kABAddressStateKey];
[homeAddr setValue:myPostcode forKey:kABAddressZIPKey];

multivalue = [[ABMutableMultiValue alloc] init];
[multivalue addValue:homeAddr withLabel:kABAddressHomeLabel];
[person setValue:multivalue forProperty:kABAddressProperty];
[multivalue release];

This all seems to work beautifully but I can't for the life of me
figure out how to do the same for the email addresses and telephone
numbers.

If anyone knows how to do this would it be possible to get the heads up from
someone please
as it's driving e nuts. As a complete newbie to Cocoa, MVC and OOP I
understand examples better
than verbose descriptions and that's where Apple's documentation seems a
little sparse :-)

Cheers

Paul Randall
___

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]


NSTextView to replace NSTextList confused

2008-06-28 Thread Papa-Raboon
Hi there guys.

I am a newbie to OOP and cocoa and as a personal project I have been
building a simple little app to allow me to quickly add people to the
Apple address book and at the moment it works well using NSTextFields
for every field, however I want to use an NSTextView to enter the text
for the 'note' field for the new contact as it would be a lot better
suited so I thought I could just lob an NSTextView at my window in
Interface builder, wire it up to my mainController class like I did
the text fields and change the reference in the header file to take
the text view into consideration.

So I did this and changed the header file for my mainController to
take the NSTextView into consideration by changing:

IBOutlet NSTextField* theNotes;

to:

IBOutlet NSTextView *theNotes;

I then built and ran the project and surprise surprise it didn't work.
In Xcode I get the following:
warning 'NSTextView' may not respond to '-stringValue'
(Messages without a matching method signature will be assumed to
return 'id' and accept '...' as arguments.).

Any ideas what I am doing wrong please anyone.

Cheers
Paul Randall
___

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: Issues with addressbook framework

2008-06-26 Thread Papa-Raboon
Aha, fixed it.
Basically if any of you get this same issue with loading a framework the way
I got around it was to delete the framework and the #import line in my code.
Save my file and then re-import the framework, save, re-add my #import
Addressbook/Addressbook.h line and all my addressbook elements of my code
sprung into life.

Schwet

Cheese
Paul

This Cocoa is great to learn once you stat to get the hang of it...



2008/6/26 Papa-Raboon [EMAIL PROTECTED]:

 Hi All,
 I am currently trying to work through a tutorial regarding creating a
 simple app that allows you to enter an address into Apple's Addressbook
 database.

 I added the addresbook framework just as the tutorial explained and saved
 my files and I can see AddressBook.framework there in the source file
 listings under other frameworks where the tutorial suggests I add it but
 whenever I type in anything that should reference this framework like
 ABMutableMultiValue etc it fails to auto complete and it's not recognised
 when I build.

 Has anyone else seen this issue before and how did you get around it?


 Cheers
 Paul



 Paul Randall

___

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]


Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Papa-Raboon
Hi All,

Anybody know where can I get some examples of if() conditionals being used
with string variables in Objective-C?

To be specific, I am trying to use an if conditional to check the value of a
string being a certain value and then replacing it with a different value if
the condition returns TRUE.
Currently I have:

NSString *theName = [NSString stringWithFormat:@%@ %@, [firstName
stringValue], [lastName stringValue]];

I thought that this would work but it doesn't:

if ([NSString theName] == @John Lenon) {

// then something here using setStringValue but haven't got a clue how to do
this.

}

I want to check if theName is currently John Lenon and change it to be
Ringo Starr.

Any help would be greatly appreciated thanks as I am a complete newbie and
need to get my head around many things in Objective-C.

Thanks

Paul Randall
___

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]


Giving focus to a specific text field after pressing a button

2008-06-25 Thread Papa-Raboon
Hi Guys. I was wondering it it is possible to pass cursor focus back to a
specific NSText UI element after pressing a button. I have been looking at
NSControl and NSText field but can't seem to find a solution to this one.
Cheers
Paul Randall
___

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]


Auto pop-up list from State field in Address book database

2008-06-25 Thread Papa-Raboon
Hi Guru dudes,I am working on a simple application where I want to get a
list from a file out of a file. Maybe XML or a flat text file and I want the
list to pop up and drill down based on what I type so that I can select
them. Like many web sites do using AJAX technologies.

Can anyone tell me where to look for the equivalent in Cocoa please?

I am a newbie so please be gentle with the terminology.

Cheers

Paul Randall
___

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]


Newbie pulling my hair out regarding a simple xcode issue. Please help :-)

2008-06-23 Thread Papa-Raboon
Hi All,

I have been trying to get my hair around Cocoa programming and have
worked through many a tutorial and it seems to be coming to me slowly.
I wondered if anyone could help me figure out a simple exercise that I
came up with myself to make it clearer how to properly address objects
with each other.

I have a simple interface in interface builder that has two text
fields (NSTextField) and a multi-line NSTextField and a button.
The two text fields are firstName  lastName. The multi-line text
field is peoplesNames The push button is addName.
All I need this to do is allow me to type a first name, last name,
press a button and the name gets added to the multiline text field.
Only issue is I cannot get my head around what connects to what in
Interface Builder.

I guess I need to concatenate the two name fields into a single
NSMutableString (with a space in the middle) then add them to an
NSMutableArray which is looped through to display in the multiline
text field.

This would be an insignificant task for an experienced Cocoa
programmer but would teach newbies like me a thing or two.
Many of the tutorials seem to be far too simple. And others too
complicated. Where's the intermediate ones like this.

Could anyone please help in some way either with a description of what
needs to be done or a link to a similar tutorial.

Cheers

Paul Randall
___

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]