草庐IT

ios - 在 iPhone 中使用 map View 读取当前位置名称

我读取了当前位置的纬度和经度值,然后在iPhone中成功固定了该位置。现在我想使用这个纬度和经度值读取那个地名。我使用以下代码来读取查找当前位置:-(void)mapView:(MKMapView*)mapView1didUpdateUserLocation:(MKUserLocation*)userLocation{CLLocation*whereIAm=userLocation.location;NSLog(@"I'mat%@",whereIAm.description);latitude=whereIAm.coordinate.latitude;longitude=whereIA

iphone - 吞下触摸,除非触摸我当前层的 child

我正在使用CCLayer编写暂停菜单。我需要层来吞下触摸,这样你就不能按下下面的层,但是我还需要能够使用暂停层本身的按钮。我可以让图层吞下触摸,但菜单也不起作用。这是我的代码:pauseLayer.m#import"PauseLayer.h"@implementationPauseLayer@synthesizedelegate;+(id)layerWithColor:(ccColor4B)colordelegate:(id)_delegate{return[[[selfalloc]initWithColor:colordelegate:_delegate]autorelease];}

iphone - 如何将模态视图添加到当前 View Controller ?

我有这个代码:-(void)applicationDidBecomeActive:(UIApplication*)application{JUnlockController*passcodeView=[[JUnlockControlleralloc]init];[self.navigationControllerpresentModalViewController:passcodeViewanimated:YES];}问题是,当我在我的应用程序中打开模态视图Controller时,它不会出现在它的顶部。我希望能够找出用户正在查看的当前viewcontroller,以便我可以将其显示在上

ios - GIT 中的 FaSTLane Appfile?如何检索当前的 apple_id?

我为XCode项目的构建自动化设置了FaSTLane。至少Fastfile(包含构建选项)应该在GIT中,但我也很高兴Appfile(团队标识符)也在GIT中。主要问题:Appfile应该包含我的appleid。示例:apple_id"myid@gmail.com"#YourAppleemailaddress#DefaultteamIDteam_id"AUE7D4LRRX"for_platform:iosdofor_lane:productiondoteam_id'-'#resetteamidendend是否可以通过某种方式从apple/xcode首选项中动态检索appleid?在当前

IOS - 暂停和取消暂停当前正在播放的音乐

我正在开发一个IOS应用程序,我希望它具有暂停和取消暂停当前正在通过ipod播放的音乐的功能,就像ipod的播放/暂停按钮一样。反正有通过IOS做到这一点吗?我为此找到的唯一答案是处理通过应用程序在本地播放的歌曲和声音。任何帮助都会很棒。非常感谢! 最佳答案 [[MPMusicPlayerControllersystemMusicPlayer]play];[[MPMusicPlayerControllersystemMusicPlayer]pause]; 关于IOS-暂停和取消暂停当前正

ios - 在 iOS 上获取当前位置

我需要获取当前用户位置(纬度、经度),但我找不到解决方案,因为所有解决方案都只适用于iOS6、7、8。例如,我有这段代码,但在iOS11.3.1上它仍然无法正常工作。#import@interfaceViewController()@property(weak,nonatomic)IBOutletUILabel*latitudeValue;@property(weak,nonatomic)IBOutletUILabel*longtitudeValue;@property(nonatomic,strong)CLLocationManager*locationManager;-(void)

ios - 如何在 GCD block 中返回当前方法?

这是我的代码:-(void)viewDidLoad{[superviewDidLoad];[selftestGCD];}-(void)testGCD{staticdispatch_once_tonceToken;dispatch_once(&onceToken,^{NSLog(@"1");return;});NSLog(@"2");}控制台打印出1和2。我想要的只是第一次打印1。我认为return可能不是从方法返回,而是从block返回。有什么方法可以从这个GCDblock中的当前方法返回吗? 最佳答案 使用block来解决问题。-

iphone - 更改 rootViewController 与当前 ModalViewController

我很难思考更改应用的RootViewController与以模态方式呈现新ViewController的设计权衡。在什么情况下我应该改变根,在什么情况下我应该呈现模态?我正在寻找通用的应用程序设计指南。我是否应该始终呈现模态并且只建立一次rootViewController(在appDelegate中)? 最佳答案 呈现模态视图Controller的一个关键方面是当您关闭模态视图Controller时,您将返回到呈现它的View。更改View(假设您的意思是换出View)并不一定意味着返回到它所替换的View的模式。它只是取代了它。

ios - 当前可见 View Controller 检查

我正在从我的AppDelegate类检查我的ParentEndViewController当前是否是可见类。UIStoryboard*storyboard=[UIStoryboardstoryboardWithName:@"MainStoryboard_iPhone"bundle:nil];ParentEndViewController*parent=[storyboardinstantiateViewControllerWithIdentifier:@"ParentEndViewController"];if(parent.isViewLoaded&&parent.view.wind

iOS 7 如何获取当前选定的 UITextField id

调用dismissKeyboard时,我将每个UITextField添加到resignFirstResponder。有没有办法获取当前选定的UITextField的ID并使其成为resignFirstResponder?#import"NewBabyViewController.h"@interfaceNewBabyViewController()@property(weak,nonatomic)IBOutletUITextField*BabyName;@property(weak,nonatomic)IBOutletUITextField*BabyNickname;@end@impl