我正在使用xcode 4中的应用程序,一切都很好,然后发生了一些奇怪的事情.每次我创建一个新类(任何类型的类,ViewController,NSObject等)并将其导入另一个.m文件时,我得到错误"className.h"文件未找到.
这些文件在项目中,xcode中的代码检测甚至在我输入#import语句时提供了类的名称.
我退出xcode然后清理了项目,并没有做任何事情.
任何想法,这都让我发疯!
我正在构建一个应用程序,允许人们在白色背景上上传自己的图像,该应用程序将创建一个人的轮廓.
我很难找出背景.我正在使用GPUImage
框架和GPUImageChromaKeyBlendFilter
作品非常适合颜色,但如果你得到白色/黑色,很难键出其中一种颜色.如果我将键设置为白色或黑色,则键入相同的键.
有什么建议?
是否可以使用内置的iOS 6 Facebook集成来获取用户的基本信息(电子邮件地址,生日等)?我见过的所有文档/示例都使用iOS 6集成来简单地打开一个SLComposeViewController
.
感谢您的时间.
我有一个UITableView
实现重新排序控件.除了一件事外,一切都很好.拖动单元格时,UIView
将隐藏所有子视图.有没有办法防止这种情况发生?我尝试UIImage
在进入编辑模式时添加一个背景(半透明),但这会导致另一个问题,即图像被调整大小到句柄的左侧.
我正在阅读有关内存管理的所有文档,我对某些事情感到有些困惑.
使用@property时,它会为对象创建getter/setter:
.h:@property(retain,nonatomic)NSString*myString
.m:@synthesize myString
我理解这一点,但我感到困惑的是使用自我.我在不同的博客和书籍中看到了不同的语法.我见过:
myString = [NSString alloc] initWithString:@"Hi there"];
Run Code Online (Sandbox Code Playgroud)
要么
self.myString = [NSString alloc] initWithString:@"Hi there"];
Run Code Online (Sandbox Code Playgroud)
然后在dealloc我看到:
self.myString = nil;
Run Code Online (Sandbox Code Playgroud)
要么
[myString release];
Run Code Online (Sandbox Code Playgroud)
要么
self.myString = nil;
[myString release];
Run Code Online (Sandbox Code Playgroud)
在这个网站上,有人说使用self会为保留计数增加另一个增量?是真的,我没有在任何地方见过.
提供自动释放的自动吸气剂/定型器吗?
这是完成所有这些的正确方法吗?
谢谢!
我正在创建一个具有UISwitch的应用程序.我改变了拇指颜色以匹配背景(使用thumbTintColor
)并且移除了拇指上的阴影.结果是当拇指处于关闭位置时拇指消失.
有谁知道如何在拇指上添加阴影,或防止它消失?
这个问题已经被问了很多,并且有很多答案,但我找到的答案都没有回答如下:
我有一个UITabBarController
我想隐藏标签栏,所以我打电话给:
self.tabBarController.tabBar.hidden = YES
Run Code Online (Sandbox Code Playgroud)
这将删除栏,但现在有一个空黑框,其中标签栏用于驻留.我已经尝试调整当前正在呈现的ViewController的框架,它始终位于标签栏左侧的黑框后面.
我还遍历所有子视图并隐藏它们,没有运气.
最后,我尝试调整tabbar框架的大小,但这也不起作用
有人有运气吗?
另外:hidesBottomBarWhenPushed不起作用,因为该应用程序不是基于UINavigationViewController,它基于UITabBarController.
这是一款iPad应用
我有一个问题UIPageControl
.我在下面简化了问题:
我UIPageControl
在"界面"构建器的应用程序中放了一个按钮和一个按钮,并在代码中添加以下内容:
- (IBAction)tappedButton:(id)sender{
self.pageControl.currentPage = 3;
NSLog(@"Tapped Button");
}
- (IBAction)changePage:(id)sender{
NSLog(@"PAGE Changed!!!!");
}
Run Code Online (Sandbox Code Playgroud)
我通过Interface Builder将Value Changed操作附加到pageController.
当我点击按钮时,我看到输出"Tapped Button",第三个点突出显示......但是changePage
从不调用该方法.
有任何想法吗?
是否可以在运行时更改自动布局约束?
我知道你可以改变常数,但你会如何改变不同的属性.
例如,NSLayoutAttributeTop到NSLayoutAttributeBottom?
这是我希望实现的一个简单示例,它将在左上角设置一个标签,然后当您按下一个按钮时,它会将标签设置在右下方.
初始约束按预期工作,点击按钮不能按预期工作,并抛出臭名昭着的"无法同时满足约束".
这是我正在使用的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.view setTranslatesAutoresizingMaskIntoConstraints:NO];
self.constraintA = [NSLayoutConstraint constraintWithItem:self.topLabel
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:0.0];
self.constraintB = [NSLayoutConstraint constraintWithItem:self.topLabel
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:0.0];
[self.view addConstraint:self.constraintA];
[self.view addConstraint:self.constraintB];
}
- (IBAction)tappedChange:(id)sender
{
[self.view removeConstraints:@[ self.constraintA, self.constraintB ]];
self.constraintA = [NSLayoutConstraint constraintWithItem:self.topLabel
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:0.0];
self.constraintB = [NSLayoutConstraint constraintWithItem:self.topLabel
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:self.view
attribute:NSLayoutAttributeRight
multiplier:1.0
constant:0.0];
[self.view addConstraint:self.constraintA];
[self.view addConstraint:self.constraintB];
[self.view setNeedsLayout];
}
Run Code Online (Sandbox Code Playgroud)
感谢您的时间.
objective-c ×8
ios ×6
cocoa-touch ×3
iphone ×2
xcode ×2
autolayout ×1
facebook ×1
gpuimage ×1
ios6 ×1
ipad ×1
properties ×1
synthesizer ×1
uiswitch ×1
uitableview ×1
xcode15 ×1