• 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: Dissappearing string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dissappearing string


  • Subject: Re: Dissappearing string
  • From: Charlie Dickman <email@hidden>
  • Date: Wed, 16 May 2012 13:39:50 -0400

And a good "guess" it was because it got me to add the release and = nil to the code...

	possible[strlen(possible)] = '\0';
	NSString *possibleString = [NSString stringWithFormat: @"%s", possible];
	NSAttributedString *theAttributedString =
			   [[NSAttributedString alloc ] initWithString: possibleString
							attributes: theAttributes];
	[theSudokuTextField setAttributedStringValue: theAttributedString];
	[theAttributedString release];
	theAttributedString = nil;

and now it's working again. However, as you can see, theAttributedString itself is not mutable.

Thanks millions!

On May 16, 2012, at 1:13 PM, Jens Alfke wrote:

>
> On May 16, 2012, at 9:44 AM, Charlie Dickman wrote:
>
>> The actual problem is that I am telling an NSTextfield to set it's contents (the method is actually a part of NSCell from which NSTextfield inherits it)
>
> No; NSTextField inherits that method from NSControl.
> (It _contains_ an NSTextFieldCell, which inherits a method of the same name from NSCell. I know, controls vs. cells is confusing…)
>
>> and it does not appear in the textfield. It used to work but I have no idea what I did to break it.
>
> Only thing I can guess is that you passed in a mutable attributed string and later changed its contents. If the control didn’t internally create and store a copy of the original string, this will change the string it contains behind its back.
>
> —Jens

Charlie Dickman
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Dissappearing string
      • From: "Stephen J. Butler" <email@hidden>
    • Re: Dissappearing string
      • From: "Stephen J. Butler" <email@hidden>
References: 
 >Dissappearing string (From: Charlie Dickman <email@hidden>)
 >Re: Dissappearing string (From: Graham Cox <email@hidden>)
 >Re: Dissappearing string (From: Charlie Dickman <email@hidden>)
 >Re: Dissappearing string (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Layout constraint related exceptions
  • Next by Date: Re: Dissappearing string
  • Previous by thread: Re: Dissappearing string
  • Next by thread: Re: Dissappearing string
  • Index(es):
    • Date
    • Thread