• 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
trouble with NSRange.location
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trouble with NSRange.location


  • Subject: trouble with NSRange.location
  • From: Robert Burns <email@hidden>
  • Date: Thu, 18 Dec 2003 11:00:43 -0600

Greetings!

new to the list and fairly new to cocoa.

I've searched the archives and much documentation and can't understand
what's going wrong with my use of an NSTextStorage editedRange.
Whenever I get the editedRange.location (and I've tried this many
different ways) I always get the integer 2147483647 instead of
something within the length of the text. If I get the
editedRange.length it gives me exactly what I expect (i.e., 1 if no
text is selected, 0 if it's a backspace delete, and n when selected
text is changedf n characters in length). So does anyone know what I'm
missing here?

This class is serving as a delegate to an NSTextView, established in IB.

Thanks,
Rob Burns

ps, code follows:


#import "LLTempoController.h"

@implementation LLTempoController

- (void)textDidChange:(NSNotification *)notification;
{

NSLog(@"retainCount of notification is %d", [notification
retainCount]);

theText = [[notification object] textStorage];

unsigned int insertionIndex = [theText editedRange].location; //
it's always 2147483647;
unsigned int insertionLength = rangeForInsertion.length;

NSLog(@"insertionIndex in first routine is %d", insertionIndex);
NSLog(@"insertionLength in first routine is %d", insertionLength);

}

@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: trouble with NSRange.location
      • From: Fritz Anderson <email@hidden>
    • RE: trouble with NSRange.location
      • From: "Jonathan E. Jackel" <email@hidden>
  • Prev by Date: Re: How can I set an Action to a NSTableView Column?
  • Next by Date: trouble with NSRange.location
  • Previous by thread: Re: How can I set an Action to a NSTableView Column?
  • Next by thread: RE: trouble with NSRange.location
  • Index(es):
    • Date
    • Thread