我知道如何在iOS 7中为按钮添加边框,使用以下代码:
[[myButton layer] setBorderColor:[[[UIColor grayColor] colorWithAlphaComponent:0.5] CGColor]];
[[myButton layer] setBorderWidth:1];
[[myButton layer] setCornerRadius:15];
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能添加一个边框?我想只添加顶部边框.
当我创建自定义后退按钮时,我使用以下代码:
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc]initWithTitle:@"Yeah" style:UIBarButtonItemStyleBordered target:self action:@selector(backButtonPressed:)];
self.navigationItem.leftBarButtonItem = leftButton;
Run Code Online (Sandbox Code Playgroud)
这工作正常,我得到了这个结果:

我会得到相同的结果,但左边有一个箭头,就像这样(当它是一个标准的后退按钮,而不是一个自定义的按钮):

我怎么能简单地添加这个箭头?
根据Ray Wenderlich教程,我做了以下工作:
第1步 -我在官方网站上下载了 CorePlot_1.4.zip
第2步 -我在我的项目中添加了 CorePlotHeaders文件夹和名为libCorePlot-CocoaTouch.a的静态库(选中 "将项目复制到目标组的文件夹(如果需要)")
第3步 -我将以下内容添加到 Other Linker Flags字段中: -ObjC
第4步 -如果 libCorePlot-CocoaTouch.a和 QuartzCore框架在这里,我检查了 Link Binary和Libraries
结果:当我编译我的项目时,它在我使用 Iphone Retina(4英寸)时工作正常.但是当我使用 Iphone Retina(4英寸64位) 时,我在尝试构建和运行时收到以下消息:
ld: warning: ignoring file /blah/blah/libCorePlot-CocoaTouch.a, missing required architecture x86_64 in file /blah/blah/libCorePlot-CocoaTouch.a (3 slices)
这里有完整的信息:
ld: warning: ignoring file /Users/me/Desktop/project/libCorePlot-CocoaTouch.a, missing required architecture x86_64 in file /Users/me/Desktop/project/libCorePlot-CocoaTouch.a (3 slices)
Undefined symbols for architecture x86_64:
"_CPTDecimalFromCGFloat", referenced from: …Run Code Online (Sandbox Code Playgroud) 我已经实现了IQKeyboardManager框架,使键盘手柄更容易.它的工作非常精细,除了一件事:
UItextField在我的应用程序中有一些控件打开UIDatePicker代替默认键盘(例如数字键盘,小数点,ASCII能力等).
这是一个带有图形结果的代码示例:
// Create the datePicker
UIDatePicker *birthdayDatePicker = [UIDatePicker new];
[birthdayDatePicker setDatePickerMode:UIDatePickerModeDate];
// Assign the datePicker to the textField
[myTextField setInputView:birthdayDatePicker];
Run Code Online (Sandbox Code Playgroud)
我的问题是: 是否可以通过"确定"按钮处理操作以填写"日期复兴"字段?

对于那些想知道我是如何解决问题的人:
在我的.h中,我输入了IQDropDownTextField.h:
#import "IQDropDownTextField.h"
Run Code Online (Sandbox Code Playgroud)在.h中,我将我的类型更改UITextField为IQDropDownTextField:
@property (weak, nonatomic) IBOutlet IQDropDownTextField *myTextField;
Run Code Online (Sandbox Code Playgroud)在Interface Builder或.xib中选择您的字段,并显示Identity Inspector:将您的字段类更改为IQDropDownTextField.
// Set myTextField's dropDownMode to IQDropDownModeDatePicker
myTextField.dropDownMode = IQDropDownModeDatePicker;
// Create a dateFormatter
NSDateFormatter …Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用谷歌分析,这需要Adsupport框架.当我使用AdSupport框架时,我的应用程序被拒绝显示消息:
亲爱的开发者,
我们发现您最近为"Zee News English"发送了一个或多个问题.要处理您的交付,必须纠正以下问题:
广告标识符[IDFA]使用不当.您的应用包含广告标识符[IDFA] API,但您尚未在iTunes Connect的"准备上传"页面中指明其用途.
更正这些问题后,请转到"版本详细信息"页面,然后单击"准备上载二进制文件".继续完成提交过程,直到应用状态为"等待上传".然后,您可以提供更正的二进制文件
问候,
我应该在iTunes上发布应用程序时选择IDFA选项.除了谷歌分析我没有使用任何广告的东西.
我在我的应用中使用Google Analytics,因此需要AdSupport框架.从昨天开始,当我尝试发布更新时,我的应用程序被拒绝,并显示以下错误消息:
亲爱的开发者,
我们发现您最近为"Zee News English"发送了一个或多个问题.要处理您的交付,必须纠正以下问题:
广告标识符[IDFA]使用不当.您的应用包含广告标识符[IDFA] API,但您尚未在iTunes Connect的"准备上传"页面中指明其用途.
更正这些问题后,请转到"版本详细信息"页面,然后单击"准备上载二进制文件".继续完成提交过程,直到应用状态为"等待上传".然后,您可以提供更正的二进制文件
问候,
当我发布更新时,我无法检查"此应用是否使用广告标识符?" 盒子,因为我不在我的应用程序中使用任何广告!那我该怎么办?
最后的更新很好,我只是在此更新中添加了一些小错误修复.
我有一个包含UITableView的视图.此UITableView的单元格在Interface Builder中创建,以便具有不同类型的单元格.因此,每个按钮的操作都在单元类中进行管理,如下所示.
- 我的UITableView包含不同类型的单元格:

