• 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
Re: Highly Newbie Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Highly Newbie Question (From: Rod Kirkpatrick <email@hidden>)

  • Prev by Date: Highly Newbie Question
  • Next by Date: Re: Bindings and Undoing changes
  • Previous by thread: Highly Newbie Question
  • Next by thread: Re: Highly Newbie Question
  • Index(es):
    • Date
    • Thread