iOS三方库、好资料收集

work 错误总结

2015-07-22  本文已影响1668人  Hollylord

Undefined symbols for architecture i386:

"_SCError", referenced from:

-[Reachability startNotifier] in Reachability.o

"_SCErrorString", referenced from:

-[Reachability startNotifier] in Reachability.o

"_SCNetworkReachabilityCreateWithAddress", referenced from:

+[Reachability reachabilityWithAddress:] in Reachability.o

"_SCNetworkReachabilityCreateWithName", referenced from:

+[Reachability reachabilityWithHostname:] in Reachability.o

"_SCNetworkReachabilityGetFlags", referenced from:

解决办法:得加入SystemConfiguration.framework


Warning: Error creating LLDB target at path '/***/***/***/***.app'- using an empty LLDB target which can cause slow memory reads from remote devices."

解决办法:在both Project and Target中修改 Change 'Architectures' to 'Standard architectures (armv7, arm64) - $(ARCHS_STANDARD)'

Valid Architectures => arm64 armv7 


如果不希望tabbarController在超过5个viewcontrollers的情况下出现morecontroller,可以采用:self.moreNavigationController.navigationBarHidden = YES; 


NSURL 写网址要加http://  


关于scrollView的autolayout:

1.scrollView的四个约束

2.scrollView子view的6个约束。(多了一个距离scrollview的底部和右边的约束,就是通过这个计算content size)

例如我设scrollview的height为100,子view距离父view上200,下20;那么这样就可以自动生成scrollview的content size。


在storyboard中用tableviewcontroller,连线都正确,cellforRowAtindexPath方法不执行。

原因是,系统的numberOfSectionsInTableView方法中,return 0;因为section至少为1,所以如果是0,则后面的方法都不执行。因此prototypecell 会出不来。


tableview如何关联xib的cell:

首先创建一个xib,里面只能有一个tableviewcell。

UINib*nib= [UINibnibWithNibName:@"detailCell"bundle:nil]; 获得xib文件

[sponsorsregisterNib:nibforCellReuseIdentifier:@"details"]; tableview关联这个cell。

如果报这个错:invalid nib registered for identifier ((null)) - nib must contain exactly one top level object which must be a UITableViewCell instance

那么就要在cell的xib文件中设置file's owner 为控制器即可。


要想用代码写一个控件的autolayout 就必须加translatesAutoresizingMaskIntoConstraints=NO;

否则会报这个错误:

Unable to simultaneously satisfy constraints.

但是:注意self.view 这个父view的translatesAutoresizingMaskIntoConstraints是绝对不能设为NO的;


手写autolayout,必须先把试图加到view上,形成父子关系([A addsubview:B];),然后在写约束才行。


xib中加载另一个xib:

同时,在这个view的.m文件中的initWithCoder方法里面一定要加载对应的childView的xib文件。

详细请看:iOS Interface Builder:在.xib文件中加载另一个.xib文件 - backslash112 - 博客园


storyboard 关联xib:

首先storyboard中的view会通过class去找对应的.m文件;然后再文件中

- (id)awakeAfterUsingCoder:(NSCoder*)aDecoder{

BOOLtheThingThatGotLoadedWasJustAPlaceholder = ([[selfsubviews]count] ==0);

if(theThingThatGotLoadedWasJustAPlaceholder) {

UIView* theRealThing = [[[NSBundlemainBundle]loadNibNamed:@"sponsorsList"owner:niloptions:nil]firstObject];

// pass properties through

//[self copyUIPropertiesTo:theRealThing];

//auto layout

//self.translatesAutoresizingMaskIntoConstraints = NO;

theRealThing.translatesAutoresizingMaskIntoConstraints=NO;

returntheRealThing;

}

returnself;

}

这样就会去加载对应的xib文件了。


用图形化界面定义cell之后,如何获得Cell里面的控件:

首先给cell中的控件绑定tag;然后用[cell viewWithtag:] 方法获得它。

(如果直接拉线是不能成功的。会报outlets cannot be connected to repeating content 错!)


Undefined symbols for architecture i386:

"GetLicense(char const*, char const*, char const*)", referenced from:

-[BDVROfflineEngine licenseFromServer] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"VerifyLicense(char const*, char const*, unsigned int&)", referenced from:

-[BDVROfflineEngine verfiyLicense] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrBuildSlot", referenced from:

-[BDVROfflineEngine initOfflineEngine] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

-[BDVROfflineEngine flushSlot:] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrExit", referenced from:

-[BDVROfflineEngine unInitOfflineEngine] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrFeedAudioData", referenced from:

-[BDVROfflineEngine feedAudio:] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrGetJSONResult", referenced from:

-[BDVROfflineEngine feedAudio:] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrInitial", referenced from:

-[BDVROfflineEngine initOfflineEngine] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrSetParam", referenced from:

-[BDVROfflineEngine setParameter] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrSetSlot", referenced from:

-[BDVROfflineEngine initSlot] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrStartRecognition", referenced from:

-[BDVROfflineEngine setRecoginitionProperty] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

"_bdeasrStopRecognition", referenced from:

-[BDVROfflineEngine feedAudio:] in libBDVoiceRecognitionClient.a(BDVROfflineEngine.o)

错误原因:没有添加libBDVoiceRecognitionClient.a。 我当时添加的是离在线版本的libBDVoiceRecognitionClient.a,实际上添加错了,应该添加在线版本的libBDVoiceRecognitionClient.a.


如何修改工程名:

1.

2.product -> scheme -> new scheme 选择最新的。


报错:NSMutableArray addObject: -[__NSArrayI addObject:]: unrecognized selector sent to instance

原因是NSMutableArray的属性是copy。改为strong 就好了!


github 添加成员:选择项目-> setting->collaborator 搜索你同伴的名字点击添加 即可。


报错:_OBJC_CLASS_$_ASIdentifierManager 

就是因为没有添加某个framework或者静态库。。。(多检查一遍)

上一篇下一篇

猜你喜欢

热点阅读