Tag: ios5

iPhone上的Xcode和iOS5.1将不起作用

我错过了什么? 我更新了我的iPhone到5.1,现在Xcode不会安装开发人员的应用程序。 主办单位: 操作系统安装在用户的iPhone 5.1(9B179) Xcode支持iOS版本最新5.0(9A334)4.3 4.2

如何:在MKMapView上显示MKOverlay

我需要在地图上显示MKOverlay,但无法实际显示。 我正在关注苹果“ 位置感知编程指南”中的示例 ,并且不会显示覆盖图。 任何帮助将不胜感激,这是我所做的第一个iPhone应用程序,所以我可能会错过简单的东西。 NavViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface NavViewController : UIViewController <MKMapViewDelegate> { } @property (weak, nonatomic) IBOutlet MKMapView *mapView; @end NavViewController.m #import "MSUNavViewController.h" #import <CoreLocation/CoreLocation.h> – (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay { if ([overlay isKindOfClass:[MKPolygon class]]) { MKPolygonView* aView = [[MKPolygonView alloc] initWithPolygon:(MKPolygon*)overlay]; aView.fillColor = [[UIColor cyanColor] colorWithAlphaComponent:0.2]; aView.strokeColor = [[UIColor […]

Facebook iOS SDK Feed对话框authentication之后的问题

我似乎有一个与我以前没有的饲料对话框的问题。 我怀疑这是因为iOS 5,但我不确定。 如果用户需要身份validation,他将被redirect到Facebook应用程序,然后返回到我的应用程序。 之后,用户点击一个“分享”button,并出现供稿对话框。 但突然间,它消失了 。 如果用户再次点击“分享”,则对话框正常工作。 这只是第一次,从身份validation返回到应用程序… 与“共享”button相关的代码就是这样的: if ([facebook isSessionValid]) { [facebook dialog:@"feed" andParams:params andDelegate:self]; } paramsvariables总是设置为正确的值,不是零。 如果会话无效,则用户正被发送到authentication方法。 我也尝试在FBDialog.m中注释一个IF语句,我已经在某处读过,但是没有成功。 任何人遇到同样的问题? 谢谢! 编辑:我敢肯定,这是因为现在的iOS 5,因为我已经在运行iOS 4.3的iPad 2上构build了项目,并且从第一次就可以正常工作。 编辑2:它突然工作正常。 …我没有改变任何东西O_O

iOS:Facebook评论插件移动不断重新加载

最近我一直试图将Facebook社交插件整合到iOS中的自定义UIWebView中,以评论网页。 我已经添加了Likebutton以及Comments插件。 以下是我加载到Web视图中的HTML代码: <html> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="http://www.heretheweb.com" data-send="false" data-layout="button_count" data-width="240" data-show-faces="false"></div> <div class="fb-comments" data-href="http://www.heretheweb.com" data-num-posts="5" data-width="470"></div> <body> </html> 星期一的第一个实现是在4个平台,包括模拟器(iOS 4和iOS 5),iPhone 3G iOS4和iPhone 4 iOS 5中获得成功。星期二,我继续开发这个,最后我用自定义UIWebView工作,没有任何问题前三名。 […]

IBOutlets到故事板中的其他视图控制器

我想用UIPageViewController在多个视图控制器之间切换。 这些视图控制器是静态的,所以我想devise他们在我的故事板。 由于不能使用关系或segues将它们连接到UIPageViewController而是一个数据源,所以我需要一个带有IBOutletCollection的数据源对象来保存这些页面: @property (retain, nonatomic) IBOutletCollection(UIViewController) NSArray* pages; 虽然,我不能将这个sockets连接到有问题的视图控制器。 我想那是因为故事板中的视图控制器被完全独立处理,就像它们在不同的nib文件中一样。 有没有解决scheme? 我不想在代码中devise这些视图控制器。

MKMapView – 删除注释导致应用程序崩溃

从我的地图视图中删除注释以下列方式: if ([[self.mapView annotations] count] > 0) { [self.mapView removeAnnotations:[self.mapView annotations]]; } 导致我的应用程序崩溃,出现以下exception: *** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <MKAnnotationContainerView 0xe87b420> for the key path "title" from <PFAnnotation 0x10851230> because it is not registered as an observer.' 注释按以下方式添加: CLLocationCoordinate2D pinPosition; for (int index = 0; index < [array […]

ACAccountStore错误5

尝试将帐户保存到ACAccountStore时,有时会收到此错误。 后来,如果我试图访问这个帐户,我发现它实际上已被保存。 到目前为止,我还没有find任何有关这个不伦不类的错误的信息。 有谁知道这是什么意思? 错误域= com.apple.accounts Code = 5“操作无法完成(com.apple.accounts错误5)”

自动引用计数:快速枚举时出错

在更新下面的代码以使用iOS 5自动引用计数时,当尝试执行快速枚举时将“state-> itemPtr”分配给缓冲区时会发生错误,以便可以使用“foreach”循环迭代实现类。 我得到的错误是“指定'__autoreleasing id *'为'__unsafe_unretained id *'更改指针保留/释放属性”。 查看带注释的代码行。 /* * @see http://cocoawithlove.com/2008/05/implementing-countbyenumeratingwithstat.html * @see http://www.mikeash.com/pyblog/friday-qa-2010-04-16-implementing-fast-enumeration.html */ – (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState *)state objects: (id *)buffer count: (NSUInteger)bufferSize { NSUInteger arrayIndex = (NSUInteger)state->state; NSUInteger arraySize = [_tuples count]; NSUInteger bufferIndex = 0; while ((arrayIndex < arraySize) && (bufferIndex < bufferSize)) { buffer[bufferIndex] = [_tuples objectAtIndex: arrayIndex]; […]

BOOL方法在块内部不返回YES

我创build了一个返回BOOL的新方法,如下所示。 +(BOOL)checkIfGameAlreadyExistsAgainst:(PFUser *)opponentUser { // Find all the games where the current user is user1 and the opponentUser is user2 PFQuery *currentUserIsUser1 = [PFQuery queryWithClassName:@"Game"]; [currentUserIsUser1 whereKey:kMESGameUser1 equalTo:[PFUser currentUser]]; [currentUserIsUser1 whereKey:kMESGameUser2 equalTo:opponentUser]; [currentUserIsUser1 whereKey:kMESGameIsActive equalTo:[NSNumber numberWithBool:YES]]; [currentUserIsUser1 findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (objects) { // We have games where the current user is user1 […]

在其他iOS上自定义外观兼容性

我没有看到我的问题的答案,所以我问:我目前使用(无效)定制外观来定制我的标签栏和导航栏的devise。 这个function是否将我的应用限制在仅基于iOS5的iPhone? 如果没有,我的酒吧会在所有设备上看到相同的吗? 提前致谢。 这是我正在使用的方法: – (void)customizeAppearance { UIImage *tabBackground = [[UIImage imageNamed:@"bg_tab"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UITabBar appearance] setBackgroundImage:tabBackground]; [[UITabBar appearance] setSelectionIndicatorImage: [UIImage imageNamed:@"bg_tab_selected"]]; [[UITabBar appearance] setSelectedImageTintColor:[UIColor whiteColor]]; }