12 2015 档案

摘要:编译之后出现:ld: warning: object file xxxxx... was built for newer iOS version (8.1) than being linked (7.0)解决方法:在Build Settings -> other lingkr Flags 中添加-w... 阅读全文
posted @ 2015-12-30 14:45 Rinpe 阅读(1476) 评论(0) 推荐(0)
摘要:经排查, 系因为URL中包含有中文, 所以无法加载页面, 解决方法如下:将URL进行转码NSString *urlStr =[[NSString stringWithFormat:@"http://www.xxx.com/xxx?city=深圳"] stringByAddingPercentEsca... 阅读全文
posted @ 2015-12-30 11:00 Rinpe 阅读(241) 评论(0) 推荐(0)
摘要:apns -> 注册推送功能时发生错误,错误信息: Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的授权字符串" UserInfo=0x16545fc0 {NSLocalizedDescription=未找到应... 阅读全文
posted @ 2015-12-27 10:15 Rinpe 阅读(2913) 评论(0) 推荐(0)
摘要:我出现这个错误是在pch中添加了一个a.h文件然后在其他文件的b.h文件中就出现这个错误..后来排查出原因是:在pch中, 这个a.h文件在b.h文件之后, 所以在b.h中使用的时候就会报错 阅读全文
posted @ 2015-12-26 10:07 Rinpe 阅读(6657) 评论(0) 推荐(0)
摘要:在AppDelegate.m的- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions方法里加上一段代码[NSThreadsleepForTim... 阅读全文
posted @ 2015-12-25 20:23 Rinpe 阅读(165) 评论(0) 推荐(0)
摘要:POST:AFHTTPSessionManager *session = [AFHTTPSessionManager manager];session.requestSerializer = [AFJSONRequestSerializer serializer];NSMutableDictiona... 阅读全文
posted @ 2015-12-22 17:40 Rinpe 阅读(9520) 评论(0) 推荐(0)
摘要:主要原因如下:+ (instancetype)mineHeaderView{ return [[NSBundle mainBundle] loadNibNamed:@"DDMineHeaderView" owner:nil options:nil].lastObject;}添加手势后, 以上的... 阅读全文
posted @ 2015-12-22 15:46 Rinpe 阅读(634) 评论(0) 推荐(0)
摘要:tableView的beginUpdate和endUpdate要比reloadData和reloadRowsAtIndexPaths好,因为beginUpdate和endUpdate会执行一个动画block,图片加载的时候显的很平滑。你自己试一下就知道了。加载图片的时候要用多线程,要用缓存,也就是需... 阅读全文
posted @ 2015-12-21 22:15 Rinpe 阅读(1906) 评论(0) 推荐(0)
摘要:Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the c... 阅读全文
posted @ 2015-12-21 16:53 Rinpe 阅读(852) 评论(0) 推荐(0)
摘要:2015-01-28 21:55:17.790 Demo[636:9351] the behavior of the UICollectionViewFlowLayout is notdefined because:2015-01-28 21:55:17.791Demo[636:9351]the i... 阅读全文
posted @ 2015-12-21 16:46 Rinpe 阅读(1186) 评论(0) 推荐(0)
摘要:第一步:关闭 Xcode。第二步:如果你之前安装过Alcatraz,卸载它。在终端运行命令:rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin第三步:最关键的一步,运行以下两条... 阅读全文
posted @ 2015-12-20 23:25 Rinpe 阅读(286) 评论(0) 推荐(0)
摘要:1.最常见的原因是contentSize 这个属性,比uiscrollview的frame要小, 无需滚动, 自然就滚动不了。scrollenabled 这个属性,标识着是否允许滚动,要言设成yes2.但是今天我遇到了另外一种情况也就是将ScrollView放在一个UIView中, 该设置的属性都设... 阅读全文
posted @ 2015-12-20 20:40 Rinpe 阅读(893) 评论(0) 推荐(0)
摘要:输入pod install之后出现:[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod ... 阅读全文
posted @ 2015-12-18 18:52 Rinpe 阅读(779) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit/*---------------------------返回函数类型-----------------------------*/// 其实就是将函数当为返回值返回fun... 阅读全文
posted @ 2015-12-17 16:08 Rinpe 阅读(268) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitfunc add(a:Int, b:Int) -> Int{ return a + b}// 其中, (Int, Int) -> Int 就是显式的声明函数类型let... 阅读全文
posted @ 2015-12-17 15:26 Rinpe 阅读(158) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// swift中默认情况下, 传入的参数是不可以修改的, 也就是let类型, 也就是常量参数// 如果想修改这个参数的值, 需要在参数前加"var", 也就是变量参数fu... 阅读全文
posted @ 2015-12-17 14:17 Rinpe 阅读(601) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 可变参数一定要放在所有定义参数的最后面, 和其他参数的定义方式一样, 只是多了3个点func add(a:Int, b:Int, others:Int...) ->I... 阅读全文
posted @ 2015-12-17 13:51 Rinpe 阅读(259) 评论(0) 推荐(0)
摘要:// 参数设置了默认值之后, 在调用的时候, 可以写这个参数// 在参数前面添加"_", 表示取消外部参数名, 但还是建议使用苹果默认格式func sayHello(nickName:String = "Bobo", _ greeting:String = "Hello") -> String{ ... 阅读全文
posted @ 2015-12-17 12:18 Rinpe 阅读(445) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 外部参数的作用是为了让程序员调用代码的时候能清晰的看出所传参数代表的意思// 内部参数指的就是定义函数的时候所设定需要传入的参数func sayHello(nickN... 阅读全文
posted @ 2015-12-17 12:03 Rinpe 阅读(392) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can play import UIKit // 定义一个数组 var userScores:[Int]? = [12, 990, 572, 3258, 9999, 1024, 666] userScores = 阅读全文
posted @ 2015-12-17 11:08 Rinpe 阅读(1319) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 无参无返回// -> Void可以省略不写, 或者写成(), 因为返回值为空本质是一个空的元组func run() -> Void // (){ print("... 阅读全文
posted @ 2015-12-17 09:35 Rinpe 阅读(182) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can play import UIKit // fallthrough // fallthrough会在当前case执行完之后继续下一个case // 如果在下一个case中声明了变量, 则不能使用fallth 阅读全文
posted @ 2015-12-16 17:44 Rinpe 阅读(464) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 对区间进行判断var score = 90switch score {case 0: print("You got an egg!")case 1..是介绍运算... 阅读全文
posted @ 2015-12-16 16:44 Rinpe 阅读(531) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar rating = "A"// if - else ifif rating == "A" { print("Very Good!!");} else if r... 阅读全文
posted @ 2015-12-16 12:41 Rinpe 阅读(171) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// for-infor i in -99...99{ i * i}let array = ["Rinpe", "Bobo", "Lili"]for (index, ... 阅读全文
posted @ 2015-12-16 12:39 Rinpe 阅读(177) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 数据源let colors =[ "Air Force Blue":(red:93, green:138, blue:168), "Bittersweet... 阅读全文
posted @ 2015-12-16 12:38 Rinpe 阅读(245) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar dict = [1:"one", 2:"two", 3:"three", 4:"four"]dict.countdict.isEmptydict[1]dict[66... 阅读全文
posted @ 2015-12-16 12:37 Rinpe 阅读(217) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"var array = ["A", "B", "C", "D", "E", "F"]let arrayCount ... 阅读全文
posted @ 2015-12-16 12:36 Rinpe 阅读(163) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 注意: swift中的字典用的也是中括号, 和OC的大括号是不同的// 初始化字典var dict1 = [1:"one", 2:"two", 3:"three"] ... 阅读全文
posted @ 2015-12-16 12:36 Rinpe 阅读(1273) 评论(0) 推荐(0)
摘要:import UIKit // 声明数组 var array = ["A", "B", "C", "D", "E"]; var array2:[String] = ["A", "B", "C", "D", "E"]; var array3:Array<String> = ["A", "B", "C" 阅读全文
posted @ 2015-12-16 12:35 Rinpe 阅读(1139) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Welcome to Play Swift! Step by Step learn Swift language from now!"// range... 阅读全文
posted @ 2015-12-16 12:33 Rinpe 阅读(801) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport Foundationvar str = "Hello, playground"str.capitalizedString // 字符串中所有单词首字母大写, 不改变str本身的值... 阅读全文
posted @ 2015-12-16 12:32 Rinpe 阅读(218) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 拼接var str = "Hello, playground"str + "hello, swift" // 这样的拼接, str还是没有改变strstr +=... 阅读全文
posted @ 2015-12-16 12:30 Rinpe 阅读(180) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "hi"// 字符串拼接str += ", rinpe"str += ", lili"// 创建一个空的字符串var nullStr = String(... 阅读全文
posted @ 2015-12-16 12:18 Rinpe 阅读(163) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"var a = 1, b = 10// a到b(包含a,b) [a,b]a...b// a到b-1(包含a,不包含... 阅读全文
posted @ 2015-12-16 11:43 Rinpe 阅读(219) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// nil的聚合运算可以说是为了可选值而出的 // 它的体现是"??"// eg:// a ?? b -> ... 阅读全文
posted @ 2015-12-16 11:37 Rinpe 阅读(239) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 断言, 必须符合某个条件,程序才能继续运行下去// 可以看做是一个底线要求var age = 19;asse... 阅读全文
posted @ 2015-12-16 11:35 Rinpe 阅读(177) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can play import UIKit // swift中没有被赋值的变量是不能被使用的 //var str : String //str // Optionals 可选值 (用?号体现) // 或者是一个值 阅读全文
posted @ 2015-12-16 11:32 Rinpe 阅读(192) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKit// 元组就是将多个不同的值集合成一个数据/* 元组是Objective-C中没有的数据类型,与数组类似,都是表示一组数据的集合,但与数组不同,它的特点是: 特点: 1.可... 阅读全文
posted @ 2015-12-16 11:11 Rinpe 阅读(189) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let orangeAreYellowColor = truelet appleIsBlue = falseif ... 阅读全文
posted @ 2015-12-16 11:09 Rinpe 阅读(188) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 数值类型转换let three = 3let PI = Double(three) + 0.1415926 ... 阅读全文
posted @ 2015-12-16 11:06 Rinpe 阅读(240) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let 十进制的10 = 10let 八进制的8 = 0o10let 二进制的2 = 0b10let 十六进制的1... 阅读全文
posted @ 2015-12-16 11:03 Rinpe 阅读(168) 评论(0) 推荐(0)
摘要:import UIKitvar str = "Hello, playground"// 显式定义浮点型常量let PI:Float = 3.141592612312312let PI2:Double = 3.14123456789123123123// 隐式定义浮点型变量var randomFloa... 阅读全文
posted @ 2015-12-16 11:01 Rinpe 阅读(171) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let MAXVALUEOFUINT8 = UInt8.maxlet MINVALUEOFUINT8 = UInt... 阅读全文
posted @ 2015-12-16 10:57 Rinpe 阅读(187) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 常量的定义用letlet maxLoginCount = 10// 变量的定义用varvar current... 阅读全文
posted @ 2015-12-16 10:54 Rinpe 阅读(175) 评论(0) 推荐(0)
摘要://: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"print("HelloWorld")print("hello, swift!")print("this is m... 阅读全文
posted @ 2015-12-16 10:51 Rinpe 阅读(144) 评论(0) 推荐(0)
摘要:看图,设置成这样就会出现大量的警告,解决方法如下:将debug information format 更改为:DWARF即可 阅读全文
posted @ 2015-12-15 17:38 Rinpe 阅读(557) 评论(0) 推荐(0)
摘要:AppDelegate.m#import "AppDelegate.h"#import "Reachability.h"@interface AppDelegate ()@property (nonatomic, strong) Reachability *reachability;@end@imp... 阅读全文
posted @ 2015-12-15 17:17 Rinpe 阅读(506) 评论(0) 推荐(0)
摘要:断言, 判断是否符合某个特定条件, 符合就继续运行程序, 反之就抛出异常, 后面为自定义错误提示, 也可以使用NSParameterAssert, 在调试上有着很大的方便int a = 0;NSAssert(a != 0, @"a不是0, 不能继续运行");NSParameterAssert(a !... 阅读全文
posted @ 2015-12-15 11:48 Rinpe 阅读(163) 评论(0) 推荐(0)
摘要:在ios7中,UITableViewCell左侧会有默认15像素的空白。这时候,设置setSeparatorInset:UIEdgeInsetsZero 能将空白去掉。但是在ios8中,设置setSeparatorInset:UIEdgeInsetsZero 已经不起作用了。下面是解决办法首先在vi... 阅读全文
posted @ 2015-12-14 13:42 Rinpe 阅读(527) 评论(0) 推荐(0)
摘要:使用起来还是比较简单的, 主要是几个步骤AppDelegate.m- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self... 阅读全文
posted @ 2015-12-14 11:17 Rinpe 阅读(380) 评论(0) 推荐(0)
摘要:修改一下路径,在终端下输入下面的命令sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer敲回车后,提示输入密码就输入密码。ps:上面路径中的xcode.app改为要使用的xcode的名字, 例如: ... 阅读全文
posted @ 2015-12-12 16:59 Rinpe 阅读(203) 评论(0) 推荐(0)
摘要:禁用长按UIWebView时放大镜及选择功能://通过js调用- (void)webViewDidFinishLoad:(UIWebView*)webView{ // Disable user selection [webView stringByEvaluatingJavaScript... 阅读全文
posted @ 2015-12-12 13:28 Rinpe 阅读(995) 评论(0) 推荐(0)
摘要:// 添加QuartzCore.framework库#import -(void) screenShot{ // 截屏 UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.layer renderInCont... 阅读全文
posted @ 2015-12-12 11:04 Rinpe 阅读(345) 评论(0) 推荐(0)
摘要:使用Storyboard时出现以下警告:warning: Unsupported Configuration: Scene is unreachable due to lack of entry points and does not have an identifier for runtime a... 阅读全文
posted @ 2015-12-11 13:41 Rinpe 阅读(213) 评论(0) 推荐(0)
摘要:ios7之前的版本中UIViewController中的view在显示后会自动调整为去掉导航栏的高度的,控件会自动在导航栏以下摆放。在iOS7中UIViewController的wantsFullScreenLayout属性被舍弃了,所有的UIViewController创建后默认就是full Sc... 阅读全文
posted @ 2015-12-11 10:53 Rinpe 阅读(3696) 评论(0) 推荐(0)
摘要:我的解决方法是:info.plist中找到LSApplicationQueriesSchemes, 然后在下方添加Key如:-canOpenURL: failed for URL: "momochs://xxxxxxxx"就添加momochs添加后:LSApplicationQueriesSchem... 阅读全文
posted @ 2015-12-10 20:33 Rinpe 阅读(1550) 评论(0) 推荐(0)
摘要:如果是同一个静态库中的文件链接的时候有冲突,可能是这个静态库不支持模拟器,真机运行就好了。或者可以使用xcode7的虚拟机跑也是没问题的。duplicate symbol _llvm.cmdline in:/Users/RinpeChen/Documents/项目/mq_dd/DuoDuo/DuoD... 阅读全文
posted @ 2015-12-10 17:29 Rinpe 阅读(433) 评论(0) 推荐(0)
摘要:原因如下:There's no problem with your implementation. All those warnings mean is the apps which each URL scheme refer to are not installed on the device.I... 阅读全文
posted @ 2015-12-09 23:14 Rinpe 阅读(1670) 评论(0) 推荐(0)
摘要:基本应用如果你有self-satisfied cell,那么你应该做的是:#import "UITableView+FDTemplateLayoutCell.h"- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath... 阅读全文
posted @ 2015-12-09 10:55 Rinpe 阅读(385) 评论(0) 推荐(0)
摘要:1.状态栏高亮颜色在info.plist中添加View controller-based status bar appearance设置为 "NO"在AppDelegate.m中添加代码[[UIApplication sharedApplication] setStatusBarStyle:UISt... 阅读全文
posted @ 2015-12-08 18:00 Rinpe 阅读(322) 评论(0) 推荐(0)
摘要:创建playground之后,我们将得到一个错误提示,Error running playground: Failed to prepare for communication with playground”。如果这种情况发生,关闭Xcode然后重启,这个错误就会消失了。 阅读全文
posted @ 2015-12-08 10:58 Rinpe 阅读(359) 评论(0) 推荐(0)
摘要:先看官网的图可以看到官方说了xcode7可以让所有人都更轻松的将app运行在自己的设备上,而无需开发者帐号。不过xcode7需要OSX10.11的支持,而目前(2015.06.10)下载后者的开发者预览版是需要开发者帐号的,我在网上找到了资源传到了百度云,OSX10.11:链接:http://pan... 阅读全文
posted @ 2015-12-08 10:14 Rinpe 阅读(211) 评论(0) 推荐(0)
摘要:现在很多APP为了让用户更加快捷方便注册,都会使用第三方进行登录,例如QQ/微信/淘宝等。但是上线审核被拒,大致会出现以下内容: Additionally, we found that your app requires the installation of another app before... 阅读全文
posted @ 2015-12-04 09:48 Rinpe 阅读(592) 评论(0) 推荐(0)
摘要:[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextE 阅读全文
posted @ 2015-12-03 12:00 Rinpe 阅读(2625) 评论(0) 推荐(0)
摘要:一、概要iOS开发时,项目中会引用许多第三方库,CocoaPods(https://github.com/CocoaPods/CocoaPods)可以用来方便的统一管理这些第三方库。二、安装由于网上的教程基本都大同小异,但细节之处还不是很完善,所以借机会在这里补充下:注:要使用CocoaPods,那... 阅读全文
posted @ 2015-12-02 17:28 Rinpe 阅读(224) 评论(0) 推荐(0)
摘要:简单说就是这么几步:选择Target -> Build Settings 菜单,找到\”User Header Search Paths\”设置项新增一个值"${SRCROOT}",并且选择\”Recursive\”,这样xcode就会在项目目录中递归搜索文件自动补齐功能马上就好使了。 阅读全文
posted @ 2015-12-02 17:21 Rinpe 阅读(242) 评论(0) 推荐(0)
摘要://uin=2977046873为QQ号NSString *urlString = @"mqq://im/chat?chat_type=wpa&uin=2977046873&version=1&src_type=web";if([[UIApplication sharedApplication] c... 阅读全文
posted @ 2015-12-01 15:07 Rinpe 阅读(3224) 评论(0) 推荐(0)