Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Objective-C Common class in ios

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the example analysis of Objective-C class commonly used in ios. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

NSRange (location, length):

Eg:

NSRange R1 = {2hello kitty 5}; NSRange R2 = {.location = 2, .length = 5}; NSRange R3 = NSMakeRange (2Power5); / / Development NSRange R4 = [@ "hello kitty", rangeOfString:@ "kit"]; / / R4 = {6 NSRange 3} NSRange R5 = [@ "hello kitty", rangeOfString:@ "java"]; / / R5 = {NSNotFound,0}

Ps: NSNotFound =-1

NSString: its instance can contain any Unicode character

Eg:

NSString * name = @ "Big Tiger"

Methods:

-(NSUInteger) length

-(BOOL) isEqualToString: (NSString *) other

-(NSString *) uppercaseString

-(NSRange) rangeOfString: (NSString *) aString

NSArray:

Methods:

-(NSUInteger) count

The for loop array uses it, and you can add or remove array objects in the loop; the total is automatically calculated in fast enumeration, but there can be no add and delete operations:

For (type * object in collection) {statements} this is the end of the article on "sample Analysis of Objective-C commonly used in ios". I hope the above content can be of some help to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report