我正在开发一个带有自定义拆分视图的Ipad应用程序.在主视图中我有一个tableViewController.我在导航栏中添加了一个带有添加按钮的项目.此按钮链接(我使用故事板)与popover segue链接到另一个tableViewController,其中包含一些输入数据的单元格.按钮"save"将popover视图与masterView列表中的添加项目相关联.我接下来要做的是链接主视图的原型单元格到另一个视图,以使用户能够编辑所选项目.我想将这个视图与popover segue链接(就像添加按钮一样)并且问题在哪里:我从xcode得到一个红色问题:无法编译连接:=> anchorView = >>.
这是我的代码样本,工作正常.当我点击一个单元格进行编辑时,我想做同样的事情.
masterSplitView表
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"assetCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// Configure the cell...
AssetModel *myAssetModel = [self.arrayAsset objectAtIndex:indexPath.row];
cell.textLabel.text = myAssetModel.name;
// cell.textLabel.text = @"test";
return cell;
}
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:@"addAssetSegue"]){
AddAssetTVC *addAssetTVC = segue.destinationViewController;
addAssetTVC.delegate = self;
UIStoryboardPopoverSegue* popoverSegue = (UIStoryboardPopoverSegue*)segue;
[addAssetTVC setPopoverController:[popoverSegue …Run Code Online (Sandbox Code Playgroud) 我尝试使用dateformatter显示日期,但是这个更改了日期的年份.
这是方法:
setLabelWithDate:(NSdate *)date{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
[dateFormatter setTimeZone:gmt];
[dateFormatter setDateFormat:@"dd MMMM YYYY"];
NSLog(@"Date : %@",date);
NSLog(@"stringFromDate %@",[dateFormatter stringFromDate:date]);
self.selectedDateLabel.text = [dateFormatter stringFromDate:date];
[dateFormatter release];
}
Run Code Online (Sandbox Code Playgroud)
这是控制台中显示的内容:
2012-05-04 13:08:50.442 MyAppli[3339:fb03] Date : 2012-12-30 00:00:00 +0000
2012-05-04 13:08:50.443 MyAppli[3339:fb03] stringFromDate 30 December 2013
Run Code Online (Sandbox Code Playgroud)
我在这里.dateFormatter添加myDate一年,我真的不知道为什么.这种情况仅发生在一年中的最后2个日期(12月30日和31日).
谢谢你的帮助.
亚历山大
我正在尝试将flurry SDK添加到我的项目中,但我发出此警告:没有规则来处理文件'$(PROJECT_DIR)/ Flurry iPad SDK v4.0.6/Flurry iOS API Documentation/assets/jquery.js'类型sourcecode.javascript for architecture armv7
谢谢您的帮助,
亚历山大
我Transaction在我的Core Data应用程序中添加了一些名为s的对象.这些交易与帐户相关联.
我想在保存所有交易时更新帐户金额.有时会出现并发异常
"收集在被列举时发生变异"
NSArray *matches = [managedObjectContext executeFetchRequest:request error:&error];在accountManagedObjectWithId方法中排队.
//TransactionsManager
- (BOOL)addRepeatTransaction:(Transaction *)transaction{
Account *accountTrx = transaction.account;
double accountAmount = accountTrx.amount;
for (int i =0; i<nbRepeat; i++){
accountAmount +=transactionBiz.amount;
[[Persister instance] registerTransaction:transaction];
}
[[Persister instance]editAmountAccount:transaction.account amount:accountAmount];
[[Persister instance]saveContext];
return YES;
}
//Persister
-(id)init {
if (self = [super init]){
managedObjectContext = [appDelegate managedObjectContext];
return self;
}
return nil;
}
-(BOOL)registerTransaction:(Transaction *)transaction {
TransactionManagedObject *transactionsRow = (TransactionsManagedObject *)[NSEntityDescription insertNewObjectForEntityForName:@"Transactions" inManagedObjectContext:managedObjectContext];
transactionsRow.idTransaction = [NSNumber numberWithInt:transaction.idTransaction];
transactionsRow.name …Run Code Online (Sandbox Code Playgroud) ios ×2
build ×1
cell ×1
concurrency ×1
core-data ×1
date ×1
flurry ×1
ios5 ×1
objective-c ×1
popover ×1
segue ×1
storyboard ×1