小编Ale*_*dre的帖子

显示动态原型单元格的弹出视图

我正在开发一个带有自定义拆分视图的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)

cell storyboard popover ios5 segue

5
推荐指数
1
解决办法
7244
查看次数

Dateformatter更改我的日期年份

我尝试使用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日).

谢谢你的帮助.

亚历山大

date objective-c nsdateformatter ios

5
推荐指数
1
解决办法
372
查看次数

Flurry Dependency analysys警告

我正在尝试将flurry SDK添加到我的项目中,但我发出此警告:没有规则来处理文件'$(PROJECT_DIR)/ Flurry iPad SDK v4.0.6/Flurry iOS API Documentation/assets/jquery.js'类型sourcecode.javascript for architecture armv7

谢谢您的帮助,

亚历山大

build flurry ios

2
推荐指数
1
解决办法
381
查看次数

核心数据并发 - 集合在枚举时发生了变异

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)

concurrency core-data nsmanagedobjectcontext

0
推荐指数
1
解决办法
3747
查看次数