what is the use of NSMakeRange in objective c? -


I am new to objective C and most of the time I am using NSR in my code. I have come to know that 'NSMKRange' is why, I want to know what is the use of NSMKRange.

This is a feature inline function, it's NSRange structure , returns it by populating it:

(to .. ./foundation.framework/Headers/ NSRange.h )

NS_INLINE NSRange NSMakeRange (NSUInteger loc, NSUInteger Lane) {NSRange r; R.location = loc; R.length = len; Return r; }

This makes it easy to create categories; Compare:

  unichar buffer [8]; [SomeString getCharacters: Buffer Range: NSMKrange (2, 8)];  

From:

  unichar buffer [8]; NSRange category = {2, 8}; [SomeString getCharacters: Buffer Range: Category];  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -