我创建了一个UIPopoverController并将其添加到视图控制器时单击UIButton如下所示
- (void)viewDidLoad
{
[super viewDidLoad];
controller = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
popoverController = [[UIPopoverController alloc] initWithContentViewController:controller];
}
- (IBAction)showPopover:(UIButton *)sender
{
if ([popoverController isPopoverVisible]) {
[popoverController dismissPopoverAnimated:YES];
} else {
CGRect popRect = CGRectMake(self.btnShowPopover.frame.origin.x,
self.btnShowPopover.frame.origin.y,
self.btnShowPopover.frame.size.width,
self.btnShowPopover.frame.size.height);
[popoverController presentPopoverFromRect:popRect
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
}
}
Run Code Online (Sandbox Code Playgroud)
btnShowPopover是UIButton在viewcontroller,popoverController是UIPopoverController.
的popovercontroller同时单击该按钮显示正常.
但它不会解雇当我点击UIButton的secondviewcontroller
我使用了以下代码
-(IBAction)y:(id)sender{
fs = [[Firstviewcontroller alloc] initWithNibName:@"FIrstscreen" bundle:[NSBundle mainBundle]];
[fs.popoverController dismissPopoverAnimated:TRUE];
}
Run Code Online (Sandbox Code Playgroud)
但它没有用. …
如果我们使用iPhone相机拍摄照片,默认情况下图像将以JPEG格式保存.
我想保存以PNG等其他格式捕获的图像.可能吗?
当我们从我们的应用程序调用iPhone相机时,是否可以从代码执行此操作,我们可以设置在捕获图片后必须保存的图像类型吗?我的意思是在拍摄照片之前打开相机并设置类型?
我目前正在使用从github下载的card.io SDK进行信用卡集成.
它工作得很好,但必须手动输入到期日期和cvv号码.我搜索了那个并找到了
较新版本的card.io SDK(3.x及更高版本)未添加到期日扫描.- 参考.
但是,返回值显示了我
Received card info. Number: ••••••••••••xxxx, expiry: 09/2015, cvv: 123.
Run Code Online (Sandbox Code Playgroud)
是否可以获得信用卡的全部数量而不是获得点数?
是否可以下载此SDK的旧版本以进行到期日期扫描?
任何建议将不胜感激.
我使用的是MS Visual Studio Professional 2012,版本:11.0.51106.01.由于过去几天意识到我无法使用模板JavaScript创建新项目.我之前能做到这一点.我猜这可能是因为某些系统更新而发生的.
当我尝试创建一个新项目时,这是错误日志:
没有找到与约束匹配的导出:ContractName Microsoft.VisualStudio.Text.ITextDocumentFactoryService RequiredTypeIdentity Microsoft.VisualStudio.Text.ITextDocumentFactoryService
请尽早帮我解决这个问题,因为我无法在网上找到太多.
当我尝试本教程时,我是 JPA 和休眠的新手 。我在我的persistence.xml中添加了以下提供者,
<provider>org.hibernate.ejb.HibernatePersistence</provider>
Run Code Online (Sandbox Code Playgroud)
我收到这个错误..
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.Configuration.addAnnotatedClass(Ljava/lang/Class;)Lorg/hibernate/cfg/Configuration;
at org.hibernate.ejb.Ejb3Configuration.addAnnotatedClass(Ejb3Configuration.java:1421)
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1391)
at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1184)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1048)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:291)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:373)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at de.vogella.jpa.simple.main.Main.main(Main.java:17)
Run Code Online (Sandbox Code Playgroud)
请帮助解决此错误。谢谢
annotations hibernate jpa persistence.xml hibernate-annotations
我试图在MKMapView中加载一个地址,因为我使用了以下代码
CLLocationCoordinate2D location = [self getLocationFromAddressString:@"321 Iowa St, Fallbrook, CA 92028, United States US"];
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = 0.05;
span.longitudeDelta = 0.05;
region.span = span;
region.center = location;
[mapView setRegion:region animated:YES];
[mapView regionThatFits:region];
Run Code Online (Sandbox Code Playgroud)
以下是获取给定地址位置的代码
-(CLLocationCoordinate2D) getLocationFromAddressString:(NSString*) addressStr
{
NSString *urlStr = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv",
[addressStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSError *error = nil;
NSString *locationStr = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlStr] encoding:NSUTF8StringEncoding error:&error];
NSArray *items = [locationStr componentsSeparatedByString:@","];
double lat = 0.0;
double lon = 0.0;
if([items count] >= 4 && [[items objectAtIndex:0] isEqualToString:@"200"]) …Run Code Online (Sandbox Code Playgroud) control_td.each(function(){
$.ajax({
url: 'control.php?udid='+$(this).attr('udid'),
cache: false,
async: true
}).done(function(data) {
$(this).html(data);
});
});
Run Code Online (Sandbox Code Playgroud)
但$this在.done子功能中不起作用.我在这做错了什么?
我正在使用card.io ios sdk进行信用卡扫描。
是否可以使用card.io获取信用卡类型(即,是Amercan Express还是Master或Visa)?
我们可以使用card.io从信用卡获得的所有其他可能的详细信息是什么?
我将图像转换为NSData,NSData转换为base64string
NSData *imagedata = UIImageJPEGRepresentation(imageView.image, 0.1f);
NSString *c = [NSString base64StringFromData:imagedata];
Run Code Online (Sandbox Code Playgroud)
字符串转换的fn
+ (NSString*)base64forData:(NSData*)theData {
const uint8_t* input = (const uint8_t*)[theData bytes];
NSInteger length = [theData length];
static char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
NSMutableData* data = [NSMutableData dataWithLength:((length + 2) / 3) * 4];
uint8_t* output = (uint8_t*)data.mutableBytes;
NSInteger i;
for (i=0; i < length; i += 3) {
NSInteger value = 0;
NSInteger j;
for (j = i; j < (i + 3); j++) {
value <<= 8;
if (j …Run Code Online (Sandbox Code Playgroud) 我想检查一个字符串是否匹配表格az ^ 3,其中a是任何整数.我尝试过以下方法:
str.matches("\\d* z^3")
str.matches("\\d* z\^3")
str.matches("^(\\d* z^3)$")
str.matches("^(\\d* z\^3)$")
str.matches("\\d* (z^3)")
str.matches("\\d* (z\^3)")
Run Code Online (Sandbox Code Playgroud)
这真让我抓狂.:-(我已经尝试了所有可能的正则表达式教程并搜索了示例,我仍然无法提出解决方案.
如果有人能帮助我,我真的很感激.
我正在使用Split View Controller,它在第二个视图控制器上有2个View控制器,我想在导航控制器的右侧添加两个按钮.我使用以下代码添加一个工作的按钮:
UIBarButtonItem *barButton=[[UIBarButtonItem alloc] init];
[barButton setCustomView:btnShare];
self.navigationItem.rightBarButtonItem=barButton;
Run Code Online (Sandbox Code Playgroud)
试过这个链接http://osmorphis.blogspot.in/2009/05/multiple-buttons-on-navigation-bar.html 但是没有成功.请帮我解决这个问题.
iphone objective-c uibarbuttonitem uisplitviewcontroller ios