`
jsntghf
  • 浏览: 2479174 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论
文章列表
UITableView中有两种重用Cell的方法: - (id)dequeueReusableCellWithIdentifier:(NSString *)identifier; - (id)dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0);   在iOS 6中dequeueReusableCellWithIdentifier:被dequeueReusableCellWithIdentifier:for ...
GCC手册中的相关解释: unused:This attribute, attached to a function, means that the function is meant to be         possibly unused. GCC will not produce a warning for this function. =============================================================================== used: This attribute, attached to a funct ...
__block int timeout = 60; // 倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), 1.0 * NSEC_PE ...
Swift调用Objective-C需要一个名为<工程名>-Bridging-Header.h的桥接头文件。桥接头文件的作用是为Swift调用Objective-C对象搭建一个桥,它的命名必须是<工程名>-Bridging-Header.h,我们需要在桥接头文件中引入Objective-C头文件,而且桥接头文件是需要管理和维护的。 一、创建Swift工程 为了能够更好的介绍混合搭配调用,我们首先创建一个Swift工程。出于简单考虑,我们可以创建一个Mac OS X命令行工程,而不是一个iOS工程。   启动Xcode 6,然后单击File→New→Project ...
self.view.backgroundColor = [UIColor clearColor]; self.view.opaque = NO; self.navigationBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 64)]; [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationB ...
#define kArrowHeight 10 - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) self.backgroundColor = [UIColor clearColor]; return self; } - (void)drawRect:(CGRect)rect { [self drawInContext:UIGraphicsGetCurrentContext()]; ...
1、在viewDidLoad中添加观察者 [self.tableView addObserver:self forKeyPath:@"contentSize" options:0 context:NULL];   2、重写observeValueForKeyPath方法,一旦UITableView的contentSize发生改变,就会调用这个方法 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:( ...
一、Objective-C中执行JavaScript代码 #import <JavaScriptCore/JavaScriptCore.h> int main(int argc, char *argv[]) { JSContext *context = [[JSContext alloc] init]; JSValue *result = [context evaluateScript:@"1 + 2"]; NSLog(@"1 + 2 = %d", [result toInt32]); // 1 ...
(1)SOLAddLocationViewController.h #import <UIKit/UIKit.h> @interface SOLAddLocationViewController : UIViewController <UISearchDisplayDelegate, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate> @end   (2)SOLAddLocationViewController.m #import "SOLAddLocationV ...
1、定义   2、使用示例 (1)Downloader.h #import <Foundation/Foundation.h> typedef void (^SOLWeatherDataDownloadCompletion)(NSDictionary *dic, NSError *error); @interface Downloader : NSObject + (instancetype)sharedDownloader; - (void)dataForUrl:(NSString *)requestURL completion:(SOLWeather ...
本文使用的系统环境如下图所示  1、下载源码 GCC4.9.2的源码可以到这里下载。   2、解压源码 $ tar xvf gcc-4.9.2.tar.bz2   3、下载编译所需的依赖包 $ cd gcc-4.9.2 $ ./contrib/download_prerequisites   如果连接不上服务器或者下载比较慢的话,可以修改download_prerequisites文件,将下载地址中的ftp://gcc.gnu.org/pub/gcc/infrastructure替换成http://mirrors-uk.go-parts.com/gcc/infrastr ...
1、RegularParser.h #import <Foundation/Foundation.h> @interface RegularParser : NSObject + (NSArray *)imageUrlsInString:(NSString *)string trimedString:(NSString **)trimedString; @end   2、RegularParser.m #import "RegularParser.h" static NSString *imageRegular = @" ...
(1)UIView+MotionEffect.h #import <UIKit/UIKit.h> @interface UIView (MotionEffect) @property (nonatomic, strong) UIMotionEffectGroup *effectGroup; - (void)addXAxisWithValue:(CGFloat)xValue YAxisWithValue:(CGFloat)yValue; - (void)removeSelfMotionEffect; @end   (2)UIView+MotionEf ...

实现http接口

    博客分类:
  • C
1、安装libevent $ tar xvzf libevent-2.0.20-stable.tar.gz $ cd libevent-2.0.20-stable/ $ ./configure --prefix=/usr/local/libevent-2.0.20-stable/ $ make $ make install   2、修改LD_LIBRARY_PATH $ export LD_LIBRARY_PATH=/usr/local/libevent-2.0.20-stable/lib:$LD_LIBRARY_PATH $ sudo ldconfig   3、简易实现 ...
1、JSON解析 - (NSDictionary *)serializedData:(NSData *)data { NSError *JSONSerializationError; NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&JSONSerializationError]; if(JSONSerializationError) { [NSException ra ...
Global site tag (gtag.js) - Google Analytics