在我用Cocoapods 安装DTCoreText(https://github.com/Cocoanetics/DTCoreText)后,当我尝试运行模拟器或设备时总是出错!
ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Release-iphoneos'
ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Debug-iphoneos'
ld: library not found for -lPods-example
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
在我的"Link Binary With Libraries"中,"libPods"部分为红色:

这是我的构建设置:
我的项目设置:

我的Pod的设置:

编辑:
我不确定问题是什么,但是当我删除所有DTCoreText和Cocoapods的东西并重新安装所有东西时我解决了它!
我想开始,暂停和停止(与重启相同)我的mp3文件,我正在使用AVPlayer.我从服务器获取文件.
要启动歌曲我做:
[self.player start];
Run Code Online (Sandbox Code Playgroud)
暂停我做:
[self.player pause];
Run Code Online (Sandbox Code Playgroud)
但是当我想要停止歌曲并重新加载时,以便当用户下次点击"开始按钮"时歌曲从头开始,我不知道该怎么办...
我试过这样的事情:
[self.player pause];
self.player = nil;
Run Code Online (Sandbox Code Playgroud)
但是然后播放器当然是零,我无法重新启动文件,无法进行新的初始化....任何想法如何停止它?
我尝试在youtube vimeo中嵌入不同的视频,dailymotion.
可悲的是,除了我的containerView的backgroundcolor之外,没有显示任何内容:
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0, 320.0f, 200.0f)];
//item.url is my url which i get fro my webserver, it looks like http://www.youtube.com/watch?v=zPP6lXaL7KA&feature=youtube_gdata_player
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:item.url]];
AVPlayer *avPlayer = [AVPlayer playerWithPlayerItem:playerItem];
NSLog(@"%@",playerItem);
AVPlayerLayer *avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:avPlayer];
avPlayerLayer.frame = self.frame;
[containerView.layer addSublayer:avPlayerLayer];
[self addSubview:containerView];
[avPlayer play];
if (avPlayer.status == AVPlayerStatusReadyToPlay) {
//[playingLbl setText:@"Playing Audio"];
NSLog(@"It works");
} else if (avPlayer.status == AVPlayerStatusFailed) {
// something went wrong. player.error should contain some information
NSLog(@"Not works"); …Run Code Online (Sandbox Code Playgroud) 我试图实现DTCoreText.我按照本指南并将其实现为git submodul,但现在我在尝试运行我的应用程序时遇到错误.在片刻,我没有使用DTCoreText进行任何编码.我只是想测试我的应用程序是否适用于新导入的数据......但它没有!
我收到一个警告:
Static Library was rejected as an implicit dependency for 'libDTCoreText.a' because its architectures 'armv7s' didn't contain all required architectures 'armv7'
Run Code Online (Sandbox Code Playgroud)
在我看来,警告后出现以下错误的原因:
Apple Mach-O Linker Error: no such file or directory: '/Users/-------------/Build/Products/Debug-iphoneos/libDTCoreText.a'
Run Code Online (Sandbox Code Playgroud)
我没有忘记在" Link Binary With Libraries "中实现libDTCoreText.a ,但它总是红色的?这可能是问题吗?
我在iOS 7上测试了我的App,并认识到我的"Pull to Refresh"(ODRefreshControl https://github.com/Sephiroth87/ODRefreshControl)不再适用了.
我必须将scrollview拉得极远,才能看到微调器的一小部分和箭头图标.可能是什么问题呢.在iOS 5和iOS 6上,它完美无缺!!
我有一个UICollectionView带Custom CollectionView Cells.在每个Cell上都有一个Image,它与整个Cell一样大.现在我想在用户触摸Cell时突出显示Cell.首先,我尝试了以下内容delegate Methods:
- (void)collectionView:(UICollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell* cell = [self.collectionView cellForItemAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor];
}
- (void)collectionView:(UICollectionView *)collectionView didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor clearColor];
}
Run Code Online (Sandbox Code Playgroud)
但没有任何事情发生.我删除了细胞中的图像,它完美地工作.但随着图像没有任何反应!我还可以做些什么?
大家好我有一个TableHeaderView,一切都由Autolayout管理:
的UIImageView在顶部应始终为2:1,所以我设置纵横比和所需约束的其余部分.
4 UIButtons应该始终是水平的,并且应该具有相同的高度和宽度.所以我使用Equal Width和Equal Height,并且纵横比为1:1
和我有两个UILabels与numberOfLines设置为0.我也把我的子类UILabel,因为preferredMaxLayoutWidth,这样的:
- (void) layoutSubviews
{
[super layoutSubviews];
if ( self.numberOfLines == 0 )
{
if ( self.preferredMaxLayoutWidth != self.frame.size.width )
{
self.preferredMaxLayoutWidth = self.frame.size.width;
[self setNeedsUpdateConstraints];
}
}
}
Run Code Online (Sandbox Code Playgroud)这是我的代码:
- (void)initializeHeaderViewLabels
{
//After the Response from my server arrived i set the tableHeaderView with the Textdata
self.tableView.tableHeaderView = nil;
if((self.contentDict[@"title"]) != [NSNull null])
{
self.headerTitleLabel.text = (self.contentDict[@"title"]);
}
if((self.contentDict[@"shortDescription"]) != [NSNull null]) …Run Code Online (Sandbox Code Playgroud) 我以编程方式构建了一个带有ios7的视图,并且每个方面都可以正常工作.但后来我用ios 6进行了测试,一半的View被破坏了,我不知道为什么.我不使用任何"ios7 only"的东西!
ios7截图(一切都很好):

ios6的屏幕截图(这里发生了奇怪的事情):

它是相同的代码,UITextViews,UILabels和一个UISegmentedControl.有任何想法吗??
嘿,我尝试更改部分页脚的宽度:
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
UIView *viewFooter = [[UIView alloc]initWithFrame:CGRectMake(10, 0, 300, 44)];
[viewFooter setBackgroundColor:[UIColor blueColor]];
return viewFooter;
}
Run Code Online (Sandbox Code Playgroud)
但页脚始终与桌面视图一样宽(320.0f)......
ios ×9
objective-c ×8
avplayer ×2
dtcoretext ×2
ios7 ×2
uitableview ×2
avplayeritem ×1
cocoapods ×1
core-text ×1
ios6 ×1
youtube ×1