在iOS中运行后台服务

我需要编写一个iOS应用程序,每30分钟向服务器发送一次数据。 当应用程序在后台可以工作吗? 它有多可靠?

直接从网站安装iOS应用程序 – 没有密码,没有iTunes,没有UDID

我刚刚从一个网站安装了一个应用程序 – 没有configuration文件,没有UDID,没有任何东西。 它刚刚开始安装。 这怎么可能? 我没有越狱,没有运行新的testing版6.当它完成安装时,我点击它,它问我是否确定我想运行这个应用程序。 链接到“安静”安装的应用程序

在Google Maps SDK中的InfoWindow / Marker上添加Click事件,以实现本机iOS / Objective C

简单的问题 我正在开发一个适用于iOS的应用程序,其中embedded了用于本机iOS的新Google Map。 一切工作正常,除了一个问题,我不能find一个本地IOS / Objective-C的propper解决scheme既不在这里,也不在谷歌(如果有一个请给我看,对不起,烦你) 我想要什么:我希望用户点击打开信息窗口的标记。 之后如果他点击或点击信息窗口,它应该打开一个新的UIView进一步的信息。 我怎样才能做到这一点? 感谢您的build议

iPhone在后台收集CoreMotion数据。 (超过10分钟)

我正在尝试在后台收集coreMotion加速数据超过10分钟。 这一定是可能的,因为像睡眠周期这样的应用程序。 我只想确保这是允许的,因为它似乎不是其中之一: Apps that play audible content to the user while in the background, such as a music player app Apps that record audio content while in the background. Apps that keep users informed of their location at all times, such as a navigation app Apps that support Voice over Internet Protocol (VoIP) Apps […]

iPhone – 从Latitude和Longtiude获取城市名称

我想在我的iPhone应用程序中获取我的当前城市名称。 我目前正在使用CLLocationManager获取经度和纬度,比我将我的坐标传递到CLGeocoder。 CLGeocoder * geoCoder = [[CLGeocoder alloc] init]; [geoCoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { for (CLPlacemark * placemark in placemarks) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Current City" message:[NSString stringWithFormat:@"Your Current City:%@",[placemark locality]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil]; [alert show]; } }]; 这在iOS 5.0中工作正常,但不在iOS 4.3中工作。 另外,我开始使用Google Web服务 -(void)findLocationFor:(NSString *)latitudeStr andLontitude:(NSString *)longtitudeStr{ if ([self connectedToWiFi]){ […]

iOS下载并保存HTML文件

我试图下载一个网页(HTML),然后显示已下载的本地HTML在UIWebView中。 这是我所尝试过的 – NSString *stringURL = @"url to file"; NSURL *url = [NSURL URLWithString:stringURL]; NSData *urlData = [NSData dataWithContentsOfURL:url]; if ( urlData ) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"index.html"]; [urlData writeToFile:filePath atomically:YES]; } //Load the request in the UIWebView. [web loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle […]

如何在UIScrollview中embedded一个UITableView

我怎样才能在UIViewController(包含一个tableview作为子视图) 我最初有一个UIViewController显示预览部分(UIView) //Setup container for preview section UIView *tempContainer = [[UIView alloc]initWithFrame:CGRectMake(0, 20, 320, 100)]; self.preview_answer_container = tempContainer; self.preview_answer_container.backgroundColor = [UIColor clearColor]; [tempContainer release]; [self.view addSubview:self.preview_answer_container]; 我还在下面添加了一个UITableView(和一个search栏) //setup tableview UITableView *tempTable = [[UITableView alloc]initWithFrame:CGRectMake(0,44 ,320,self.view.frame.size.height – 44)]; self.tagFriendsTableView = tempTable; self.tagFriendsTableView.delegate = self; self.tagFriendsTableView.dataSource = self; [tempTable release]; [self.view addSubview:self.tagFriendsTableView]; 有了这个设置,我的滚动区域很小(只有预览部分下面的静态区域) 我怎样才能修改我的代码,使1)我可以向上滚动整个页面,即预览部分和tableview将一起向上滚动2)滚动作为一个整体将停止当search栏到达顶部(下方导航栏)(见截图),但UITableView中的内容仍然是可滚动的 编辑: 添加了UIScroll视图的代码。 然而,我没有任何改变。 […]

使用MDM通过NSUserDefaultsconfiguration企业应用程序

我在10.9的OS X Server 3.0.1中使用Profile Manager将我的企业应用程序推送到运行iOS7的托pipe设备。 这工作正常,我也能够推动设备configuration设置。 我的障碍是如何获取Apple示例项目ManagedAppConfig中提供的信息,并将其应用到由Profile Manager分发的应用程序。 ManagedAppConfig提供了一个简单的plist,用于将数据放入应用程序的NSUserDefaults中,然后用于应用​​程序configuration; 但是,如何使用MDM将这个数据字典放到NSUserDefaults中是没有方向的。 我显然错过了一个关于如何将数据发送到托pipe应用程序的NSUSerDefaults的信息,但到目前为止,我的search没有结果。 configuration文件pipe理器有可能吗? 有没有我还没有find的OS X服务器的另一种方式? 以下是来自苹果的ManagedAppConfig文档的引用: “ManagedAppConfig”演示了如何在iOS应用程序中实现托pipe应用程序configuration和反馈支持。 此function允许移动设备pipe理(MDM)服务器将字典压入托pipe应用程序的NSUserDefaults中,以便远程configuration设置。 下面是示例plist的两个数据,这些数据放在应用程序的NSUserDefaults中: <?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>serverURL</key> <string>http://developer.apple.com/</string> <key>disableCloudDocumentSync</key> <true/> </dict> </plist> NSUserDefaults的文档甚至提到通过MDMconfiguration,但没有具体的说明。 如果您的应用程序支持托pipe环境,则可以使用NSUserDefaults对象来确定pipe理员为了用户的利益pipe理哪些首选项。 托pipe环境对应于计算机实验室或教室,pipe理员或教师可能希望以特定方式configuration系统。 在这些情况下,教师可以build立一套默认的偏好,并强制这些偏好的用户。 如果以这种方式pipe理首选项,则应用程序应禁止用户通过禁用任何适当的控件来编辑该首选项。 我的下午一直在追寻这个难以捉摸的信息而没有成功,所以我请求SO社区的帮助。 任何人都可以指向我需要使用MDM将数据字典粘贴到NSUserDefaults的信息? 非常感谢。

iPhone的UITextField背景颜色

我无法使用borderStyle= UITextBorderStyleRoundedRect来控制UITextField的背景颜色。 使用这种边框样式, backgroundColor属性似乎只能控制沿圆angular矩形内边缘的非常窄的线条。 其余的领域仍然是白色的。 但是,如果borderStyle设置为UIBorderStyle=UITextBorderStyleBezel则UITextField的整个背景由其backgroundColor属性控制。 这是一个function吗? 有没有办法来控制borderStyle=UITextBorderStyleRoundedRect的UITextField borderStyle=UITextBorderStyleRoundedRect ?

获取button操作:UICollectionView单元格

我用nib创build了一个UICollectionViewCell ,并在其中添加了一个button,并创build了一个.h和.m文件,将这个类添加到了nibs file's owner中。然后在.m中写入一个button动作,通过插口连接它。 收集视图填充正常,但无法触发button操作。 我认为收集单元的代表被调用。 我怎样才能得到button的动作?