如何从View Controller中获取UIView的大小?

在UIViewController的viewDidLoad方法里面: NSLog(@"frame: %f %f", self.view.frame.size.width, self.view.frame.size.height); 随着横向设备: frame: 748.000000 1024.000000 纵向设备: frame: 768.000000 1004.000000

如何从谷歌地图的标记在ios中的dictionay?

在我的应用程序中,我已经做了JSONparsing,我得到了一个字典的forms的坐标,我想使用坐标angd在地图上绘制它, 我有使用这个 SBJsonParser *jsonParser = [SBJsonParser new]; NSArray *jsonData = (NSArray *) [jsonParser objectWithString:outputData error:nil]; for(int i=0;i<[jsonData count];i++) { NSDictionary *dict=(NSDictionary *)[jsonData objectAtIndex:i]; Nslog(@"%@",dict); double la=[[dict objectForKey:@"latitude"] doubleValue]; double lo=[[dict objectForKey:@"longitude"] doubleValue]; CLLocation * loca=[[CLLocation alloc]initWithLatitude:la longitude:lo]; CLLocationCoordinate2D coordi=loca.coordinate; marker=[GMSMarker markerWithPosition:coordi]; marker.snippet = @"Hello World"; marker.animated = YES; marker.map = mapView; } 它被打印为 [{"driver_id":"Tn1234sunil@gmail.com","username":"sunil","latitude":"0.000000000000000", "longitude":"0.000000000000000"}, […]

核心数据重置

我正在重新设置coreData中的数据,下面是我的代码来重置CoreData中的数据 – (void) resetApplicationModel { __managedObjectContext = nil; __managedObjectModel = nil; __persistentStoreCoordinator = nil; _allPageViewController.controller = nil; NSError *error; NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"abc.sqlite"]; if ([[self.managedObjectContext persistentStoreCoordinator] removePersistentStore:[[[self.managedObjectContext persistentStoreCoordinator] persistentStores] lastObject] error:&error]) { // remove the file containing the data if([[NSFileManager defaultManager] removeItemAtURL:storeURL error:&error]) { //recreate the store like in the appDelegate method if([self.persistentStoreCoordinator […]

密码validation的正则expression式Objective-C

任何人都可以请帮助我,我需要一个正则expression式密码validation。 条件:密码应该是最多8个字符数字或字母至less有一个特殊字符 提前致谢。

如何解决分配问题?

我在乐器工具中看到这个问题,但不知道问题在哪里。 没有泄漏报告 当我跟着链接,我发现一些问题(图像2&3&4)是这些泄漏或什么? 我想我在代码中到处都是犯同样的错误,但不知道是什么

所以,如果string不是NilLiteralConvertible …一些string函数返回什么?

我们假设下面的代码: let url = "http://%20abc" let urlString = url.stringByRemovingPercentEncoding! if urlString != nil { println("done") } stringByRemovingPercentEncoding应该返回一个可选的String。 所以让我们解开它。 现在发生什么事情,当它真的“失败”,并不返回一个string? string不是NilLiteralConvertible,因此下一行有一个编译器错误。 我真的很困惑 – 所以我应该怎么比较urlString ,如果我认为url.stringByRemovingPercentEncoding是一个解包可选? 显然这不是无效的。 请注意,我可以将urlString作为一个可选的值,然后解开它,等等。这不是重点。 关键是这个确切的情况。 非常感谢!

是否可以设置UIDatePicker只有几天(不包括小时,分钟和秒)?

我试图让UIDatePicker仅向用户显示date,月份和年份。 我想避免给他们提供小时,分钟和秒钟,如默认。 我试过寻找可能有帮助的东西,但只能find在Objective-C中没有清楚解释的解决scheme,但是我正在使用Swift进行编码。 有任何想法吗? 提前致谢!

如何从价值的降序从Firebase获取数据?

我想获得前10名用户的高分,并以表格forms显示。 leaderboards CQVudhI2OjTfNbqWOWi2T1DTWKw2 HIGH-SCORE: 23 PLAYER-NAME: Russell REACTION-TIME: .9 SWIPES: 12 F9IbjpVSE8g5YN3PX0sdhSNGULJ3 HIGH-SCORE: 29 PLAYER-NAME: Clayton REACTION-TIME: .87 SWIPES: 22 HDIHCUSJDHCJHZKSHJXH HIGH-SCORE: 89 PLAYER-NAME: Damien REACTION-TIME: .77 SWIPES: 32 jdhsjdbwkjsdkahnkdnk232j3j2 HIGH-SCORE: 43 PLAYER-NAME: Christopher REACTION-TIME: .99 SWIPES: 32 在表格视图中,我想展示10名得分手的名字和得分。 任何帮助,将不胜感激。 谢谢

NSDatedate不给我正确的时间

我正在尝试获取当前date: NSLog(@"DATE NOW : %@", [NSDate date]); 但是,当我执行它时,我显示的date和当前date之间有一小时的差异。 日志http://data.imagup.com/12/1171458807.5637png 我发现这样的问题的主题,但没有人给我答案。 我怎样才能改变呢?

在领域中的子查询和IN语句

我有三个领域对象。 部门,部门和用户。 部门是一个部门的一个子部门。 但是每个部门和每个部门都会有用户。 @interface Department : RLMObject @property NSString *name; @property BOOL isCollapsed; @property (nonatomic, strong) RLMArray<Section> *sections; @property (nonatomic, strong) RLMArray<User> *users; @end @interface Section : RLMObject @property NSString *name; @property BOOL isCollapsed; @property RLMArray<User> *users; @end @interface User : RLMObject @property NSString *department; @property NSString *email; @property NSString *firstname; @property NSString *lastname; […]