我可以使用IB_DESIGNABLE和/或IBInspectable在Interface Builder中设置layer.borderWidth和layer.borderColor吗?我目前正在代码中创建我的按钮,但我希望能够在IB中设置所有这些,但我不确定这些属性是否可以在Xcode 6中设置.我想将它设置为IBOutlet而不是在代码中设置所有这些.这是我的按钮代码.
directions = [UIButton buttonWithType:UIButtonTypeRoundedRect];
directions.titleLabel.textAlignment = NSTextAlignmentCenter;
directions.titleLabel.font = [UIFont fontWithName:@"FranklinGothicStd-ExtraCond" size:20.0];
[directions setTitle:@"Directions" forState:UIControlStateNormal];
[directions setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
directions.frame = CGRectMake(20, 178, 70, 70);
directions.layer.borderWidth = 2.0f;
directions.layer.borderColor = [UIColor whiteColor].CGColor;
directions.clipsToBounds = YES;
directions.backgroundColor = [UIColor clearColor];
[directions addTarget:self action:@selector(getDirections:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:directions];
Run Code Online (Sandbox Code Playgroud)

我按照建议设置了这些值,并且模拟器中从不显示边框.编辑:我发现为什么在IB中设置这些值时边框没有显示出来.边框颜色是CGColor,所以我必须在代码中设置它.

我在OS X Maverick上安装了XAMPP 1.8.3-1,一切都很好,直到我昨晚升级到Yosemite,现在当我尝试在管理器中启动MySQL时,它将无法启动.
活动监视器显示没有其他MySQL进程在运行.在错误日志中,我发现此消息:
2014-08-06 17:19:04 5277 mysqld_safe用/ Applications/XAMPP/xamppfiles/var/mysql中的数据库启动mysqld守护进程dyld:未找到符号:_sqlite3_intarray_bind引用自:/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData预期在:/Applications/XAMPP/xamppfiles/lib/libsqlite3.dylib /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData 2014-08-06 17:19:05 5277 mysqld_safe mysqld from pid文件/Applications/XAMPP/xamppfiles/var/mysql/MacBook-Pro.local.pid结束
我需要正则表达式来验证巴基斯坦国民身份证(NIC)号码,其中包含下面给出的格式的数字和破折号
12345-1234567-1
请帮忙..
我想知道如何制作一个首先缩放到尺寸并旋转该尺寸而不是按原始尺寸旋转的 UIView 动画?
我尝试了很多方法,比如在完成一个UIView动画时包装UIView动画,使用UIView animateKeyframes等等。
但是,我无法完美地制作这样的动画,请给我提示或关键字来搜索,谢谢!
我在项目的AppDelegate.h文件中突然编译时遇到3个未知错误,这个错误持续了一个月.哪个是!
解析问题 - 预期标识符或'('
解析问题 - 预期')'
语义问题 - 未知类型名称'ViewController'; 你是说'UIViewController'吗?
我逐行检查了我的代码,没有语法错误或语义问题(我的项目中有ViewController.h,ViewController.m和ViewController.xib).这些只是未知错误,xcode在AppDelegate.h文件中显示错误
AppDelegate.h
#import <UIKit/UIKit.h>
@class ViewController;
@class SignInViewController;
@class StagesViewController;
@class ResultViewController;
@class myFacebook;
@interface AppDelegate : UIResponder <UIApplicationDelegate>{
myFacebook *myFB;
NSString *appVer;
}
+ (NSString*)Username;
+ (void)setUsername:(NSString*)newUser;
+ (NSString*)UserID;
+ (void)setUserID:(NSString*)newId;
@property (nonatomic, retain) myFacebook *myFB;
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *theNavigationController;
@property (strong, nonatomic) ViewController *viewController;
@property (strong, nonatomic) SignInViewController *signInViewController;
@property (strong, nonatomic) StagesViewController *stagesViewController;
@property (strong, nonatomic) ResultViewController *resultViewController;
@end
Run Code Online (Sandbox Code Playgroud)
任何形式的帮助将不胜感激,因为我自上周以来一直在寻找这些错误但无法解决.
ios ×2
objective-c ×2
jquery ×1
osx-yosemite ×1
regex ×1
uibutton ×1
upgrade ×1
validation ×1
xampp ×1
xcode6 ×1