小编Jak*_*kub的帖子

NSLayoutConstraint 获取真实值

如何获得真正的价值Greater Than on Equal NSLayoutConstraint

当您获取constant参数时,运行时的约束明显大于该值,它仍然返回尽可能低的值

objective-c ios autolayout nslayoutconstraint

5
推荐指数
1
解决办法
1605
查看次数

Xcode插件模板cocoapods

我想创建Xcode插件,我从Alcatraz中选择Xcode插件模板,然后我关闭项目添加Podfile打开工作区并尝试构建我每次都得到ann错误:

ld: library not found for -lDTXcodeUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

这是一个完整的输出:

Ld /Users/jakubmazur/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin normal x86_64 cd /Users/jakubmazur/Developer/CreateFilesPlugin export MACOSX_DEPLOYMENT_TARGET=10.10 /Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug -F/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug -filelist /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin.LinkFileList -mmacosx-version-min=10.10 -ObjC -lDTXcodeUtils -lXcodeEditor -fobjc-arc -fobjc-link-runtime -framework AppKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin_dependency_info.dat -o /Users/jakubmazur/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin

ld:找不到-lDTXcodeUtils clang的库:错误:链接器命令失败,退出代码为1(使用-v查看调用)

知道我该怎么办呢?

Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :osx

pod "DTXcodeUtils"
Run Code Online (Sandbox Code Playgroud)

xcode cocoapods

5
推荐指数
1
解决办法
252
查看次数

没有故事板或xib文件的iOS Universal App

我有一个关于通用应用程序的问题.我的应用程序不会有故事板或xib文件.没有它可以编写通用的iPhone/iPad应用程序吗?我找到了一些如何使用 storyboard 创建通用应用程序的教程,但我不希望(我不能)在我的项目中使用此功能.

如果有可能我该怎么办?如果我只需要在ViewControllers中进行更改?我开始这样做,我不会改变旧项目,所以我可以做任何事情 - 我应该学习什么/我应该记得什么?

我的目标是iOS 5.

编辑:

我在资源文件中有一个屏幕信息,我的rootViewController或任何其他ViewController将在编译时创建,所以我不能有xib文件,我不能把按钮放在xib与Interface Builder因为我甚至没有我知道那里有多少按钮.我不知道有多少屏幕,直到我在我的项目中运行.

iphone objective-c ios

4
推荐指数
1
解决办法
3661
查看次数

在navigationController中有一个通用栏按钮项

我已经UINavigationController在我的应用程序中,我希望有权UIBarButtonItem在我的应用程序中显示的所有导航栏中显示.这个按钮会加载菜单,所以我不想手动在每个导航栏中添加这个按钮,因为该功能正在加载菜单,我不想复制/过去此按钮的操作.

有没有什么办法来处理这ViewController.h.m

所以按钮充当通用栏按钮项?

uinavigationbar uinavigationcontroller uibarbuttonitem uinavigationitem ios

4
推荐指数
1
解决办法
2531
查看次数

如何在ios中搜索输入字符串中的所有单词?

说,我有词汇量(大约100000个单词)和单词("inputstring").所以:

我需要生成"inputstring"中的所有单词,如"input","string","put","strinpg"等.然后我需要在我的词汇表中查看它们.你能说出任何好的算法吗?因为我只知道:

  1. 在步骤1中递归搜索所有可能的组合
  2. 使用NSPredicates在我的词汇进行过滤.

recursion search filter nspredicate ios

4
推荐指数
1
解决办法
651
查看次数

ARC适用于所有对象?

Book中,我找到了一个句子,告诉我ARC只发布了Foundation中的Object.这是真的?所以,如果我有:

MySimpleClass *objectFromMySimpleClass = [MySimpleClass alloc] init];
Run Code Online (Sandbox Code Playgroud)

我应该释放objectFromMySimpleClass?我怎样才能做到这一点?我试试的时候

[objectFromMySimpleClass release];
Run Code Online (Sandbox Code Playgroud)

我在Xcode提示中看到不活跃的"发布",然后编译器说我不能这样做,因为ARC.发生什么了?

等等.当我使用NSCoping协议时,我还应该在使用副本时释放对象?

