摘要: UIImage图片转成base64字符串: UIImage *_originImage = [UIImage imageNamed:@"full_playlist_hl.png"]; NSData *_data = UIImageJPEGRepresentation(_image, 1.0f); N 阅读全文
posted @ 2016-06-06 16:17 超级马力 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 1 // NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 2 // [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; 3 // 4 // NSString *t... 阅读全文
posted @ 2016-06-06 16:16 超级马力 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 将NavigationBar设置透明(仅将指定视图控制器进行透明处理),步骤如下:1.在视图控制器的头文件中实现UINavigationControllerDelegate,例如:@interface PicturePreviewViewController : UIViewController<U 阅读全文
posted @ 2016-06-06 16:05 超级马力 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 1 #import "AppDelegate.h" 2 3 4 5 @implementation AppDelegate 6 7 - (void)dealloc 8 { 9 [_page release]; 10 [_window release]; 11 [_viewController release... 阅读全文
posted @ 2016-06-06 16:03 超级马力 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 1 UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame]; 2 [statusWindow setWindowLevel:UIWindowLevelStatusBar + 1]; 3 [statusWindow setBa... 阅读全文
posted @ 2016-06-06 16:02 超级马力 阅读(473) 评论(0) 推荐(0) 编辑
摘要: ASIHTTPRequest类库简介和使用说明 官方网站: http://allseeing-i.com/ASIHTTPRequest/ 。可以从上面下载到最新源码,以及获取到相关的资料。 使用iOS SDK中的HTTP网络请求API,相当的复杂,调用很繁琐,ASIHTTPRequest就是一个对C 阅读全文
posted @ 2016-06-06 15:50 超级马力 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)viewDidLoad 2 { 3 [super viewDidLoad]; 4 // Do any additional setup after loading the view. 5 self.title = @"第二页"; 6 self.view.backgroundColor = [UIColor ora... 阅读全文
posted @ 2016-06-06 15:49 超级马力 阅读(578) 评论(0) 推荐(0) 编辑
摘要: UIPickerView为用户提供了选择器功能,使用户以更好的体验方式实现数据的选择,如图: UIPickerView控件的使用方法:(创建好根视图:MainViewController) 实现部分: 阅读全文
posted @ 2016-06-06 15:48 超级马力 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 懒加载三大优势: 1,延迟内存占用 2,增加类的灵活性 3, 都是可重建的资源 可以置空 再次创建 阅读全文
posted @ 2016-06-06 15:43 超级马力 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 1 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 2 3 { 4 5 // 在tableView的协议方法中制定 每个cell的高度 6 7 8 9 UIImage *i... 阅读全文
posted @ 2016-06-06 15:42 超级马力 阅读(1176) 评论(0) 推荐(0) 编辑
摘要: 1 动画类型: 2 3 ** type 4 * 5 * 各种动画效果 其中除了'fade', `moveIn', `push' , `reveal' ,其他属于私有的API. 6 * ↑↑↑上面四个可以分别使用'kCATransitionFade', 'kCATransitionMoveIn', 'kCATransitionPush', 'kCATr... 阅读全文
posted @ 2016-06-06 15:41 超级马力 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)buttonClicked:(UIButton *)button 2 { 3 // UIView 动画 4 // 1.最简单的动画实现 5 // 参数1:动画执行一次需要的时间 6 // 参数2:动画执行的内容(写动画执行的结果) 7 // [UIView animateWithDura... 阅读全文
posted @ 2016-06-06 15:40 超级马力 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 转来的,我觉得很不错,精品! 有这样一种情形:当我们正在快乐的致力于我们的app时,并且什么看都是无比顺利,但是突然,坑爹啊,它崩溃了。(悲伤地音乐响起) 我们需要做的第一件事就是:不要惊慌。 修复崩溃不是很困难的。假如你崩溃了,并且胡乱的改些东西,而且还在不停的念着咒语希望bug神奇的自动消失,你 阅读全文
posted @ 2016-06-06 15:39 超级马力 阅读(2534) 评论(0) 推荐(0) 编辑
摘要: 1 #import "MainViewController.h" 2 3 @interface MainViewController () 4 5 @property (nonatomic, retain)UIImageView *imageView; 6 7 @property (nonatomic, retain)NSMutableD... 阅读全文
posted @ 2016-06-06 15:36 超级马力 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 1 #import "AppDelegate.h" 2 3 @implementation AppDelegate 4 5 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 6 { 7 ... 阅读全文
posted @ 2016-06-06 15:35 超级马力 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 1 #import "MainViewController.h" 2 3 #import "MyCell.h" 4 5 @interface MainViewController (); 6 7 8 9 @end 10 11 12 @implementation MainViewController 13 14 15 - (id)... 阅读全文
posted @ 2016-06-06 15:29 超级马力 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 4 5 //1.协议传值 6 7 // 协议由后面的视图控制器制定 8 9 @protocol secondDelegate 10 11 12 13 //协议的方法需要带一个或多个参数 14 15 - (void)passValueWithString:(NSString *)string; 16... 阅读全文
posted @ 2016-06-06 15:28 超级马力 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 委托下是一个UINavigationController导航控制器。三个视图的先后切换,分别为UITableViewController、UITableViewController、UIViewController。 导航控制器的 pushViewController:animated: Pushe 阅读全文
posted @ 2016-06-06 15:27 超级马力 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1 #import "mainViewController.h" 2 3 4 @interface mainViewController () 5 6 7 @end 8 9 10 @implementation mainViewController 11 12 13 - (id)initWithNibName:(NSString *)n... 阅读全文
posted @ 2016-06-06 15:26 超级马力 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 如果当前有两个视图控制器 MainViewController 和 SecondViewController 实现让SecondViewController 传值给 MainViewController : 1. 首先在 SecondViewController.h // 1. 协议传值 // 协议 阅读全文
posted @ 2016-06-06 15:26 超级马力 阅读(241) 评论(0) 推荐(0) 编辑