随笔分类 - iPhone/iPad
摘要:1. 重新安装。前提是保证彻底卸载,完全卸载使用下面命令:sudo /Developer/Library/uninstall-devtools --mode=all逼急了才用的方法2. 使用32位模式运行Xcode在Finder里,找到/Developer/Application/XCode.app,右击,菜单里选择Get Info,然后选中Open in 32-bit mode3. 删除project.xcworkspace文件在Finder里,右击工程文件XXX.xcodeproj,菜单里选择Show Package Contents,打开以后可以看到project.xcworkspace
阅读全文
摘要:This is a (somewhat) hidden preference which allows you to define the number of concurrent compile tasks:defaults write com.apple.dt.XcodeIDEBuildOperationMaxNumberOfConcurrentCompileTasks4To Disable Indexing in the IDEThis one disables code sense indexing, which can save a lot of resources in large
阅读全文
摘要:最近的项目遇到了网络请求,需要在请求完成后回调delegate的方法。然而回调时经常遇到这种情况:delegate已经被释放,这时调用其方法则会引起crash。objc的runtime中有两种判断类型的方式比较靠谱,他们可以直接取得任意一个objc_object(和id是完全一样的数据类型)的类或者类名。其函数如下://Returns the class name of a given object.const char *object_getClassName(id obj); //Returns the class of an object.Class object_getClass(id
阅读全文
摘要:http://stackoverflow.com/questions/9602966/uitableview-with-static-headershttp://stackoverflow.com/questions/664781/change-default-scrolling-behavior-of-uitableview-section-header关键代码段:Below is one solution:-(void)scrollViewDidScroll:(UIScrollView*)scrollView {CGFloat sectionHeaderHeight =40;if(scro
阅读全文
摘要:#if !defined(__clang__) || __clang_major__ < 3 #ifndef __bridge #define __bridge #endif #ifndef __bridge_retain #define __bridge_retain #endif #ifndef __bridge_retained #define __bridge_retained #endif #ifndef __autoreleasing #define __autoreleasing ...
阅读全文
摘要:lipo -create -arch i386 i386/libavcodec.a -arch armv7 armv7/libavcodec.a -output universal/libavcodec.alipo -create -arch i386 i386/libavdevice.a -arch armv7 armv7/libavdevice.a -output universal/libavdevice.alipo -create -arch i386 i386/libavformat.a -arch armv7 armv7/libavformat.a -output universa
阅读全文
摘要:ffmpeg git:https://github.com/FFmpeg/FFmpeggas-preprocessor git:https://github.com/yuvi/gas-preprocessor#!/bin/tcsh -fif (! -d i386) mkdir i386if (! -d lib) mkdir librm i386/*.amake clean#./configure --arch=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386' --disable-encod
阅读全文
摘要:ffmpeg git:https://github.com/FFmpeg/FFmpeggas-preprocessor git:https://github.com/yuvi/gas-preprocessor#!/bin/tcsh -fif (! -d armv7) mkdir armv7if (! -d lib) mkdir librm armv7/*.amake clean./configure \--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
阅读全文
摘要:- (IBAction) renderScrollViewToImage { UIImage* image = nil; UIGraphicsBeginImageContext(_scrollView.contentSize); { CGPoint savedContentOffset = _scrollView.contentOffset; CGRect savedFrame = _scrollView.frame; _scrollView.content...
阅读全文
摘要:// DLog is almost a drop-in replacement for NSLog // DLog(); // DLog(@"here"); // DLog(@"value: %d", x); // Unfortunately this doesn't work DLog(aStringVariable); you have to do this instead DLog(@"%@", aStringVariable); #ifdef DEBUG # define DLog(fmt, ...) NSLog((@
阅读全文
摘要:- (void)moveView:(UITextField *)textField leaveView:(BOOL)leave { UIView *accessoryView = textField.inputAccessoryView; UIView *inputview = textField.inputView; int textFieldY = 0; int accessoryY = 0; if (accessoryView && inputview) { CGRect accesso...
阅读全文
摘要:UIViewController* transparentView = [[UIViewController alloc] init];UIViewController* controller = self.view.window.rootViewController;transparentView.view.backgroundColor = [UIColor blackColor];transparentView.view.alpha = 0.5f;controller.modalPresentationStyle = UIModalPresentationCurrentContext;[
阅读全文
摘要://ARC Helper#ifndef WS_SUPPORT_ARC#define WS_SUPPORT_ARC#if __has_feature(objc_arc_weak) //objc_arc_weak#define WS_WEAK weak#define __WS_WEAK __weak#define WS_STRONG strong#define WS_AUTORELEASE self#define WS_RELEASE self#define WS_RETAIN self#define WS_CFTYPECAST(exp) (__bridge exp)...
阅读全文
摘要:<style>body { margin:8px;}table { margin: 8px auto; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal; border: 1px solid #000000; border-collapse: collapse; table-layout: fixed;}td { border: 1px solid #000000; padding: 3px 3px 3px 3px; word...
阅读全文
摘要:Building the new version of the appBlocos de RuaI was challenged to customize theUITabBarso it meets what the designer wants. In iOS 5 this is pretty easy to do but I haven’t figured out the proper way to do it from the beginning, this post is my findings on how to do it properly by correctly using
阅读全文
摘要:Download
阅读全文
摘要://---- For providing background image to tabbarUITabBar*tabBar =[tabBarController tabBar]; if([tabBar respondsToSelector:@selector(setBackgroundImage:)]){ // ios 5 code here [tabBar setBackgroundImage:[UIImage imageNamed:@"image.png"]];} else{ // ios 4 code here CGRect frame =CGRectMake(..
阅读全文
摘要:大家平时在做与网络有关的App的时候,难免都会用到下载功能,断点续传、查看下载进度的功能再所难免。网上关于这样的代码例子也还是不少,但苦于各位苦命的程序员工作繁忙,无暇去寻找,我特此献上我的Demo一个,使用的方法非常简单,都采用了中文的注释。Download
阅读全文

浙公网安备 33010602011771号