iOS自定义注释:注释引脚下方的视图

我需要用我的自定义注释视图replace默认的注释视图。 我需要做以下事情: 自定义注释视图中embedded了图像视图。 在它下面的视图中包含一个标签。 要了解更多信息,请参阅图像: 在上面的图片中,我需要在图片视图中放置一个可以在图片中看到的圆形图片,接下来我还需要添加一个包含标签的视图,在该图片上可以设置像我这样的文本,朋友,等等… 所以,为此,我search了堆栈溢出的问题的数目,但没有得到我的答案。 我不想让它出来,我只是想把它作为地图渲染时的注释。 我试图为此做一个自定义的类,但不知道如何处理这个。 任何帮助将不胜感激

获取GPS没有警报视图与ROOT权限(越狱)

我怎样才能没有警报视图(越狱iPhone)的GPS? NSString *newText; CLLocationManager * locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation]; [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters]; CLLocation* location = [locationManager location]; CLLocationCoordinate2D coordinate = [location coordinate]; newText = [[NSString alloc] initWithFormat: @"Your Position : %f %f", coordinate.latitude, coordinate.longitude]; NSLog(@"%@", newText);

如何使用swift只在已知的时间内stream式传输audio

我使用的AVPlayer(我不需要,但我想stream,尽快开始播放)播放m4a文件(这是一个iTunesaudio预览)。 只有我只想让它扮演那个文件的一部分。 我可以设置开始时间,但不是结束时间。 使用计时器不起作用,因为我使用URL作为http地址。 我正在玩,因为它没有下载文件。 我也看到了Objective-C中的解决scheme,使用KVO来了解音乐什么时候开始播放,但我认为这不是最好的方法,因为我使用的是快捷方式,也是因为可能发生的故障,所以歌曲不会停在正确的时刻。 任何帮助? 任何build议? 谢谢

完成button只能用于数字键盘

我正在开发iPhone应用程序。 在一个视图中我有四个文本框。 在这四个文本框中,我有一个文本框,其中将使用数字键盘。 但是在数字键盘上没有返回键。 所以我通过使用下面的代码以编程方式添加了“完成”button。 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil]; } else { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; } – (void)addButtonToKeyboard { // create custom button UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; doneButton.frame = CGRectMake(0, 163, 106, 53); doneButton.adjustsImageWhenHighlighted = NO; if ([[[UIDevice currentDevice] systemVersion] floatValue] […]

保持NSOperationQueue,直到上一个操作完成

我只想执行一些操作,只有在完成前一个操作时才需要开始下一个操作。 我添加的操作将发送asynchronous调用到服务器并接收数据。 我只想在第一次调用服务器完成从服务器接收数据之后才开始下一个操作。 怎么做? {…. PhotoDownloader *pd = [[PhotoDownloader alloc] init]; [GetGlobalOperationQueue addOperation:pd]; } 在PhotoDownloader里我将分配所需的参数,并调用一个全局函数来处理所有的请求 [GlobalCommunicationUtil sendServerReq:reqObj withResponseHandler:self]; 在sendServerReq方法中,我将构造URL请求并将其发送到服务器,此调用是“sendAsynchronousRequest”调用。 PhotoDownloader将具有CommunicationUtil的委托方法。

Xcode 7.1 beta 2-禁用ATS

Heyy,我花了我最后一天左右的时间,试图阻止ATS,我知道它也被认为是不好的,但我目前只在内部工作。 我已经尝试了很多build议,无济于事,最新尝试下面的info.plist。 我失去了做什么? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>localhost</key> <dict> <!–Include to allow subdomains–> <key>NSIncludesSubdomains</key> <true/> <!–Include to allow HTTP requests–> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <!–Include to […]

方法使用FacebookSDK从asynchronous块返回值

我想要做的是Facebook的iOS SDK的Facebook包装。 基本上这个想法是,我的ViewController应该什么都不做,但显示前。 我的朋友,将通过一个简单的电话来获得 self.friends = [FacebookWrapper myFriends]; [self.tableView reloadData]; 我的包装myFriends方法应该看起来像这样 + (NSArray *)myFriends { __block NSArray *friends = nil; [FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if(FB_ISSESSIONOPENWITHSTATE(status)) { [FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, id data, NSError *error) { CFRunLoopStop(CFRunLoopGetCurrent()); if(error) { return; } NSArray *friendsData = (NSArray *)[data data]; NSMutableArray *fbFriends = [NSMutableArray […]

UIView和UIViewController有什么区别?

我需要详细的解释如下: 我们使用UIViewController来做什么? 它有什么用处? 我有一个类如下所示: class one { UINavigationController *nav = …; two *secondObject = …; // By use of it, I have push the new view class two//ok } class two { … } 我怎样才能在第一类中使用secondObject ? 什么是从窗口阶层开始?

使用另一个expression式作为sum:expression的参数从NSManagedObject获取聚合数据

是否可以使用expression式作为sum: expression的参数? 我有实体( NSManagedObject类) Drink属性costPerDrink , numberOfDrinks和drinkingDate 。 我想在一段时间内得到总成本( numberOfDrinks乘以costPerDrink )的总和。 虽然我没有任何问题得到单一财产总和(例如在时间段内数字的总和),当我尝试使用另一个(乘法)expression式的和expression式时,我得到错误: NSInvalidArgumentException, reason: Unsupported argument to sum : ( "costPerDrink * numberOfDrinks" ) 见代码: // Init fech NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Drink" inManagedObjectContext:[Service appContext]]; [request setEntity:entity]; // Return dictionary [request setResultType:NSDictionaryResultType]; // Set conditions [request setPredicate:[NSPredicate predicateWithFormat:@"(drinkingDate>=%@) AND […]

以编程方式中心UIButton

我有一个UIButton,我以编程方式添加。 这里没有问题,它应该像它应该和看起来不错。 然而,当我倾斜手机风景的button不正确,我希望它仍然居中。 肖像: 景观: 我已经尝试了一堆东西,但似乎无法得到它的工作,在我看来,autoresizing应该照顾它,但是…它不起作用的情况下。 – (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 49)]; _notMeButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *butImage = [[UIImage imageNamed:@"notme.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:6]; UIImage *butImagePressed = [[UIImage imageNamed:@"KC_notmePressed.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:6]; [_notMeButton setBackgroundImage:butImage forState:UIControlStateNormal]; [_notMeButton setBackgroundImage:butImagePressed forState:UIControlStateHighlighted]; [_notMeButton setTitle:NSLocalizedString(@"Change address", @"KlarnaCheckout") forState:UIControlStateNormal]; [_notMeButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; [_notMeButton setTitleColor:[UIColor […]