OBJECTIVE-C Learning (Foundation framework)--01 structural bodies

Source: Internet
Author: User

Nsrange (location length)

"I Love OC"
Nsrange r = Nsmakerange (2,4)

NSString *str = @ "I love You";

Nsrange range = [str rangeofstring:@ "Love"];

NSLog (@ "loc =%ld, length =%ld", range.location, Range.length);

Cannot find length = 0,location = Nsnotfound = =-1 (sign bit involved)

Nspoint\cgpoint Cross-platform

Cgpoint p = nsmakepoint (10, 10);
Nspoint p = cgpointmake (20, 20);

Cgsize s = nsmakesize (20, 20);
Nssize s = cgsizemake (100,100);

Nsrect\cgrect (Cgpoint cgsize)
CGRect r = CGRectMake (0, 0, 2, 3);

Origin.x
Origin.y
Sieze.width
Sieze.height

NSLog ("%@", [Nsstringfromesize (s)]);
Nsstringfromerect (R)

Cgpointzero = = Cgpointmake (0, 0)
CGRect r1 = {Cgpointzero, cgsizemake (100, 100)};

BOOL B = Cgpointequaltopoint (Cgpointmake (Ten), Cgpointmake (10, 20));
Cgrectequaltorect

BOOL B = Cgrectcontainspoint (CGRectMake (80, 80), Cgpointmake (+);
CG = Coregraphics Frame

NS = NextStep's Foundation

OBJECTIVE-C Learning (Foundation framework)--01 structural bodies

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.