Tag: ios5

在iOS 5上locking屏幕时,NSTimer事件不会发生

我已经看到了这几次,但我还没有真正看到一个明确的答案… 由于iOS 5我的应用程序似乎遇到了问题,如果用户locking屏幕,我的NSTimer在locking屏幕约20秒后停止发射。 这使得我的应用程序,如果用户locking屏幕,每次定时器触发无声点播放声音。 这只是因为我更新我的设备到iOS 5。 我的问题是1.是否有任何解决方法,使相同的function在更新的设备上工作或2.如果您的应用程序没有在locking状态下运行,build议您不要收到错误评论。

Facebook,iOS SDK

我目前正在制作一个Facebook的应用程序的iOS拉动configuration文件饲料,并把它放在一个UITableView。 当视图加载时: [facebook requestWithGraphPath:@"me/feed" andDelegate:self]; 和 – (void)请求:(FBRequest *)请求didLoad:(id)结果,我有: NSArray *messagesFBData = [result objectForKey:@"data"]; NSMutableArray *friendIds = [NSMutableArray arrayWithCapacity:messagesFBData.count]; NSMutableArray *fromData = [NSMutableArray arrayWithCapacity:messagesFBData.count]; NSMutableArray *imagesLocal = [NSMutableArray arrayWithCapacity:messagesFBData.count]; for (int x = 0; x < messagesFBData.count; x++) { if ([(NSDictionary *)[messagesFBData objectAtIndex:x] objectForKey:@"message"] != nil) { [friendIds addObject:[((NSDictionary*)[messagesFBData objectAtIndex:x]) objectForKey:@"message"]]; NSLog(@"loop Log: %@", [(NSDictionary […]

如何使用iPhone SDK更改图像的形状?

我正在创build一个iPhone应用程序,我想让用户能够更改给定图像的形状,如下所示。 我怎样才能做到这一点? 请告诉我。

GKNotificationBanner在iOS 4.3.3上

我在iOS 4.1+应用程序中使用框架GKAchievementNotification(https://github.com/typeoneerror/GKAchievementNotification)。 这个应用程序是由苹果批准(在应用程序商店),但似乎在iOS 4.3.3崩溃。 崩溃日志如下: OS Version: iPhone OS 4.3.3 (8J3) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crashed Thread: 0 Dyld Error Message: Symbol not found: _OBJC_CLASS_$_GKNotificationBanner Referenced from: /var/mobile/Applications/08289A0B-7AD3-4E37-B29F-A EDFE97B7ACA/PolarDefense.app/PolarDefense Expected in: /System/Library/Frameworks/GameKit.framework/GameKit in /var/mobile/Applications/08289A0B-7AD3-4E37-B29F-AEDFE97B7ACA/PolarDefense.app/PolarDefense Dyld Version: 191.3 看起来像框架没有正确地丢弃iOS版本的GKNotificationBanner,它不支持(5.0之前的iOS)。 我假设错误在于下面的代码,你认为它错了什么? @implementation GKAchievementHandler(private) – (void)displayNotification:(GKAchievementNotification *)notification { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= […]

肖像video到风景

我知道像这样的问题可能已经在那里,但为了像我这样的人,我会继续问 我有一个应用程序设置为只允许纵向定位,但是这个设置会影响我的video,因为我只希望video能够在横向上播放。 有没有一种方法可以添加到我的.m文件中来实现这个function? 这是我的代码; #import "BIDVideosViewController.h" @interface BIDVideosViewController () @end @implementation BIDVideosViewController @synthesize moviePlayer ; @synthesize tableList; – (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } – (void)viewDidLoad { [super viewDidLoad]; UITableView *table = [[UITableView alloc]initWithFrame:self.view.bounds]; [table setDelegate:self]; [table setDataSource:self]; [self.view addSubview:table]; tableList […]

将地址转换为经度和纬度

我想要执行以下操作 – 允许用户在iOS应用程序中input物理地址。 – 此地址转换为经度/纬度 – Django服务器代码检查以查看附近的位置。 我怎样才能最有效地做到这一点? 我应该将地址转换为ios应用程序中的经度和纬度,然后将坐标发送到django服务器代码,还是应该将地址发送到django服务器代码,然后将地址转换为经度和纬度? 任何帮助,将不胜感激!

在Objective-C iPhone上的图像上写文本,模拟器的字体大小不同于iPhone本身

我有一些非常奇怪的事情,我添加了一个图像的标题,一切正常,在模拟器上,但在设备本身的字体是非常小的… 使用此代码时遇到问题: -(UIImage*) drawTextOnPic:(NSString*) bottomText inImage:(UIImage*) image { UIFont *font = [UIFont boldSystemFontOfSize:48]; UIGraphicsBeginImageContext(image.size); [image drawInRect:CGRectMake(0,0,image.size.width,image.size.height)]; CGRect = CGRectMake(10.0f,10.0f,image.size.width-20.0f, image.size.height); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetShadow(context, CGSizeMake(2.5f, 2.5f), 5.0f); [[UIColor whiteColor] set]; [bottomText drawInRect:CGRectIntegral(rect) withFont:font lineBreakMode:UILineBreakModeClip alignment:UITextAlignmentCenter]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; } 有人知道为什么它只能在模拟器上工作吗? 顺便说一句,我使用iOS6的SDK,它可以在那里? 视网膜显示是什么东西? 如何解决这个问题?

ios5从mapview中删除注释

我刚刚开始在iOS,有一个初学者的问题。 我只是想添加并从我的地图删除一个别针,但得到一个错误: MapViewAnnotation类的实例0x6ec5750被释放,而键值观察者仍然在其中注册。 观测信息被泄露,甚至可能被误认为是其他物体。 我有一个带有头文件的MapViewAnnotation类 #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface MapViewAnnotation : NSObject <MKAnnotation>{ NSString *title; CLLocationCoordinate2D coordinate; } @property (nonatomic, copy) NSString *title; @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; – (id)initWithTitle:(NSString *)ttl andCoordinate:(CLLocationCoordinate2D)c2d; @end 和#import“MapViewAnnotation.h”的.m文件 @implementation MapViewAnnotation @synthesize title, coordinate; – (id)initWithTitle:(NSString *)ttl andCoordinate:(CLLocationCoordinate2D)c2d { self = [super init]; title = ttl; coordinate = c2d; […]

创build一个委托来从菜单中更改视图

我想能够从我的自定义菜单将视图控制器推到我的主子类导航控制器,我想要使用委托。 在我试图改变视图控制器之前,我去了一些更容易,改变当前的视图控制器标题。 这是迄今为止我写的代码,但在TableView单元上粘贴不会触发委托。 (或者看起来) 请指教 – > RootViewController / \ 容器容器 | | SlideMenuViewController SubClassed UINavigationController | | | | | UITableViewController VC1 VC2 VC3 VC4 SlideMenuViewController.h: @protocol SlidingMenuDelegate <NSObject> @end @interface SlideMenuViewController : UIViewController { id <SlidingMenuDelegate> delegate; } @property (strong, nonatomic) id delegate; SlideMenuViewController.m: – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //do something to […]

iOS 5.0的Xcode 4.2没有检测到iPhone iOS 5.1.1

我之前从Xcode 3更改为Snow Leopard的Xcode 4.2。 一切都很好,我开发的iPhone应用程序,一切都很顺利,直到今天…我警觉: “iPhone Prophone”上的iOS版本与此版本的iOS SDK版本不匹配。 请将设备恢复到下面列出的操作系统版本,或者更新到最新版本的iOS SDK; 这在这里可用。 这很奇怪,因为昨天我能用简单的“运行”testing我的iOS 5 (Xcode目标5.0,4C199)的应用程序与我的iPhone 4S,它具有iOS 5.1.1(9B206)很长一段时间。 在组织者 – >设备中,我的iPhone有一个黄色的圆点,暗示有什么不对。 我不认为我做了一些意想不到的事情,只是来了,开启了Mac,开启了Xcode …任何解决scheme? 我读过,但正如我所说 – 我使用新的Xcode几个星期,突然这个“无法检测”发生… 我卡住了,谢谢你的帮助。 编辑: 我在这个主题上发现了一些相关的东西,但我会稍微等一下 – 也许有一些更简单或更明显,我错过了。