
Object-C
teamlet
这个作者很懒,什么都没留下…
展开
-
Objective-C在windows开发环境的搭建
一、安装 从 http://www.gnustep.org/experience/Windows.html 下载四个文件1、GNUstep MSYS System 2、GNUstep Core 3、GNUstep Devel 4、Cairo Backend 依次按照顺序安装在 d:/GNUStep二、编码用记事本编写代码,完整的代码如下:#include int m原创 2010-08-27 13:31:00 · 3381 阅读 · 1 评论 -
xcode 4.6 使用NSURLConnection 获取网页内容(iOS6.1,纯手工编码,无xib,无storyboard)
环境 iOS 6.1, xcode 4.6一、创建新项目1、打开 xcode,File --> New --> Project... -->Empty Application2、项目名称 NSURLConnectionDemo,下面所有选项全部不选,完成创建。二、创建视图控制器3、File-->New-->File-->Objective-C class4、创建UIViewController原创 2013-05-17 21:25:58 · 6054 阅读 · 1 评论 -
获取iphone本机号码(在iOS 6.1, iPhone5 ,移动号码, xcode 4.6上测试通过)
在 iOS 6.1, iPhone5 ,移动号码, xcode 4.6上测试通过创建一个空白的工程1)导入CoreTelephony.framework2)在AppDelegate.m中 #import 语句下面添加 extern 语句,如下所示: #import "AppDelegate.h"extern NSString *CTSettingCopyMyPhoneNumber(); 3)原创 2013-05-30 16:10:29 · 8938 阅读 · 4 评论 -
iOS UILabel 文字自动左上角对齐
iOS中默认的UILabel是垂直居中对齐的,如果UILabel设置的高度较大,当内容少的时候,会自动垂直居中。创建一个 UILabel的category代码如下: #import @interface UILabel (LeftTopAlign)- (void) leftTopAlign;@end #import "UILabel+LeftTopAlign.h"@imp原创 2015-10-20 21:42:07 · 12440 阅读 · 0 评论 -
编译samba遇到need autoconf 2.53 or later to build samba from GIT
在使用Objective-C wrapper for sambaclient的时候,rake 出现编译错误。操作步骤:1、下载2、解压kxsmb3、进入kxsmb目录4、执行 rake错误提示包括 : need autoconf 2.53 or later to build samba from GIT ...解决方法:curl -OL http://ftpmirror.gnu.org/autoc原创 2016-03-06 09:56:15 · 2524 阅读 · 0 评论 -
brew - 可以简单的获取数千种开源工具和函数库的包管理器
一、简介brew是一个使用ruby语言、由非营利组织开发的包管理工具。Homebrew程序提供的brew,严格来讲不是一个OS X的原生命令,但任何一个OS X的专业用户都不会错过它。“OS X缺少的包管理器”这个评价是恰如其分的。如果你曾经在Linux上使用过apt-get,你就会发现Homebrew基本上是一样的。使用brew可以简单的获取数千种开源工具和函数库。例如:brew install原创 2016-03-06 11:12:08 · 2158 阅读 · 0 评论 -
Mac 10.10 yosemite 安装samba替代系统samba组件
一、工具 brew1、brew 介绍brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令, 非常方便brew类似ubuntu系统下的apt-get的功能。brew 的官方网站: http://brew.sh/ 2、安装brew打开终端,执行下面语句:ruby -e "$(curl -fsSL https://raw.gith转载 2016-03-05 23:16:38 · 6347 阅读 · 1 评论 -
使用category 为 AppDelegate 的代码分层
category是一种为现有的类添加新方法的方式。利用Objective-C的动态运行时分配机制,Category提供了一种比继承(inheritance)更为简洁的方法来对class进行扩展,无需创建对象类的子类就能为现有的类添加新方法,可以为任何已经存在的class添加方法。AppDelegate 是iOS app启动的入口,经常需要添加各类的第三方应用,比如:定位服务、统计服务、消息推送服务原创 2016-03-12 08:43:00 · 8038 阅读 · 3 评论 -
绘制Objective-C程序的UML类图
原地址: http://www.processon.com/view/52d3baf20cf2d6fcd08cc8b2转载 2016-02-25 21:18:14 · 7146 阅读 · 0 评论 -
UIViewController生命周期
在UIViewController中,controller的view存在两个循环:加载和卸载循环,可参考下图:加载循环程序请求controller的view如果view在内存中,则直接加载。相反,如果不存在,则UIViewController调用loadView方法loadView方法执行如下操作:如果你重载了这个方法,则必须创建必要的view并且将一个非nil值传给UIViewControlle转载 2013-02-12 12:02:08 · 3124 阅读 · 0 评论 -
Understanding Windows and Screens
Understanding Windows and ScreensA window handles the overall presentation of your app’s user interface. Windows work with views (and their owning view controllers) to manage interactions with, and ch原创 2013-02-12 00:41:15 · 1810 阅读 · 2 评论 -
用 NSLog 观察 UIApplicationDelegate 每个事件实现的执行
////FirstAppDelegate.m file//#import "FirstAppDelegate.h"@implementation FirstAppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{原创 2013-02-07 21:48:05 · 2008 阅读 · 0 评论 -
Converting to Storyboards Release Notes
Storyboarding is a new way to create user interfaces for iOS applications, beginning with iOS 5 and Xcode 4.2. Using storyboards, you can design the view controllers that compose your application as s转载 2013-01-12 20:42:21 · 1660 阅读 · 0 评论 -
Coordinating Efforts Between View Controllers--UIApplicationMain 初始化的步骤
Coordinating Efforts Between View ControllersFew iOS apps show only a single screenful of content. Instead, they show some content when first launched and then show and hide other content in response转载 2013-01-12 21:21:48 · 1708 阅读 · 0 评论 -
UIApplicationMain
UIApplicationMainThis function is called in the main entry point to create the application object and the application delegate and set up the event cycle.int UIApplicationMain ( int argc, char *转载 2013-01-12 22:49:53 · 2000 阅读 · 0 评论 -
Creating a Project That Uses Storyboards
Create an iOS project that’s configured to use storyboards. Most iOS application project templates include the option to use a storyboard. If you use storyboards, your application must be deployed in转载 2013-01-12 21:25:17 · 1725 阅读 · 0 评论 -
iphone程序的生命周期分析
一、概述做iphone开发,了解iphone程序的生命周期非常的重要。从点击程序图标启动程序开始,到退出程序,程序整个运行过程中都发生了什么事情?为什么要这么做?只有理解了这些技术细节才能游刃有余的掌握Iphone程序的开发。二、目标首先来写一个HelloWorld程序,放弃Xcode提供的代码模板,不使用xib不使用ib,不使用storyboard,亲自动手一行一行的编写代码。虽然真正开发项目的原创 2013-01-13 16:55:08 · 2147 阅读 · 0 评论 -
xcode 4.5 创建项目
一、启动Xcode 4.5,创建新的Xcode项目二、选择模板三、输入项目信息Product Name,Organization Name,Company Identifier,Class Prefix信息,选中Use Storyboard,Use Automatic Reference Counting,不选Include Unit Tests四、选择存储项目的位置五、项目创建完毕后的文件和目录原创 2013-01-13 21:02:58 · 6214 阅读 · 0 评论 -
UIApplicationMain、UIApplication 和 UIApplicationDelegate 协议的关系
main.m是iphone程序执行的入口。一个典型的main.m文件如下:#import #import "AppDelegate.h"int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([App原创 2013-02-07 21:31:05 · 5394 阅读 · 0 评论 -
Objective-C中的协议使用举例
一、协议 Protocol简介协议是一种特殊的程序设计结构,用于声明专门被别的类实现的方法.协议在以下场合非常有用:声明需要由别的类实现的方法声明未知类的接口集中定义一些互相之间没有继承关系的类的相似点协议声明类需要实现的的方法,为不同的类提供公用方法,一个类可以有多个协议,但只能有一个父类,即单继承。它类似java中的接口。可以在协议声明中使用@optional和@required指令来指定协议原创 2013-02-07 20:55:17 · 4942 阅读 · 0 评论 -
为AppDelegate分层的面向服务架构的 SOAComponentAppDelegate
名称解释一下:1、SOA是面向服务的架构,所有的第三方功能都被分别封装成服务。2、Component 表示这个类是用于引用的,不能用于继承。是对上一篇《category 分离 AppDelegate代码》的改进。一、首先创建服务类,服务类是对第三方服务的封装。第三方服务包括推送、支付、统计等1、服务举例 BaiduPushService 头文件新创建的服务类需要添加 UIApplicationD原创 2016-03-12 13:08:14 · 4278 阅读 · 8 评论