memory-management objective-c ios automatic-ref-counting

3
推荐指数
1
解决办法
129
查看次数

iOS中的动态自定义字体加载器

我已经知道如何自定义字体在iPhone应用程序加载从我的项目在这里 我想问一下,如果有一种方法可以从代码中做到这一点?我的问题是我的应用程序中有一个资源文件夹,我有一个字体文件名,我们称之为" myfont.ttf ".

我想获取一个ttf文件并将其从代码中放到plist文件中,而且我想知道fontWithName:size: method 的显示名称.有办法实现这个目标吗?

iphone objective-c uifont ios

3
推荐指数
1
解决办法
3704
查看次数

如何定义一个 NSArray?

我想在其中添加带有 NSString 值的 NSArray。我几乎可以肯定我可以使用#define它,但我不明白如何访问和初始化该声明的变量。例如我有:

#define my_definition 0;
Run Code Online (Sandbox Code Playgroud)

我知道如何访问这个 0 值。但是 NSArray 中的 NSString 怎么样?

我有一个 definition.h 文件。在那里,我可以从我的任何班级访问。

objective-c ios

3
推荐指数
1
解决办法
7857
查看次数

UITableViewCell和消失的分隔符

我尝试在我的UITableView中实现我自己的简单样式的单元格,我有分隔符的问题.在正常视图下工作得很好,但是当我选择一个单元格时,它会消失.我尝试添加到我的customSelect视图分隔符,但后来我无法在任何地方看到分隔符.如何在选定的单元格中添加分隔符?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *MyCellIdentifier = @"MyCellIdentifier";

    UITableViewCell *cell = [wallMenuTableView dequeueReusableCellWithIdentifier:MyCellIdentifier];

    if(cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyCellIdentifier];

        MenuItemModel *mItem = [menu.menuPositions objectAtIndex:indexPath.row];
        cell.textLabel.text = mItem.displayName;
        cell.textLabel.textColor = [UIColor colorWithRed:0.70 green:0.70 blue:0.70 alpha:1.0];
        cell.textLabel.backgroundColor = [UIColor clearColor];
        cell.textLabel.font = [UIFont fontWithName:@"ArialMT" size:16];
        cell.textLabel.shadowColor = [UIColor blackColor];
        cell.textLabel.shadowOffset = CGSizeMake(0.0, 1.0);

        customSeparator = [[UIView alloc] initWithFrame:CGRectMake(0, (cell.frame.origin.y), 320, 2)];
        customSeparator.backgroundColor=[UIColor blackColor];
        [customSeparator.layer setShadowOffset:CGSizeMake(0.0, 0.8)];
        [customSeparator.layer setShadowOpacity:0.8];
        [customSeparator.layer setShadowRadius:0.8];
        [customSeparator.layer setShadowColor:[UIColor grayColor].CGColor]; …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

3
推荐指数
1
解决办法
2885
查看次数

iOS5中的Youtube - 完成按钮Tapped

在iOS5中我想加载Youtube电影,我用它完成:

- (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame {

NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
NSString *html = [NSString stringWithFormat:embedHTML, urlString, frame.size.width, frame.size.height];
videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:nil];
[self.view addSubview:videoView];
Run Code Online (Sandbox Code Playgroud)

}

呼叫:

        [self embedYouTube:@"http://www.youtube.com/v/PqtUSSdf8b4" frame:CGRectMake(0, 0, self.view.frame.size.width, 100)];
Run Code Online (Sandbox Code Playgroud)

我有标准的Youtube框架和"完成"按钮.当我点击完成按钮时,我将重定向到我的根VC.为什么?我怎样才能进入我的VC(当我调用它时)?

更重要的是 - 如何捕捉"完成按钮"事件?

编辑:我有MainVC和DetailVC.MainVC将DetailVC称为ModalViewController.从那里我称之为这种embedYouTube方法.当我在这个屏幕上完成时: 在此输入图像描述

我要回MainVC而不是DetailVC.为什么?如何抓住这个事件?

编辑:iOS 6只显示黑色背景 - 没有.为什么?

youtube objective-c webview ios ios5

3
推荐指数
1
解决办法
2055
查看次数