Objective-C的基础语法总结
1.NSLog(@“hello world!”);//打印语句的函数,需要打印的字符串放在@之后。NSLog(@“are %d and %d different?%@”,4,4,@”YES”);2.方括号有两个作用:1)访问数组元素2)用于通知某个对象执行什么,在方括号内第一项是对象,其余部分是需要...
Objective-c nil, Nil, NULL和NSNull的区别
在OC中可能经常会遇到 nil,Nil,NULL和NSNull,下面分析一下之间的区别:SymbolValueMeaningNULL(void *)0literal null value for C pointersnil(id)0literal null value for Objective-C...
【软件使用】Windows下的Objective-C集成开发环境搭建(IDE)
Objective-C是苹果软件的编程语言,想要上机学习、调试,有一个集成开发环境(IDE)方便很多。有三类方法搭建Objective-C的集成开发环境:1) 使用苹果的平台,集成开发环境使用Xcode。但如果没有苹果平台,想在Windows环境下学习Objective-C,可以采用以下两种方法...
黑马程序员——Objective-C语言知识点总结之OC特有语法
——Java培训、Android培训、iOS培训、.Net培训、期待与您交流!——点语法点语法本质原方法调用Student *stu = [Student new]; [stu setAge:100]; int age = [stu age];点语法stu.age = 100; int age = ...
黑马程序员-iOS基础-Objective-C基础(二)面向对象思想及类
------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! ------- 黑马程序员-iOS基础-Objective-C基础(二) 面向对象思想及类 一、面向对象思想 1、面向过程/面向对象思想 面向过程: 关注的是解决问题需要哪些步骤 面向对象...
Objective-C 【动态类型检测&响应方法】
———————————————————————————————————————————动态类型检测代码:#import <Foundation/Foundation.h>@interface Animal : NSObject-(void)run;-(void)abc;@end@impl...
Objective-C简单的音乐播放器(边下边播)
Objective-C中的音乐播放大多用AVAudioPlayer,它有很多优点: (1)可以播放任意长度音乐; (2)可以循环播放; (3)可以控制播放的时间; (4)可以控制声道的音量实现立体声效果; (5)可以调整音量。 但是AVAudioPlayer有一个很大的缺点,那就是只能用于播放本...
如何在Objective-C的结构中将NSString的值存储为char数组?
I am having trouble assigning the value of an NSString to a char * within a structure of a singleton class. The following is a simplification of my pr...
黑马程序员——Objective-C 第一天课程学习总结
Objective-C第一天课程学习总结 ------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! ------- 1.OC简介 1. 1 OC语言是在C语言的基础上增加了一层最基本的面向对象的语法1.2 OC完全兼容C语言1.3...
在Objective-c中
i develop iPhone apps, and after updating to sdk 3.0, I get an error on CFWriteStreamCreateWithFTPURL while linking. This is the code I call to get th...
Objective-C:预期类型错误
I am trying to follow a tutorial for using a stylesheet from Nick Kuh's book "iPhone App Development". The stylesheet header file is throwing: 我正在尝试按照...
复合语句在 Objective-C 中的使用
1、一般写一个tableView的写法 self.myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetH...
关于objective-c中setter的问题
This is an example from The Objective-C 2.0 Programming Language. I was just wondering, in the setter at the bottom, can I use value = [newValue retai...
我应该直接学Swift还是Objective-C?
当我们发布了Swift语言学习课程之后,收到了很多邮件和私信来问自己是否还需要学习C或者Objective-C。此外,人们似乎还在迷惑Swift到底适合iOS开发生态中的哪些部分。通过这篇文章,我希望能扫清你的疑惑并且将你送到正确的学习轨道上。我应该先学C/Objective-C还是直接学Swift...
Objective-C,我如何获得UITextField的值?
How can i get the value of a UITextField? Some sample code to attach it to an NSString would be fab! 如何获得UITextField的值?将它附加到NSString的一些示例代码将是fab!3 个解决...
Objective-C:在释放父对象之前,是否必须dealloc属性对象?
Let's say I have an object named "foo" with another object named "bar" as property. 假设我有一个名为“foo”的对象,另一个名为“bar”的对象作为属性。 When "foo" deallocates, will ...
在考虑Objective-c中的“图书馆”时,我有什么想象?
For me, a library is a collection of classes that do useful things. Typically something, that can be useful in a lot of projects. Is that also the cas...
Objective-c 集合对象
集合(NSSet)是一组单值对象的组合,集合对象的操作包括:搜索,添加,删除集合中的成员(可变集合的功能),比较两个集合,计算两个集合的交集,并集等。下面来看下(NSSet)的方法:1)集合的构建 // 构建集合的三种方法 #import <Foundation/Foundation.h>...
swift3.0和Objective-C的交互需要注意这些
投稿文章,作者:ZeroJ(Gitbub) 前言: Swift3.0出来后, 可以看到改变很大, 和cocoa, Foundation...的交互也变得更方便了, 同时Swift编写的应用适配到iOS 7, 所以, 我们可以相信: 在未来使用swift的情况会逐渐增加了, 同时会涉及到OC和Swif...
Objective-C日记-之类别Category
类别Category1,概述为现有类添加新的方法,这些新方法的Objective-C的术语为“类别”。2,用法a,声明类别@interface NSString(NumberConvenience)-(Number *)lengthAsNumber;@end//NumberConvenience这里...