"Foundation Frame" Struct

Source: Internet
Author: User

//
//MAIN.M
//struct
//
//Created by Mac on 14-12-2.
//Copyright (c)yearsmac. All rights reserved.
//

#import<Foundation/Foundation.h>

#pragma markBasic data Types----
voidBaseType ()
{
//unsigned Long%lu
Nsuinteger i;
//long
NsintegerJ;
//double
NstimeintervalK;
}

#pragmaStructural Body---------------
voidStructtype ()
{
//first Type
Nsrange range = { the, the};
NSLog(@ "%lu,%lu", range. Location, range.length);
//second Type
Nsrange Range1 = {. Location= +, .length= the};
NSLog(@ "%lu,%lu", Range1. Location, Range1.length);
//third Type
Nsrange Range3 = Nsmakerange(456,789);
NSLog(@ "%lu,%lu", Range3. Location, Range3.length);

//example
NSString *str =@ "Hello,nsstruct";
Nsrange range4 = [Strrangeofstring:@ "Hello"];
NSLog(@ "%lu,%lu", Range4. Location, Range4.length);

//point
NspointPoint = Nsmakepoint(0.0,0.0) ;
//size
nssizesize = nsmakesize(34.2,123.1);
//rect
Nsrectrect = Nsmakerect(0.0,0.0,234,231);

//CGthe beginning of the structure of the body
Cgpoint point1 = Cgpointmake(0.0,0.0);
cgsizesize1 = Cgsizemake(34.2,123.1);
CGRectRect2 = CGRectMake(45.2,34.2, +, -);

Cgpoint Point2 = Cgpointzero;
cgsizesize2 = Cgsizezero;
CGRectrect3 = Cgrectzero;

}


intMain (intargc, Const Char * argv[]) {
@autoreleasepool {

Structtype();
}
return 0;
}

"Foundation Frame" Struct

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.