Tag: ios7

在Storyboard中使用viewController类的一个实例

所以我遇到了另一个小问题,花了早上试图弄清楚。 几乎没有成功。 我正在Xcode 5中编写一个iOS7应用程序,其中包含故事板。 在应用程序的一部分,我需要三个共享相同viewController类的屏幕。 这些屏幕是UIViewControllers 。 我使用UISegmentControl根据条件从屏幕切换到屏幕。 如果用户没有完成某些步骤,我禁用了该控件。 我使用BOOL值检查某些步骤是否已完成,并将其值设置为YES / NO. 问题是当我想回到最后一个屏幕 – 我正在得到我的viewController类的新实例。 这有两个问题: 每次用户在两个视图之间都会增加内存 当新实例加载时,BOOL值和所有其他属性均为零。 在我的细分控制中,我是这样看待观点的: -(void)segmentcontrol:(UISegmentedControl *)segment { if (segment.selectedSegmentIndex == 0) { self.viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"stepOne"]; [self presentViewController:self.viewController animated:NO completion:nil]; } else if (segment.selectedSegmentIndex == 1 ){ self.viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"stepTwo"]; [self presentViewController:self.viewController animated:NO completion:nil]; }else { } } 这个viewController是我的BaseViewController一个子类 […]

从string中提取价格

我正在寻找一个简短而方便的方式从NSString中提取产品的价格。 我试过正则expression式,但总是发现一些不匹配的情况。 价格可以是任意数字,包括小数,0 和-1 (有效价格:10,10.99,-1,0)。 NSString可以包含一个string,如:@“Prod。price:$ 10.99” 谢谢!

UIButton titlelabel shadowoffset属性在ios 7中performance不正确

我正在使用下面的代码来获得button标题标签的阴影。 theCuLabel.titleLabel.shadowColor=[UIColor blackColor]; theCuLabel.titleLabel.shadowOffset=CGSizeMake(-3.0,2.5); 在IOS 6中,其工作正常如下 但是在IOS 7中,它不像以下那样按预期工作 我没有find这个解决scheme,任何人都可以告诉我的解决scheme或在IOS 7发生的任何更新。 提前致谢…

在上下文崩溃的情况下保存核心数据

我有一个方法创build一个单独的线程: // Create thread dispatch_queue_t uniqueQueue = dispatch_queue_create("Unique Email Queue", NULL); // Run block on another thread called downloadQueue dispatch_async(uniqueQueue, ^{ // Get the persistance store coordinator AppDelegate* appDelegate = [UIApplication sharedApplication].delegate; self.persistentStoreCoordinator = appDelegate.persistentStoreCoordinator; // Setup the managed object context NSManagedObjectContext *managedObjectContext = [[NSManagedObjectContext alloc] init]; [managedObjectContext setPersistentStoreCoordinator:self.persistentStoreCoordinator]; // Save to core data for […]

从testing飞行安装iOS应用程序会显示位置许可警报

当我从iOS7设备上的testing飞行安装iOS应用程序时,我正面临着这个奇怪的问题。 一旦应用程序安装完成,我会立即在屏幕上看到位置服务许可警报(“不允许”和“确定”button)。 警报在几分之一秒内消失。 任何类似的问题指针/解决scheme是高度赞赏。

iOS7 – 地图视图引脚在触摸屏幕之前不会出现

在我的应用程序中,我使用json从Web服务下载了一组点。 实现iOS7的应用程序,我正在试验这个问题:地点下载,但地图上的引脚不绘,直到用户触摸和“移动”地图。 然后他们出现,并在iOS6中工作。 我怎样才能改正这种行为? 编辑:AddAnnotation被称为在接收数据的方法的结尾,parsingJSON并将它们传递给mylocaction对象: – (void)plotBarPosition:(NSString *)data_string { // Parse the string into JSON NSDictionary *json = [(NSDictionary*)[datos_string1 JSONValue]objectForKey:@"features"]; for (int i = 0; i < [json count]; i++){ /* PARSING EACH POINT */ MyLocation *location =[[MyLocation alloc] initWithName:nameLoc coordinate:coordinate estado:status antenaId:antenaId]; [_mapView addAnnotation:location]; } } 我也试过: [_mapView performSelectorOnMainThread: @selector(addAnnotations:) withObject: location waitUntilDone: NO]; […]

使用NIB定义从故事板出来的UITableViewCell

我使用Json数组来显示来自服务器的数据。 当我将CellIdentifier更改为我在CellIdentifier中使用的@Cell时,pushDetailView正在工作,它将进入下一页,但是当我再次更改为CustomCell时,只需在第一页中显示城市和州的名称,而当我点击时不会去下一页。 我需要@CustomCell的原因是因为在第一页需要2个标签视图,当我将其更改为@cell时,它只显示一个标签。 谢谢。 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; } // Configure the cell… City * cityObject; cityObject = [ citiesArry objectAtIndex:indexPath.row]; cell.textLabel.text = cityObject.cityState; cell.detailTextLabel.text = cityObject.cityPopulation; cell.detailTextLabel.numberOfLines = 4; //NSData *imageData = […]

iOS 7中的UDID或UUID的副本是什么?

问题是我一旦生成UUID它为我工作。 但是,如果我/用户删除应用程序比UUID是不一样的,像我以前所产生的。 如果我们使用uuid作为标识符,这里没有唯一性。 请帮我解决这个问题。我怎样才能得到相同的uuid或任何string,如果应用程序重新安装。 提前致谢.. 我正在使用这种方法: NSString *udid; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) udid = [UIDevice currentDevice].identifierForVendor.UUIDString; else udid = [UIDevice currentDevice].uniqueIdentifier;

如何使用协议

我有两个viewControllers 服务提供者 工作地点 在ServiceProvider我有一个文本字段和一个selectbutton。 当用户点击selectbutton时,它将redirect到具有location列表的WorkLocation 。 当用户select任何location ,然后点击WorkLocationselectbutton时,它将redirect到带有locationName和Id ServiceProvider页面。 在ServiceProvider页面中, locationName将显示在已经存在的文本字段中。 要执行此操作,我正在使用一个协议。 WorkLocation声明: #import <UIKit/UIKit.h> #import "WorkDetailCell.h" @protocol WorkLocationDetailViewDelegate <NSObject> @required -(void)organizationInfo:(NSString *) organization_id name:(NSString *)name; @end @interface WorkLocationDetailsViewController :UIViewController < UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate > { IBOutlet UITableView *workLocationTableView; IBOutlet UISearchBar *workLocationSearchBar; NSMutableArray *workDetailArray,*tempDataArray,*searchArray,*searchResultArray; BOOL search; } @property (nonatomic,retain) id < WorkLocationDetailViewDelegate > delegate; WorkLocation实现: […]

iPhone 4S上的GPUImage Kuwahara滤镜

我正在使用Brad Larson的GPUImage框架。 但是,当我试图应用滤波器半径为5.0f kuwahara滤波器,我得到了iPhone 4S的文物。 (在更高性能的设备上工作正常) 源图像大小是2048x2048px. 通过阅读原始开发人员的评论,我了解到有一种看门狗定时器,当GPU花费太长时间运行时会触发。 所以我的问题是,什么是最大可能的分辨率为iPhone 4S我可以申请Kuwahara滤波器半径5.0f没有得到文物?