- Could not load NIB in bundle: 'NSBundle
杏子_2fd0
当用cocoapod创建一个组件时,在加载xib或者nib的时候总是报“CouldnotloadNIBinbundle:'NSBundle、、、”错误解决方法:1、在AmafirePackage.podspec文件中配置s.resource='Pod/Assets'2,对于xib加载时注册的时候要进行指向,如:letbundle=Bundle(identifier:"org.cocoapods.A
- iOS开发获取版本号
Stephen_Huang
//此获取的版本号对应bundle,打印出来对应为12345这样的数字NSNumber*number=[[[NSBundlemainBundle]infoDictionary]objectForKey:(NSString*)kCFBundleVersionKey];//此获取的版本号对应version,打印出来对应为1.2.3.4.5这样的字符串NSString*string=[[[NSBundl
- NSBundle和SandBox
薛定谔的汪汪
NSBundle:资源包,程序上传以及从Appstore上下载的就是这个包,在目录中表现为xxx.app。它包含了应用程序正常运行的所有资源文件和可执行文件等,对用户来说只能读不能写(为了程序安全)。SandBox:所有的非代码文件,诸如图片、图标、声音,属性列表,文本文件等,程序运行过程中产生的各种数据皆存于此。iOS8之前两者位于同一目录下;iOS8之后,xxx.app单独存放到一个独立的文件
- 白鹭引擎0.1.8微端导出的IOS app包,白色闪屏问题
crazyVicky
游戏刚开始运行起来,引擎启动会有白色的闪屏,找了半天官方文档,没找到解决方案,之后看了下代码,解决了在AppDelegate文件内,didFinishLaunchingWithOptions函数内添加如下方法://引擎加载的时候,会有闪屏,把白色的闪屏,换成想要的闪屏图片NSString*path=[[NSBundlemainBundle]pathForResource:@"logo.png"of
- 2019-03-21 获取plist文件里的内容
超喜欢灌木的味道
/**获取plist文件里的内容(可以扩充)*/+(NSString*)plistContentWithName:(NSString*)name{NSDictionary*infoDictionary=[[NSBundlemainBundle]infoDictionary];//name:CFBundleDisplayName(app名称)CFBundleShortVersionString(AP
- iOS解压ZIP压缩包
鄂北
下载地址:SSZipArchive步骤:一:导入SSZipArchive使用cocoapods导入pod'SSZipArchive'二:导入头文件#import"SSZipArchive.h"三:获取zip压缩包文件路径获取文件的方式方法一:NSString*filePath=[[NSBundlemainBundle]pathForResource:@"ZipName"ofType:@"zip"]
- AVAudioEngine 使用记录
woo_5857
-(void)createAudioEngine{[selfaddAudioFileToAudioFile];[selfconnectNode];[selfstartRecording];[selfaddFileToPlayNode];}//播放文件加载到audioFile-(void)addAudioFileToAudioFile{NSURL*urlq=[[NSBundlemainBundle]
- 【iOS】加载图片的两种方式
an_Anthony
UIImage加载图片有两种方式:imageNamed和imageWithContentsOfFileUIImage*image=[UIImageimageNamed:@“xxx”];NSString*filePath=[[NSBundlemainBundle]pathForResource:@“xxx”ofType:@“xxx”];UIImage*image=[UIImageimageWithC
- 静态库和framework的封装
liboxiang
http://www.cocoachina.com/bbs/read.php?tid-282490-page-1.html注意点:bundle里面不要带plist文件.buildsetting->packaging->info.plistfile设置为空。否则提审的时候可能会报Executablefile相关的错误bundle中资源的获取方法+(NSBundle*)getResourcesBund
- iOS App版本迭代时对数据库的影响
Fly丶心晨
一、以下是获取Appinfo.plist文件内容[[NSBundlemainBundle]infoDictionary]获得的是一个字典,里边放着Info.plist文件中的各种信息,根据不同的键去即可1:获取bundleId信息:[[NSBundlemainBundle]bundleIdentifier];2:获取版本号:[[[NSBundlemainBundle]infoDictionary]
- 2019-03-04 iOS 8/9 系统 使用WKWebview ,针对本地加载HTML代码问题(loadHTMLString:baseURL:)
Cocoa_Coder
编辑于2019-03-04iOS8/9系统使用WKWebview,针对本地加载HTML代码问题(loadHTMLString:baseURL:)问题:加载本地图片iOS10以后通过下面的代码可以解决加载本地图片NSString*path=[[NSBundlemainBundle]resourcePath];NSURL*baseURL=[NSURLfileURLWithPath:path];[sel
- ios 获取工程内文件的路径
天天星期天
刚好在做本地字体的功能。顺便记录下获取工程文件的方式。1.添加文件到你的工程中直接拉文件,到你的工程中。记住如下勾选。否则获取的路径永远是null。image.png2.代码获取路径//添加在工程文件最外层使用方式NSString*path=[[NSBundlemainBundle]pathForResource:@"文件名"ofType:@"后缀"];//下图1位置获取方式NSString*pa
- NSBundle介绍
拳战攻城师
bundle是一个目录,其中包含了程序会使用到的资源.这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in).对应bundle,cocoa提供了类NSBundle.我们的程序是一个bundle.在Finder中,一个应用程序看上去和其他文件没有什么区别.但是实际上它是一个包含了nib文件,编译代码,以及其他资源的目录.我们把这个目录叫做程序的mainbun
- iOS开发技巧之:获取iOS项目名称及版本号
VKOOY
iOSVersion版本获取
NSString*executableFile=[[[NSBundlemainBundle]infoDictionary]objectForKey:(NSString*)kCFBundleExecutableKey];//获取项目名称NSString*version=[[[NSBundlemainBundle]infoDictionary]objectForKey:(NSString*)kCFBu
- iOS加载本地html
石卒2018
要做的很简单,先把要加载的东西添加进工程,然后实现本地加载即可NSString*htmlPath=[[NSBundlemainBundle]pathForResource:@"index"ofType:@"html"];NSString*htmlCont=[NSStringstringWithContentsOfFile:htmlPathencoding:NSUTF8StringEncodinge
- 一个xib 描述两个View
米亚流年
xibWX20180522-112804.png对应的UIView提供2个类方法给外界调用+(instancetype)loginView;+(instancetype)registerView;pragmamark--登录xib+(instancetype)loginView{return[[[NSBundlemainBundle]loadNibNamed:NSStringFromClass([
- UIWebView更换WKWebView
Hyman_luo
一、加载方式1.-(void)loadRequest:(NSURLRequest*)request;可以请求本地文件也可以请求网络资源NSURL*fileURL=[[NSBundlemainBundle]URLForResource:@"test.html"withExtension:nil];//fileURL=[NSURLURLWithString:@"https://www.baidu.co
- 删除Main.storyboard报错Could not find a storyboard named 'Main' in bundle NSBundle
舒小妮儿
近期开始Review,所以从Base部分开始做些笔记,希望自己能坚持下去,由浅入深,一步一个脚印积累。首先就创建一个新项目开始吧。我们都知道,Xcode新建一个Project时,都会默认生成一个Main.storyboard,点击Main.storyboard,可以看到如下图所示:Main.storyboard此时,如果删除1的箭头或取消2的勾选,运行则会报错提示:删除1或取消2后运行报错问题的根
- 总结一套swift版本的APP内切换国际化语言
从小就是菜鸟
自己写一个工具类DAConfig;一个Bundle的子类NSBundleEx;一个Bundle的扩展协议;classDAConfig:NSObject{staticletUWUserLanguageKey="UWUserLanguageKey"classfuncsetUserLanguage(userLanguage:String){ifuserLanguage.count==0{DAConfig
- SVGAPlayer-ReactNative
svgadesiner
SVGAPlayerVersion1.2.3首个SVGAPlayer-ReactNative官方支持版本使用importSVGAPlayerfrom'svgaplayer';...render(){return()}参数source:String-SVGA动画文件的路径,可以是URL,或是本地NSBundle.mainBundle/assets文件loops:Int-默认值为0,用于指定动画循环次
- iOS 开发之播放本地视频没效果
KODIE
这个问题出在于加载资源的方式上了,下面放四段代码:-(void)playVideo0{NSString*videoPath=[[NSBundlemainBundle]pathForResource:@"Video"ofType:@"mp4"];NSURL*videoURL=[NSURLURLWithString:videoPath];AVPlayerItem*playerItem=[[AVPlay
- iOS- 读取XML中文乱码
malgee
将NSASCIIStringEncoding改成NSUTF8StringEncodingNSString*xmlFilePath=[[NSBundlemainBundle]pathForResource:@"album_desc_and_url"ofType:@"xml"];NSString*xmlContent=[NSStringstringWithContentsOfFile:xmlFileP
- Xcode中的Info.plist字段列表详解
Mr姜饼
常用字段:1.获取版本信息:NSDictionary*infoDic=[[NSBundlemainBundle]infoDictionary];NSString*localVersion=[infoDicobjectForKey:@"CFBundleShortVersionString"];2.应用支持http网络请求:在Info.plist中添加NSAppTransportSecurity类型D
- iOS 添加使用特殊字体
LAOning11
ios特殊字体
1plist文件中添加Fontsprovidedbyapplication名字要对应2获取特殊字体使用时的实际名字NSString*path=[[NSBundlemainBundle]pathForResource:@“IMPACT”ofType:@“TTF”];NSURL*fontUrl=[NSURLfileURLWithPath:path];CGDataProviderReffontDataP
- 异常关键字@thorw 异常类NSException
张无奈
有时候我们项目需求,需要人为的抛出异常,使程序崩溃退出,这时候就用到@throw了。NSString*bundleId=[[NSBundlemainBundle]bundleIdentifier];NSString*format=@"ConfigureAPIKeyinsideSDKDemoAPIKey.hforyour"@"bundle`%@`,seeREADME.GoogleMapsDemosf
- 2018-03-14如何在代码中利用app图标
songjk
第一步获取bundle中的路径信息:NSDictionary*infoDict=[[NSBundlemainBundle]infoDictionary];第二部:获取app中所有icon名字数组NSArray*iconsArr=infoDict[@"CFBundleIcons"][@"CFBundlePrimaryIcon"][@"CFBundleIconFiles"];第三部取出icon的名字,
- Storyboard 代码加载
CaptainRoy
如下例子我先拖入一个Storyboard,里面放置一个UINavigationController和一个HomeViewControllerAppDelegate.mUIStoryboard*homeSB=[UIStoryboardstoryboardWithName:@"Home"bundle:[NSBundlemainBundle]];HomeViewController*homeVC=[ho
- push跳转到XIB关联的VC
钟华威
CreatePlanetSecondStepViewController*next=[[CreatePlanetSecondStepViewControlleralloc]initWithNibName:@"CreatePlanetSecondStepViewController"bundle:[NSBundlemainBundle]];next.starHeadImageUrl=headImag
- iOS系统设置
梦门户
//这个方法后面会列出来NSString*deviceName=[selfgetDeviceName];NSLog(@"设备型号-->%@",deviceName);NSString*iPhoneName=[UIDevicecurrentDevice].name;NSLog(@"iPhone名称-->%@",iPhoneName);NSString*appVerion=[[[NSBundlemai
- -[UIImage _isCached]: message sent to deallocated instance 0xde8ce90
comeontom
objective-c基础iPadiPhone开发image测试
当你测试内存警告的时候,可能会遇到这种提示,这说明,你的代码里加载图片的用的是:UIImage*image=[UIImageimageNamed:@"btn1.png"];你应该是这样用:NSString*imagePath=[[NSBundlemainBundle]pathForResource:@"shujia"ofType:@"png"];UIImage*back=[UIImageimage
- ztree设置禁用节点
3213213333332132
JavaScriptztreejsonsetDisabledNodeAjax
ztree设置禁用节点的时候注意,当使用ajax后台请求数据,必须要设置为同步获取数据,否者会获取不到节点对象,导致设置禁用没有效果。
$(function(){
showTree();
setDisabledNode();
});
- JVM patch by Taobao
bookjovi
javaHotSpot
在网上无意中看到淘宝提交的hotspot patch,共四个,有意思,记录一下。
7050685:jsdbproc64.sh has a typo in the package name
7058036:FieldsAllocationStyle=2 does not work in 32-bit VM
7060619:C1 should respect inline and
- 将session存储到数据库中
dcj3sjt126com
sqlPHPsession
CREATE TABLE sessions (
id CHAR(32) NOT NULL,
data TEXT,
last_accessed TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
<?php
/**
* Created by PhpStorm.
* User: michaeldu
* Date
- Vector
171815164
vector
public Vector<CartProduct> delCart(Vector<CartProduct> cart, String id) {
for (int i = 0; i < cart.size(); i++) {
if (cart.get(i).getId().equals(id)) {
cart.remove(i);
- 各连接池配置参数比较
g21121
连接池
排版真心费劲,大家凑合看下吧,见谅~
Druid
DBCP
C3P0
Proxool
数据库用户名称 Username Username User
数据库密码 Password Password Password
驱动名
- [简单]mybatis insert语句添加动态字段
53873039oycg
mybatis
mysql数据库,id自增,配置如下:
<insert id="saveTestTb" useGeneratedKeys="true" keyProperty="id"
parameterType=&
- struts2拦截器配置
云端月影
struts2拦截器
struts2拦截器interceptor的三种配置方法
方法1. 普通配置法
<struts>
<package name="struts2" extends="struts-default">
&
- IE中页面不居中,火狐谷歌等正常
aijuans
IE中页面不居中
问题是首页在火狐、谷歌、所有IE中正常显示,列表页的页面在火狐谷歌中正常,在IE6、7、8中都不中,觉得可能那个地方设置的让IE系列都不认识,仔细查看后发现,列表页中没写HTML模板部分没有添加DTD定义,就是<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3
- String,int,Integer,char 几个类型常见转换
antonyup_2006
htmlsql.net
如何将字串 String 转换成整数 int?
int i = Integer.valueOf(my_str).intValue();
int i=Integer.parseInt(str);
如何将字串 String 转换成Integer ?
Integer integer=Integer.valueOf(str);
如何将整数 int 转换成字串 String ?
1.
- PL/SQL的游标类型
百合不是茶
显示游标(静态游标)隐式游标游标的更新和删除%rowtyperef游标(动态游标)
游标是oracle中的一个结果集,用于存放查询的结果;
PL/SQL中游标的声明;
1,声明游标
2,打开游标(默认是关闭的);
3,提取数据
4,关闭游标
注意的要点:游标必须声明在declare中,使用open打开游标,fetch取游标中的数据,close关闭游标
隐式游标:主要是对DML数据的操作隐
- JUnit4中@AfterClass @BeforeClass @after @before的区别对比
bijian1013
JUnit4单元测试
一.基础知识
JUnit4使用Java5中的注解(annotation),以下是JUnit4常用的几个annotation: @Before:初始化方法 对于每一个测试方法都要执行一次(注意与BeforeClass区别,后者是对于所有方法执行一次)@After:释放资源 对于每一个测试方法都要执行一次(注意与AfterClass区别,后者是对于所有方法执行一次
- 精通Oracle10编程SQL(12)开发包
bijian1013
oracle数据库plsql
/*
*开发包
*包用于逻辑组合相关的PL/SQL类型(例如TABLE类型和RECORD类型)、PL/SQL项(例如游标和游标变量)和PL/SQL子程序(例如过程和函数)
*/
--包用于逻辑组合相关的PL/SQL类型、项和子程序,它由包规范和包体两部分组成
--建立包规范:包规范实际是包与应用程序之间的接口,它用于定义包的公用组件,包括常量、变量、游标、过程和函数等
--在包规
- 【EhCache二】ehcache.xml配置详解
bit1129
ehcache.xml
在ehcache官网上找了多次,终于找到ehcache.xml配置元素和属性的含义说明文档了,这个文档包含在ehcache.xml的注释中!
ehcache.xml : http://ehcache.org/ehcache.xml
ehcache.xsd : http://ehcache.org/ehcache.xsd
ehcache配置文件的根元素是ehcahe
ehcac
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL
白糖_
javaeclipsespringtomcatWeb
今天学习spring+cxf的时候遇到一个问题:在web.xml中配置了spring的上下文监听器:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
随后启动
- angular.element
boyitech
AngularJSAngularJS APIangular.element
angular.element
描述: 包裹着一部分DOM element或者是HTML字符串,把它作为一个jQuery元素来处理。(类似于jQuery的选择器啦) 如果jQuery被引入了,则angular.element就可以看作是jQuery选择器,选择的对象可以使用jQuery的函数;如果jQuery不可用,angular.e
- java-给定两个已排序序列,找出共同的元素。
bylijinnan
java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CommonItemInTwoSortedArray {
/**
* 题目:给定两个已排序序列,找出共同的元素。
* 1.定义两个指针分别指向序列的开始。
* 如果指向的两个元素
- sftp 异常,有遇到的吗?求解
Chen.H
javajcraftauthjschjschexception
com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:460)
at com.jcraft.jsch.Session.connect(Session.java:154)
at cn.vivame.util.ftp.SftpServerAccess.connec
- [生物智能与人工智能]神经元中的电化学结构代表什么?
comsci
人工智能
我这里做一个大胆的猜想,生物神经网络中的神经元中包含着一些化学和类似电路的结构,这些结构通常用来扮演类似我们在拓扑分析系统中的节点嵌入方程一样,使得我们的神经网络产生智能判断的能力,而这些嵌入到节点中的方程同时也扮演着"经验"的角色....
我们可以尝试一下...在某些神经
- 通过LAC和CID获取经纬度信息
dai_lm
laccid
方法1:
用浏览器打开http://www.minigps.net/cellsearch.html,然后输入lac和cid信息(mcc和mnc可以填0),如果数据正确就可以获得相应的经纬度
方法2:
发送HTTP请求到http://www.open-electronics.org/celltrack/cell.php?hex=0&lac=<lac>&cid=&
- JAVA的困难分析
datamachine
java
前段时间转了一篇SQL的文章(http://datamachine.iteye.com/blog/1971896),文章不复杂,但思想深刻,就顺便思考了一下java的不足,当砖头丢出来,希望引点和田玉。
-----------------------------------------------------------------------------------------
- 小学5年级英语单词背诵第二课
dcj3sjt126com
englishword
money 钱
paper 纸
speak 讲,说
tell 告诉
remember 记得,想起
knock 敲,击,打
question 问题
number 数字,号码
learn 学会,学习
street 街道
carry 搬运,携带
send 发送,邮寄,发射
must 必须
light 灯,光线,轻的
front
- linux下面没有tree命令
dcj3sjt126com
linux
centos p安装
yum -y install tree
mac os安装
brew install tree
首先来看tree的用法
tree 中文解释:tree
功能说明:以树状图列出目录的内容。
语 法:tree [-aACdDfFgilnNpqstux][-I <范本样式>][-P <范本样式
- Map迭代方式,Map迭代,Map循环
蕃薯耀
Map循环Map迭代Map迭代方式
Map迭代方式,Map迭代,Map循环
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
蕃薯耀 2015年
- Spring Cache注解+Redis
hanqunfeng
spring
Spring3.1 Cache注解
依赖jar包:
<!-- redis -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
- Guava中针对集合的 filter和过滤功能
jackyrong
filter
在guava库中,自带了过滤器(filter)的功能,可以用来对collection 进行过滤,先看例子:
@Test
public void whenFilterWithIterables_thenFiltered() {
List<String> names = Lists.newArrayList("John"
- 学习编程那点事
lampcy
编程androidPHPhtml5
一年前的夏天,我还在纠结要不要改行,要不要去学php?能学到真本事吗?改行能成功吗?太多的问题,我终于不顾一切,下定决心,辞去了工作,来到传说中的帝都。老师给的乘车方式还算有效,很顺利的就到了学校,赶巧了,正好学校搬到了新校区。先安顿了下来,过了个轻松的周末,第一次到帝都,逛逛吧!
接下来的周一,是我噩梦的开始,学习内容对我这个零基础的人来说,除了勉强完成老师布置的作业外,我已经没有时间和精力去
- 架构师之流处理---------bytebuffer的mark,limit和flip
nannan408
ByteBuffer
1.前言。
如题,limit其实就是可以读取的字节长度的意思,flip是清空的意思,mark是标记的意思 。
2.例子.
例子代码:
String str = "helloWorld";
ByteBuffer buff = ByteBuffer.wrap(str.getBytes());
Sy
- org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1
Everyday都不同
$转义el表达式
最近在做Highcharts的过程中,在写js时,出现了以下异常:
严重: Servlet.service() for servlet jsp threw exception
org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1,
- 用Java实现发送邮件到163
tntxia
java实现
/*
在java版经常看到有人问如何用javamail发送邮件?如何接收邮件?如何访问多个文件夹等。问题零散,而历史的回复早已经淹没在问题的海洋之中。
本人之前所做过一个java项目,其中包含有WebMail功能,当初为用java实现而对javamail摸索了一段时间,总算有点收获。看到论坛中的经常有此方面的问题,因此把我的一些经验帖出来,希望对大家有些帮助。
此篇仅介绍用
- 探索实体类存在的真正意义
java小叶檀
POJO
一. 实体类简述
实体类其实就是俗称的POJO,这种类一般不实现特殊框架下的接口,在程序中仅作为数据容器用来持久化存储数据用的
POJO(Plain Old Java Objects)简单的Java对象
它的一般格式就是
public class A{
private String id;
public Str