objective-c
阿路阿路
这个作者很懒,什么都没留下…
展开
-
Objective-C 类的初始化
Fraction *myFraction;新建一个对象来存储一个Fraction类。 *号(asterisk)其实是声明是指向一个Fraction对象的指针。实际上myFraction除了内存地址外并不储存任何fraction的数据。myFraction = [Fraction alloc]; alloc是allocate的缩写。代码意思是给myFraction分配一些内存空间。myFractio原创 2015-03-10 10:59:21 · 339 阅读 · 0 评论 -
Objective-C 语法
下面是一个描述Objective-C类的使用的demo#import <Foundation/Foundation.h>@interface Fractions: NSObject -(void) print; -(void) setNumerator: (int) n; -(void) setDenominator: (int) d; @end@implementation Fractions{原创 2015-03-09 17:07:14 · 300 阅读 · 0 评论 -
我的第一个Obj-C程序
// // main.m // MyFirstObjCProgramme // // Created by hoz.danny on 15/3/9. // Copyright (c) 2015年 hozdanny. All rights reserved. //#import <Foundation/Foundation.h>int main(int argc, const char * a原创 2015-03-09 15:54:07 · 283 阅读 · 0 评论 -
Classes, Objects, and Methods
Consider an example from everyday life. Let’s assume that you own a car, which is obviously an object, and one that you own. You don’t have just any car; you have a particular car that was manufactured原创 2015-03-09 16:17:45 · 294 阅读 · 0 评论 -
Objective-C 数据类型和常数
Type Constant Example NSLog char ‘a’ %c short int - %hi, %hx, %ho unsigned short int - %hu, %hx, %ho int 12, -97, 0xFFE0, 0177 %i, %x, %o unsigned int 12u, 100u %u, %x,原创 2015-03-10 11:21:58 · 294 阅读 · 0 评论