![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
StackOverFlow-IOS
Ittttttttta
FullStack
个人邮箱:1951691@qq.com
展开
-
归类说明stackoverflow-ios
在本类别中 会摘取一些stackoverflow关于ios的错误解决方法。百度:Stack Overflow是一个与程序相关的IT技术问答网站。用户可以在网站免费提交问题,浏览问题,索引相关内容,在创建主页的时候使用简单的HTML。在问题页面,我们不会弹出任何广告,销售信息,JavaScript 窗口等。其实就是一句话:全球最大的问题编程问题提问与解答网站。感觉知乎是仿照的stackove原创 2015-12-03 10:04:08 · 566 阅读 · 0 评论 -
UITableViewCell
UITableView滑动删除 StackOverFlow回答:// During startup (-viewDidLoad or in storyboard) do:self.tableView.allowsMultipleSelectionDuringEditing = NO;// Override to support conditional editing of the table原创 2015-12-03 15:40:45 · 311 阅读 · 0 评论 -
UITextField文字缩进
// placeholder position- (CGRect)textRectForBounds:(CGRect)bounds { return CGRectInset(bounds, 10, 10);}// text position- (CGRect)editingRectForBounds:(CGRect)bounds { return CGRectInset(b翻译 2015-12-04 11:12:08 · 534 阅读 · 0 评论 -
NSArray 和 NSDictionary 转 jsonString
NSDictionary//.h@interface NSDictionary (BVJSONString)-(NSString*) bv_jsonStringWithPrettyPrint:(BOOL) prettyPrint;@end//.m@implementation NSDictionary (BVJSONString) -(NSString*) bv_jsonStringWit翻译 2015-12-04 11:20:50 · 814 阅读 · 0 评论 -
如何使用NSError
Example- (id) endWorldHunger:(id)largeAmountsOfMonies error:(NSError**)error { // begin feeding the world's children... // it's all going well until.... if (ohNoImOutOfMonies) { //原创 2015-12-04 11:28:41 · 813 阅读 · 0 评论 -
IOS 取消右滑返回
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = NO;}原创 2015-12-04 11:25:54 · 829 阅读 · 0 评论 -
IOS 图片上传旋转
解决方法 : //UIImage+fixOrientation.h@interface UIImage (fixOrientation)- (UIImage *)fixOrientation;@endUIImage+fixOrientation.m@implementation UIImage (fixOrientation)- (UIImage *)fixOrientation { //翻译 2015-12-04 14:07:09 · 385 阅读 · 0 评论 -
NavigationBar图解
SampleCode:self.navigationController.navigationBar.barTintColor = [UIColor blackColor];self.navigationController.navigationBar.tintColor = [UIColor whiteColor];[self.navigationController.navigationBa翻译 2015-12-04 15:29:49 · 308 阅读 · 0 评论 -
如何用纯C语言编写IOS应用---逼格满满
main.c#include <CoreFoundation/CoreFoundation.h>#include <objc/runtime.h>#include <objc/message.h>// This is a hack. Because we are writing in C, we cannot out and include // <UIKit/UIKit.h>, as that翻译 2015-12-04 11:03:58 · 6153 阅读 · 0 评论 -
Keychain更安全的存储数据
我们已存住用户登陆账号与密码为例初始化KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"YourAppLogin" accessGroup:nil];//存储[keychainItem setObject:@"password you are saving" forKey:k翻译 2015-12-04 14:03:44 · 337 阅读 · 0 评论 -
IOS 高斯模糊 (毛玻璃效果 UIVisualEffect)
Objective-CUIVisualEffect *blurEffect;blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];UIVisualEffectView *visualEffectView;visualEffectView = [[UIVisualEffectView alloc] initWithEf翻译 2015-12-04 14:14:45 · 950 阅读 · 0 评论 -
如何在ViewController中使用AppDelegate
MainClass *appDelegate = (MainClass *)[[UIApplication sharedApplication] delegate];[appDelegate.viewController someMethod];StackOverFlow 我是来骗阅读量的~翻译 2015-12-04 14:39:51 · 780 阅读 · 0 评论 -
限制UITextField 输入字数
Objective-C- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { // Prevent crashing undo bug – see note below. if(range翻译 2015-12-04 09:30:56 · 363 阅读 · 0 评论 -
滚动指定UITableViewCell到顶部
我想使TableView滚动到指定位置(有些tableView我想滚动到Row=5)所以我用下下面的方法(但会报错):[mainTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];解翻译 2015-12-04 14:26:09 · 379 阅读 · 0 评论 -
IOS Iphone震动 和 提示音
Code:AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);StackOverFlow翻译 2015-12-04 15:23:10 · 845 阅读 · 0 评论 -
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
错误提示:Undefined symbols for architecture i386:"_OBJC_CLASS_$_SKPSMTPMessage", referenced from: objc-class-ref in ConfirmController.o"_kSKPSMTPPartContentTransferEncodingKey", referenced from: -[Conf翻译 2015-12-04 14:19:20 · 456 阅读 · 0 评论 -
IOS 模拟器中键盘弹起
iOS Simulator -> Hardware -> Keyboard Uncheck “Connect Hardware Keyboard” StackOverFlow翻译 2015-12-03 15:32:57 · 526 阅读 · 0 评论 -
在UITextView添加一个PlaceHoder
UIPlaceHolderTextView.h#import <Foundation/Foundation.h>@interface UIPlaceHolderTextView : UITextView@property (nonatomic, retain) NSString *placeholder;@property (nonatomic, retain) UIColor *placehol翻译 2015-12-03 13:55:11 · 311 阅读 · 0 评论 -
UITextField 随着键盘滚动
StackOverFlow答案:#define kOFFSET_FOR_KEYBOARD 80.0-(void)keyboardWillShow { // Animate the current view out of the way if (self.view.frame.origin.y >= 0) { [self setViewMovedUp:YES];原创 2015-12-03 13:11:12 · 437 阅读 · 0 评论 -
如何检测一个String是否为空
有人会说 这么简单的原理不用写了吧 其实我看到这个标题的时候 还是写一下 说不定里边还有一个小技巧别人没有注意到if [string length] == 0//如果是@""返回为0 为true//如果是nil length = 0 还是为trueStackOverFlow原创 2015-12-03 13:45:28 · 300 阅读 · 0 评论 -
如何延迟执行一个block类似performSelector:withObject:afterDelay:?
GCD dispatch_after() 线程安全// Delay execution of my block for 10 seconds.dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ // block();});StackOverFl翻译 2015-12-03 13:49:15 · 510 阅读 · 0 评论 -
View的frame.x不是从Navigationbar下边开始
请在viewDidLoad中添加如下代码if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) self.edgesForExtendedLayout = UIRectEdgeNone;StackOverFlow翻译 2015-12-03 15:59:51 · 363 阅读 · 0 评论 -
如何判断一个NSString 是否包含了字符串
NSString *string = @"hello bla bla";if ([string rangeOfString:@"bla"].location == NSNotFound) { NSLog(@"string does not contain bla");} else { NSLog(@"string contains bla!");}StackOverFlow翻译 2015-12-03 13:26:48 · 625 阅读 · 0 评论 -
UITableViewCell分割线顶边
Method (1)-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ // Remove seperator inset if ([cell respondsToSelector:翻译 2015-12-03 15:31:20 · 339 阅读 · 0 评论 -
Xcode7 网络访问限制
右击plist 通过sourcecode打开 在一级目录添加如下代码<key>NSAppTransportSecurity</key><dict> <!--Include to allow all connections (DANGER)--> <key>NSAllowsArbitraryLoads</key> <true/></dict>翻译 2015-12-03 15:56:56 · 375 阅读 · 0 评论 -
修改UITextField的placeHoder字体颜色
-if ([textField respondsToSelector:@selector(setAttributedPlaceholder:)]) { UIColor *color = [UIColor blackColor]; textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:plac翻译 2015-12-04 08:58:19 · 488 阅读 · 0 评论 -
UILabel的换行问题
UILabel 字体适应 [myLabel sizeToFit]; UILabel 多行设置 myLabel.numberOfLines = 0; [myLabel sizeToFit];Stackoverflow翻译 2015-12-03 10:15:52 · 830 阅读 · 0 评论 -
IOS编译警告之:performSelector may cause a leak because its selector is unknown
解决方案:#pragma clang diagnostic push#pragma clang diagnostic ignored "-Warc-performSelector-leaks" [self.ticketTarget performSelector: self.ticketAction withObject: self];#pragma clang diagnostic p翻译 2015-12-03 11:16:08 · 748 阅读 · 0 评论 -
将UTF8的NSData转换成NSSting
如果数据不包含null-terminated(‘\0’)NSString* newStr = [[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding];否则NSString* newStr = [NSString stringWithUTF8String:[theData bytes]];StackOverFlow翻译 2015-12-03 14:13:29 · 723 阅读 · 0 评论 -
UITextView根据内容适应大小
OC- (void)textViewDidChange:(UITextView *)textView{ CGFloat fixedWidth = textView.frame.size.width; CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)]; CGRect newFra翻译 2015-12-04 09:11:50 · 2229 阅读 · 0 评论 -
IOS 之CrashLog 错误日志
Steps to analyze crash report from apple:Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into转载 2015-12-04 09:01:12 · 349 阅读 · 0 评论 -
IOS开发中如何检测网络连接
1)将**SystemConfiguration**framework添加到项目中。 2)添加Reachability.h和**Reachability.m**githubhttps://github.com/tonymillion/Reachability 3)实现方法#import "Reachability.h"// Add this to the interface in the .翻译 2015-12-03 10:28:53 · 340 阅读 · 0 评论 -
修改StatusBar颜色
修改plist文件 UIViewControllerBasedStatusBarAppearance = YES在viewDidLoad中添加[self setNeedsStatusBarAppearanceUpdate];添加如下方法- (UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLigh翻译 2015-12-03 13:35:47 · 776 阅读 · 0 评论 -
如何在Swift中使用预编译宏定义
OC中这样使用即可#ifdef DEBUG// debug only code#endif解决方案 Swift:#if DEBUG let a = 2#else let a = 3#endifmb的感觉soeasy~ StackOverFlow翻译 2015-12-04 14:33:55 · 3613 阅读 · 0 评论