- 我的类的头文件为类型一单元格("CellTypeOne.h"):
@interface CellTypeOne : UITableViewCell
{
}
- (IBAction)actionForFirstButton:(id)sender;
- (IBAction)actionForSecondButton:(id)sender;
- (IBAction)actionForThirdButton:(id)sender;
- (IBAction)actionForFourthButton:(id)sender;
Run Code Online (Sandbox Code Playgroud)
- 我的类的头文件,用于类型二单元格("CellTypeTwo.h"):
@interface CellTypeTwo : UITableViewCell
{
}
- (IBAction)actionForTheUniqueButton:(id)sender;
Run Code Online (Sandbox Code Playgroud)
- 包含我的表视图的视图("ViewContainingMyTableView.h"):
@interface ViewContainingMyTableView : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
UITableView *myTBV;
}
@property (retain, nonatomic) IBOutlet UITableView *myTBV;
@end
Run Code Online (Sandbox Code Playgroud)
这是我想要做的事情:
例如,当我单击第一个单元格中的第一个按钮时,我希望能够显示"当前"单元格的indexPath .
例如,我希望在以下情况下输出以下内容:
001我有一个UITableView,它无法到达整个视图.近似地,UITableView比视图小两倍.
然后,我将"搜索栏和搜索显示控制器"添加到对象库中的UITableView .因此,为了可视化,searchBar出现在屏幕的中心.
这是我的观点:

我的问题:当我点击搜索字段进行我的研究时,searchBar将转到视图的顶部,代替导航栏!过渡非常糟糕......我如何限制searchBar保持在最初的位置?
我看到有关如何检测用户何时按下 UINavigationBar上的"后退"按钮的多个问题,但答案并未解决我的问题.
实际上,我想在用户按下UINavigationBar"后退"按钮时显示UIAlertView,问他"你想保存更改吗?" .
当用户按下"后退"按钮(带有以下代码段)时,我可以显示UIAlertView,但同时弹出上一个视图.我不想要这种行为!我只是希望应用程序在弹出上一个视图之前等待用户回答 ...
-(void) viewWillDisappear:(BOOL)animated
{
if ([self isMovingFromParentViewController])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Avertissement" message:@"Voulez-vous enregistrer les modifications effectuées ?" delegate:self cancelButtonTitle:@"Retour" otherButtonTitles:@"Oui", @"Non", nil];
[alert show];
}
[super viewWillDisappear:animated];
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助......
我正在使用最新版本的opencv(opencv 2.4.9),我必须拥有Core Plot(绘图框架)所需的-ObjC标志.
当我在其他标志中设置-ObjC时,我得到了很多类型的错误(实际上是28个):Undefined symbols for architecture i386如下:
Undefined symbols for architecture i386:
"_CMSampleBufferGetImageBuffer", referenced from:
-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o)
CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
-[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
"_CMSampleBufferGetPresentationTimeStamp", referenced from:
-[CvVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_ios_video_camera.o)
"_CMSampleBufferInvalidate", referenced from:
CvCaptureFile::retrieveFramePixelBuffer() in opencv2(cap_avfoundation.o)
"_CMTimeMake", referenced from:
CvCaptureCAM::startCaptureDevice(int) in opencv2(cap_avfoundation.o)
CvVideoWriter_AVFoundation::writeFrame(_IplImage const*) in opencv2(cap_avfoundation.o)
-[CvVideoCamera createVideoDataOutput] in opencv2(cap_ios_video_camera.o)
"_CMVideoFormatDescriptionGetPresentationDimensions", referenced from:
CvCaptureCAM::getProperty(int) in opencv2(cap_avfoundation.o)
"_CVBufferRelease", referenced from:
-[CaptureDelegate captureOutput:didOutputSampleBuffer:fromConnection:] in opencv2(cap_avfoundation.o)
-[CaptureDelegate …Run Code Online (Sandbox Code Playgroud) 我有一个包含自定义单元格的UITableView.一切正常.但之后,我决定添加一个searchBar以便...搜索!
所以,我添加了一个"搜索栏和搜索显示控制器"从"对象库"在我的XIB文件,在UITableView的下.
我为自定义单元格创建了一个特定的类:
"CustomCell.h"
@class CustomCell;
@interface CustomCell : UITableViewCell
{
}
@property (weak, nonatomic) IBOutlet UILabel *lblDate;
@property (weak, nonatomic) IBOutlet UILabel *lblAuteur;
@end
Run Code Online (Sandbox Code Playgroud)
"CustomCell.m"
no interesting stuff
Run Code Online (Sandbox Code Playgroud)
"CustomCell.xib"

该"事件"类:
@interface Event : NSObject
{
}
@property (strong, nonatomic) NSString *desc;
@property (strong, nonatomic) NSString *dateCreation;
@end
Run Code Online (Sandbox Code Playgroud)包含UITableView和UISearchBar的视图:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"cell";
// Determinate the current event
Event *currentEvent;
if (tableView == …Run Code Online (Sandbox Code Playgroud)ios ×11
iphone ×7
objective-c ×4
uisearchbar ×2
uitableview ×2
xcode ×2
app-store ×1
back ×1
button ×1
cocoa-touch ×1
core-plot ×1
ios7 ×1
linker-flags ×1
opencv ×1
uibutton ×1
xcode5 ×1
xcode6 ×1