Re: Highly Newbie Question
Re: Highly Newbie Question
- Subject: Re: Highly Newbie Question
- From: Sarat Kongara <email@hidden>
- Date: Fri, 17 Jun 2005 22:23:57 -0700
Hi Rod,
If you are looking to create a NSString from the sourceString so you
can use NSTextField's setStringValue to display the value in UI, try
NSString's substringToIndex
NSString *characterString = [sourceString substringToIndex:0];
Checkout http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html
for more info.
Regards
Sarat
On 6/17/05, Rod Kirkpatrick <email@hidden> wrote:
> Hi All
>
> Ive been playing around with XCode to get my feet wet - very simple stuff.
> The current objective is to get a specific character from a string using
> characterAtIndex
>
> I have two IBOutlets declared in Controller.h.
> sourceString and characterString
>
> I have two NSStrings in the same place
> sourceStringValue and characterStringValue
>
> I can successfully set sourceStringValue by taking data from the GUI using
> [sourceString stringValue]
>
> I can assign sourceStringValue to characterStringValue and display the
> result in the appropriate field in the interface.
>
> By going through old posts and shamelessly cribbing I added a variable of
> type unichar and got to
> c = [sourceStringValue characterAtIndex: 1]; which built OK
>
> How on earth do I get the "c" value back to the interface ??
>
> The problem as far as I can tell revolves around the data type Im using but
> I have no idea what
>
> TIA for any help
>
> Rod
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden