Tag: xcode

swift编译器显示预期的声明错误?

当这个代码写入AllListViewController并运行时,编译器显示Expected Declaration错误: for list in lists{ let item = ChecklistItems() item.text = "Item for \(list.name))" list.items.append(item) }

在xcode 5中使用sqlite浏览器查看coredata

由于升级到XCode 5,我无法查看我的应用程序文件夹中的sqlite文件中的数据。 文件夹结构有所改变,但我仍然可以find正确的应用程序,但是当我用sqlite浏览器打开sqlite文件,似乎没有在CoreData中的任何数据。 有任何想法吗?

iPhone将不会在Xcode 6testing版中连接

我更新了iOS 8和Xcode 6testing版。 当我连接手机时,显示为“ 不合格设备 ”,您可以在其中select要运行的平台。 当我尝试在我的实际iPhone上运行项目时,出现Xcode中的错误消息: 在此设备上启用开发时遇到错误。 如果有人知道如何解决这个问题,我将非常感激,因为我没有find有关此错误消息的更多信息。

Obj-C – 如何使用单例在视图控制器之间传递数据?

好吧,这是我昨晚问的一个问题的延伸。 对于如何使用各种技术在视图控制器之间传递数据,我有一点点的把握。 我想去MVC路线,创build一个Singleton类似乎是最接近MVC的概念。 基本上我创build了一个简单的应用程序与两个视图控制器和一个单身类。 我正在尝试将文本字段的值传递给UILabel。 无论出于何种原因,这是行不通的。 这是我的代码看起来像。 ViewController.h #import <UIKit/UIKit.h> #import "Model.h" #import "ViewController2.h" @interface ViewController : UIViewController { NSString *text2pass; } @property (weak, nonatomic) IBOutlet UITextField *tf; @property (weak, nonatomic) IBOutlet UILabel *btn; – (IBAction)go:(id)sender; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize tf = _tf; @synthesize btn = _btn; – […]

parsing目标C中的纯JSON数组

我想parsing一个普通的JSON数组,如: { "ns": [ [ "1364987475027", "Alert1", "001" ], [ "1364987475042", "Alert2", "001" ], [ "1364987475058", "Alert4", "001" ] ] } 以简单的string数组获取数组。 我发现有很多JSON字典数组的post。 但在这种情况下,JSON不具有值的键。 请帮助。

我的第一个Xcode视图控制器不像其他人一样。 为什么?

现在我有这张照片 。 它显示我可以拖动button到viewcontroller.swift使用根视图控制器。 接下来请看看这张照片 。 这张照片显示我无法使用我的第三个视图控制器将button拖入viewcontroller.swift。 有人可以帮我吗? 我不知道如何解决这个问题。

徽章计数没有增加推送通知。总是徽章计数保持1?

当应用程序处于后台进行推送通知时,我的应用程序徽章数量不会增加。仅当第一次推送通知时计数增加1,并始终将徽章计数保留为1,如果我获得更多1通知,则徽章计数仅保留1。 以下是我的代码 – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSString *message = nil; id alert = [userInfo objectForKey:@"aps"]; if ([alert isKindOfClass:[NSString class]]) { message = alert; } else if ([alert isKindOfClass:[NSDictionary class]]) { message = [alert objectForKey:@"alert"]; } if (alert) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"xyz" message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel", nil]; alertView.tag=2525; [alertView show]; } […]

条纹和Apple Pay无法在iOS应用程序中工作

我感到非常沮丧,因为我花了很长时间解决这个问题。 我正在使用下面的代码创build一个请求: PKPaymentRequest *request = [Stripe paymentRequestWithMerchantIdentifier:merchantId]; // Configure your request here. NSString *label = @"Product Description"; NSDecimalNumber *amount = [NSDecimalNumber decimalNumberWithString:[productpriceDouble stringByReplacingOccurrencesOfString:@"$" withString:@""]]; request.paymentSummaryItems = @[ [PKPaymentSummaryItem summaryItemWithLabel:label amount:amount] ]; request.merchantIdentifier = @"merchantId"; request.countryCode = @"US"; request.currencyCode = @"USD"; request.merchantCapabilities = PKMerchantCapability3DS; PKPaymentAuthorizationViewController *paymentController; paymentController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request]; paymentController.delegate = self; [self presentViewController:paymentController […]

无效更新:第0节中的行数无效,以NSExceptiontypes的未捕获exception终止

我已阅读所有相关的post,并仍然有一个错误: '更新无效:部分0中的行数无效。更新(5)后,现有部分中包含的行数必须等于更新前(5)部分中包含的行数,加或减从该部分插入或删除的行数(插入0,删除1),加上或减去移入或移出该部分的行数(移入0,移出0)。 以下是详细信息: 我使用代码来打开钢琴表时,打开单元格给子单元格每行有不同数量的单元格,它工作得很好,但我需要修改一些事情,当我点击行打开然后如果我点击另一行我需要它打开第二个,closures第一个打开的行,这是我的代码rootView.m #pragma -mark TableViewDelegate – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 5; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { GCRetractableSectionController* sectionController = [self.retractableControllers objectAtIndex:section]; // NSLog(@"sectionController.numberOfRow %d",sectionController.numberOfRow ); return sectionController.numberOfRow; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { GCRetractableSectionController* sectionController = [self.retractableControllers objectAtIndex:indexPath.section]; return [sectionController cellForRow:indexPath.row]; } – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"index path […]

将一个Xcode项目导入另一个

我试图将我的一个xcode项目导入到另一个项目中,而我只是想知道是否有一些最佳的实践,或者如果有人有任何build议如何做到这一点? 谢谢。